logo

Mootools Hash: extend2012-11-14

方法 Hash: extend
Extends this Hash with the key-value pairs from the object passed in.

语法:
myHash.extend(properties);

参数:
1. properties - (object) The object whose items should be extended into this Hash

返回:
•(hash) This Hash, extended.

例子:
var hash = new Hash({
'name': 'John',
'lastName': 'Doe'
});
var properties = {
'age': '20',
'sex': 'male',
'lastName': 'Dorian'
};
hash.extend(properties);
//hash now holds an object containing: { 'name': 'John', 'lastName': 'Dorian', 'age': '20', 'sex': 'male' };

扫描二维码分享话题