Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="This Keyword 4 explicit binding using call() apply() method" />
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
var person = {
  init : function(name) {
    this.name = name;
  },
  getName : function() {
    console.log(this.name);
  }
};
person.init("Deepak");
person.getName();
// Here getName method is invoked in the context of person
var anotherPerson = {
  name : "Chetan"
};
person.getName.call(anotherPerson);
//person.getName.apply(anotherPerson);
// Here getName method is invoked in the context of anotherPerson
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
deepaksisodiyapro
0viewers