console.log() 有没有办法更新一行而不是添加新行?

Is there a way for console.log() to update a line instead of appending new ones?

如果我想跟踪一个更新非常频繁的变量,我可以做 console.log(myVar);,它会在控制台底部附加一行:

有没有办法替换最后一行的值,而不是在底部追加一个新行?

这会非常有用,因为这样我就可以查看以前的日志,而不会在顶部将它们滚出视图。

我试过以下方法:

console.clear();
console.log(myObject);
console.log(myVar);

但这不起作用,因为 re-logging 对象会折叠它们,而且它在 Chrome 中闪烁太多。我读了 MDN documentation on the console,尽管它有很多精巧的功能,但我无法弄清楚如何只重写一行。我看到它在 terminals/command 提示中完成,浏览器控制台是否具有该功能?

Google chrome 现在可以在主机中 "Create live expression"