Last active
August 29, 2015 14:22
-
-
Save santosh79/e7cffe38b65722330c4e to your computer and use it in GitHub Desktop.
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
var a = { | |
getVal: function() { | |
return this.val; | |
}, | |
setVal: function(val) { | |
this.val = val; | |
} | |
}; | |
function printVal() { | |
console.log("The value of A: " + a.getVal()); | |
} | |
a.setVal(10); | |
printVal(a); | |
a.setVal(20); | |
a.setVal(30); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment