r/javascript • • Mar 18 '19

What's your favorite, most useful javascript one-liner?

385 Upvotes

422 comments sorted by

View all comments

5

u/Dmitry_Olyenyov Mar 19 '19

setTimeout(()=>{debugger},5000) To keep dropdowns opened, menu hovered and so on. All things that disappear after losing focus

5

u/kichien Mar 19 '19

Chrome dev tools - select element, right click on the element in the inspector, select "Break on" > "subtree modifications". Then you can click on the element and see it's focused state attributes in the inspector.

1

u/SarahC Mar 19 '19

Ooooooooooo...