Created
October 9, 2012 13:43
-
-
Save kanayannet/3858896 to your computer and use it in GitHub Desktop.
new iroiro test
This file contains 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 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