【发布时间】:2017-03-08 11:12:38
【问题描述】:
我遇到过这个例子,完全迷失了......
const test = (hey) => console.log(hey);
console.log(test `wtf`);
首先这一切都是有效的,在console.log中,它似乎是
["wtf", raw: Array[1]]
好像函数被执行了,还有额外的raw?有人可以解释一下吗?
【问题讨论】:
-
console.log(test "w**f");? -
@anant 你已经审查了“t”...?
标签: javascript ecmascript-6 template-literals tagged-templates