The Call() Method
|
|
The first argument of the Call() Method is the object to be used for 'this'. |
All other arguments are passed directly to the function itself. |
function sayColor(sPrefix, sSuffix) { alert(sPrefix + this.color + sSuffix); };
var obj = new Object(); obj.color = "red";
sayColor.call(obj, "The color is ", ", a very nice color indeed. ");
|
|
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
|