您的位置:首页 > 移动开发 > Objective-C

underscore.js_.functions[Object]

2012-04-16 21:38 357 查看
Returns a sorted list of the names of every method in an object — that is to say, the name of every function property of the object.

返回对象所包含的方法的列表,按A-Z排序.别名methods

_.functions(_);
=> ["all", "any", "bind", "bindAll", "clone", "compact", "compose" ...


源码:

_.functions = _.methods = function(obj) {
var names = [];
for (var key in obj) {
if (_.isFunction(obj[key])) names.push(key);
}
return names.sort();
};



                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: