Node vs Chrome, assigning console.log to a variable?

前端 未结 2 1633
情深已故
情深已故 2021-01-12 03:35

When I assign console.log to a variable in node.js it works fine,

var l = console.log
l(1) # outputs 1

However, if I do the sa

2条回答
  •  北恋
    北恋 (楼主)
    2021-01-12 04:10

    Node.js console does console.log = console.log.bind(this) in constructor.

提交回复
热议问题