Tag: 返回值

函数返回一个函数的值

import.js exports.getConfig = function() { return api.getConfig(); }; test.js // Aanmaken lightBridge obj = reflector.getObj(); console.log(obj); // Toon alle lichten obj.getConfig().then(function(config) { console.log(config); }).done(); 在最后一个片段中,它使用了当我调用getConfig()的函数,我想要在variablesconfiguration中的输出。 现在的问题是,当我想logging我收到的variablestesting未定义。 如果我console.log(config)而不是返回configuration; 它完美的作品。 看起来很奇怪。 当我想使用它的结果就像varia.getConfig()=> config的输出。