Function.call() : Function Object : Function JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Function » Function Object »

 

Function.call()










Syntax








function.call(this)
    function.call(this, arg1, arg2, ..., argN)



The call() method can call another object's method.

Optional arguments can be passed to the method as shown in the second syntactical definition.












<html>
    <script language="JavaScript1.3">
    <!--
    function person (author, name){
      this.name = name;
      this.author = true;
    }
    function authors(name, books){
      this.books = books;
      person.call(this, name);
    }
    authors.prototype = new person();
    var myAuthor = new authors("Allen"5);
    -->
    </script>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Function
» Function Object