the different between call and apply in javascript
2011-08-23 13:12
561 查看
function sayColor(spre, ssuf) {alert(spre + this.color + ssuf);}; var obj = new Object(); obj.color = 'red'; sayColor.call(obj, "this is ", " , a very nice"); # this is red a very nice sayColor( "this is ", " , a very nice"); # this is undefined a very nice sayColor.apply(obj, new Array("this is ", " a nice very")); #this is red a nice very
相关文章推荐
- call,apply and bind in the javascript
- The different between Char in C#.Net and in C++.Net(MFC)
- Call and Apply in JavaScript
- use noscript html tag when user disable the javascript in browser, guide user how to enable the js in different browser and retu
- Function.apply and Function.call in JavaScript
- the different between "in" and "exist "
- what is the different between function and method in python
- [转载]Function.apply and Function.call in JavaScript
- Function.apply and Function.call in JavaScript
- The usage of the Javascript method call and apply(what is the new and object.create difference.)(What does call(null) mean?)
- JavaScript closure: difference between call and apply as well as use them to create inheritance
- The different between #define and const for a constant in C
- What is the difference between call and apply?(关键词:call/apply/invoke)
- Function.apply and Function.call in JavaScript
- Call and Apply in JavaScript
- What is the difference between BIT and TINYINT in MySQL
- What is the Difference Between Type and Class in
- What are the differences between a pointer variable and a reference variable in C++?
- In PHP5, what is the difference between using self and $this? When is each appropriate?
- the confilict between validation and readonly in jquery