using call function in javascript

Javascript function is  object which has their own properties and methods .One method that is available to each funtion object is call() which is defined on the prototype of the function .This method allow you to reuse a method from another object.

var podcast = {
 name : 'Astronomy podcast',
 download : function(episode) {
 console.log('Downloading ' + episode + ' of ' +;
};'the first episode');

var screencast = {
 name: 'Node tuts'
};, 'the last episode');

by calling the call method , we can reuse method download for screencast object.


About rahul23134654

Hi, I am Rahul Meha , B.E. in (I.T.)
This entry was posted in UI Js. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s