Last active
October 21, 2016 11:54
-
-
Save rohan-paul/8c6087c65845b8b3ba25fd5ea8a8e70d 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 Website = { | |
updatePageView: function() { | |
for(var i = 0; i < arguments.length; i++) { | |
this.pageViewNumber += arguments[i]; | |
} | |
return this.pageViewNumber; | |
} | |
} | |
var profilePage = { | |
name: 'My Web page', | |
pageViewNumber: 0 | |
}; | |
Website.updatePageView.call(profilePage, 5, 6, 7, 8); | |
console.log(Website.updatePageView.call(profilePage)); | |
// Output => 26 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment