Function.call() : Function Object « Function « JavaScript Tutorial






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>








7.2.Function Object
7.2.1.Function() (capital F)
7.2.2.Function.apply()
7.2.3.Function.arguments
7.2.4.Function.arity
7.2.5.Function.call()
7.2.6.Function.caller
7.2.7.Function.prototype
7.2.8.Function.toSource()
7.2.9.Function.toString()