Chrome/Firefox console.log always appends a line saying 'undefined'

前端 未结 7 1796
时光说笑
时光说笑 2020-11-21 13:40

Every time console.log is executed, a line saying undefined is appended to the output log.

It happens in both Firefox and Chrome on Windows

7条回答
  •  野性不改
    2020-11-21 14:18

    If you're using console.log to emit multiple values in a single line, here's a hacky alternative:

    var1 + ' ' + var2 + ' ' + var...
    

    (Better ideas welcome, this might blow up in certain circumstances)

提交回复
热议问题