Collection of useful tools in the Chrome JavaScript console.
This is not special to Chrome, but still a clever thing:
document.body.contentEditable=true
You can easily measure the time on the console with named timers:
console.time('myTime'); // Start timer
console.timeEnd('myTime'); // End timer and print the time
Variables $0
, $1
, ... $n
reference the nth-last inspected Element. $0
is the element that's currently selected in the Elements panel.
inspect()
and dir()
help with inspecting elements. While inspect()
does just what Right Click > Inspect does, dir()
turns elements into objects that hold their properties. Try dir($0)
.
$_