本記事ではNodeJSのコードを検証しています。ChromeやSafariなどブラウザによっては実装が異なる可能性があります。 consoleのソースコードを読む GitHub上に上がっています。node/lib/console.js ここの以下のコードがポイントとなります。 Console.prototype.log = function log(...args) { write(this._ignoreErrors, this._stdout, // The performance of .apply and the spread operator seems on par in V8 // 6.3 but the spread operator, unlike .apply(), pushes the elements // onto the stack. That is, it m
![log = console.log;はなぜダメなのか - Panda Noir](https://cdn-ak-scissors.b.st-hatena.com/image/square/95d176ec9ecbc05dd84d552edf63747043db7510/height=288;version=1;width=512/https%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Fp%2Fpanda_noir%2F20180108%2F20180108150303.png)