made with esnextbin
Last active
April 7, 2016 10:13
-
-
Save andreinitescu/d511fb08dac340f4b90ed288acb82f29 to your computer and use it in GitHub Desktop.
esnextbin sketch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>ESNextbin Sketch</title> | |
<!-- put additional styles and scripts here --> | |
</head> | |
<body> | |
<!-- put markup and other contents here --> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function MyFunc() | |
{ | |
this.x = 1; | |
this.addX = function() { | |
this.x += 1; | |
} | |
} | |
MyFunc.prototype.y = 1; | |
MyFunc.prototype.addY = function () { | |
this.y += 2; | |
} | |
var inst1 = new MyFunc(); | |
var inst2 = new MyFunc(); | |
console.clear(); | |
console.log(inst1.prototype); | |
console.log(inst1.__proto__); | |
console.log(MyFunc); | |
console.log(MyFunc.prototype); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "esnextbin-sketch", | |
"version": "0.0.0" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
function MyFunc() { | |
this.x = 1; | |
this.addX = function () { | |
this.x += 1; | |
}; | |
} | |
MyFunc.prototype.y = 1; | |
MyFunc.prototype.addY = function () { | |
this.y += 2; | |
}; | |
var inst1 = new MyFunc(); | |
var inst2 = new MyFunc(); | |
console.clear(); | |
console.log(inst1.prototype); | |
console.log(inst1.__proto__); | |
console.log(MyFunc); | |
console.log(MyFunc.prototype); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment