V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  TTPlayer  ›  全部回复第 1 页 / 共 1 页
回复总数  2
2017-04-25 14:09:21 +08:00
回复了 searene 创建的主题 Node.js 请问这段 js 代码为什么会输出 undefined?
var func = function func() {
return {
a: 1,
b: function b() {
return undefined.a;
}
};
};
var instance = func();
console.log(instance.b()); // undefined

以上的 babel 转换成 es5 后的代码,可以参考一下
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1850 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 00:36 · PVG 08:36 · LAX 17:36 · JFK 20:36
Developed with CodeLauncher
♥ Do have faith in what you're doing.