How to hide source of Log messages in Console?

前端 未结 2 1492
滥情空心
滥情空心 2021-01-31 16:27

When outputting messages into the console, the source is also displayed (in Chrome Developer Tools it\'s on the right):

console.log(\"Foo\");                             


        
2条回答
  •  不思量自难忘°
    2021-01-31 17:19

    for those who are still looking for this, you can use something like

    function consoleWithNoSource(...params) {
      setTimeout(console.log.bind(console, ...params));
    }
    
    consoleWithNoSource("Helloo....!")

提交回复
热议问题