有没有办法在节点中绘制多行表格?我试过这个:
console.table({a: "aaa\naaa", b: "bbb\nbbb"})
Run Code Online (Sandbox Code Playgroud)
但这只是删除所有换行符:
此代码运行最佳并且易于理解:
function evalInScope(js, contextAsScope) {
//# Return the results of the in-line anonymous function we .call with the passed context
return function() {
with(this) {
return eval(js);
};
}.call(contextAsScope);
}
evalInScope("a + b", {a: 1, b: 2}); // 3 obviously, but fails in strict mode!
Run Code Online (Sandbox Code Playgroud)
然而,“聪明”的大脑决定删除该with
声明,而不进行适当的替换。
问题:如何让它在自动处于严格模式的 ES6 中再次工作?