Reputation: 23818
Let say I need to track the window size and log the output. I add an event listner and use
console.log(window.innerWidth)
However this adds a new line to the console every time the window is resized.
What I need is to show the innerWidth in a single line in the console which updates it everytime the window is resized.
Upvotes: 1
Views: 656
Reputation: 25947
As Garbee said, you can't achieve that functionality in the standard Console. You could alternatively use a watch variable to keep track of window.innerWidth
. Unfortunately you need to manually reload it.
Upvotes: 2
Reputation: 10991
You can't have a line that updates. The console lines are appended to, not capable of being overwritten.
You need to build a custom UX to handle this need for your app as an overlay. Or you can use Device Mode as "Responsive" to let you resize freely and see the update width/height within that window.
Upvotes: 3