Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement