Skip to content

Instantly share code, notes, and snippets.

@kanayannet
Created October 9, 2012 13:43
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 kanayannet/3858896 to your computer and use it in GitHub Desktop.
Save kanayannet/3858896 to your computer and use it in GitHub Desktop.
new iroiro test
function Gadget()
{
var specs = {
width:300,
height:400,
};
this.get_specs = function()
{
return specs;
};
}
Gadget.prototype = (function(){
var specs2 = {
width:300,
height:400,
};
return {
get_specs2: function()
{
return specs2;
}
};
}());
var toy = new Gadget();
var specs = toy.get_specs();
specs.width = 200;
var specs2 = toy.get_specs2();
specs2.width = 200;
console.dir(toy.get_specs());
console.dir(toy.get_specs2());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment