Underscore.JS isUndefined方法 语法 _.isUndefined(object)JavaScriptCopy isUndefined方法用于检查对象是否为isUndefined。请参考以下示例: 示例 var _ = require('underscore'); var value; //Example 1: Check if argument passed is undefined console.log(_.isUndefined(value)); value = 0; //Example 2: Check if argument passed is not undefined console.log(_.isUndefined(value));JavaScriptCopy 将上述程序保存在 tester.js 中,运行以下命令来执行该程序。 命令 >node tester.jsJavaScriptCopy 输出 true falseJavaScriptCopy