Skip to content

Instantly share code, notes, and snippets.

@andreinitescu
Last active April 7, 2016 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreinitescu/d511fb08dac340f4b90ed288acb82f29 to your computer and use it in GitHub Desktop.
Save andreinitescu/d511fb08dac340f4b90ed288acb82f29 to your computer and use it in GitHub Desktop.
esnextbin sketch
<!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>
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);
{
"name": "esnextbin-sketch",
"version": "0.0.0"
}
"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