Skip to content

Instantly share code, notes, and snippets.

@sivaprabug
Last active June 6, 2016 10:40
Show Gist options
  • Select an option

  • Save sivaprabug/87e797419c1312e1a852ff048d145dd0 to your computer and use it in GitHub Desktop.

Select an option

Save sivaprabug/87e797419c1312e1a852ff048d145dd0 to your computer and use it in GitHub Desktop.
Javascript call() apply() bind() methods
<!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