_.functions()函數用於返回對象中存在的所有方法的排序列表。
用法:
_.functions(object)
參數:該函數接受上述和以下描述的單個參數:
- object:它包含持有元素[key,value]對的object元素。
返回值:它返回對象中存在的所有方法的排序列表。
例:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src=
"https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.9.1/underscore-min.js">
</script>
</head>
<body>
<script type="text/javascript">
console.log(_.functions(_));
</script>
</body>
</html>
輸出:
相關用法
注:本文由純淨天空篩選整理自AshokJaiswal大神的英文原創作品 Underscore.js | _.functions() Function。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。