Last active
June 6, 2016 10:40
-
-
Save sivaprabug/87e797419c1312e1a852ff048d145dd0 to your computer and use it in GitHub Desktop.
Javascript call() apply() bind() methods
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title></title> | |
| </head> | |
| <body> | |
| <script type="text/javascript"> | |
| function fullName(firstName, lastName, callback) { | |
| console.log("My name is " + firstName + " " + lastName); | |
| callback(lastName); | |
| } | |
| var greeting = function(lastName) { | |
| console.log('Welcome Mr. ' + lastName); | |
| }; | |
| fullName("Jackie", "Chan", greeting); | |
| </script> | |
| </body> | |
| </html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment