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

前端 未结 7 1636
时光说笑
时光说笑 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:06

    undefined is the return value of the console.log() in Chrome developer tools. You will get undefined if you do the following in Chrome developer tools, and you will see that you get undefined even though x has the value 3.

    > let x = 3
    > undefined
    

提交回复
热议问题