为什么用node运行后报错了(黑色背景那张图片)?我把代码放在谷歌浏览器调试工具那里运行却能输出正确结果?
function learn(something){
console.log(something);
}
function we(callback,something){
something += ' is cool';
callback(something);
}
we(learn, 'Nodejs')
SyntaxError: Unexpected identifier
at Object.exports.createScript (vm.js:24:10)
at REPLServer.defaultEval (repl.js:235:25)
at bound (domain.js:287:14)
at REPLServer.runBound [as eval] (domain.js:300:12)
at REPLServer.<anonymous> (repl.js:431:12)
at emitOne (events.js:82:20)
at REPLServer.emit (events.js:169:7)
at REPLServer.Interface._onLine (readline.js:211:10)
at REPLServer.Interface._line (readline.js:550:8)
at REPLServer.Interface._ttyWrite (readline.js:827:14)