Created
October 13, 2010 13:01
-
-
Save mklabs/623983 to your computer and use it in GitHub Desktop.
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
// 3: given the following code, how would you override the value of the bar | |
// property for the variable foo without affecting the value of the bar | |
// property for the variable bim? how would you affect the value of the bar | |
// property for both foo and bim? how would you add a method to foo and bim to | |
// console.log the value of each object's bar property? how would you tell if | |
// the object's bar property had been overridden for the particular object? | |
var Thinger = function() { | |
return this; | |
}; | |
Thinger.prototype = { | |
bar : 'baz' | |
}; | |
var foo = new Thinger(), | |
bim = new Thinger(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment