Skip to content

Instantly share code, notes, and snippets.

@KevinTCoughlin
Last active March 8, 2017 21:49
Show Gist options
  • Save KevinTCoughlin/d151ed1cd047d9be896f8e3b8ba62632 to your computer and use it in GitHub Desktop.
Save KevinTCoughlin/d151ed1cd047d9be896f8e3b8ba62632 to your computer and use it in GitHub Desktop.
Chrome DevTools Console Cheatsheet
  • $_ - returns the value of the most recently evaluated expression.
  • $0-4 - Last five DOM elements inspected or last five JS heap objects
  • $(selector) - alias for document.querySelector()
  • $$(selector) - alias for document.querySelectorAll()
  • $x(path) - array of DOM elements that match the XPath expression (e.g "//p[a]")
  • clear() - clear console
  • copy(object) - copy object to clipboard
  • debug(function) - debugger invoked and breaks inside the function
  • dir(object) - object-style listing of all specified objects properties, alias for console.dir()
  • getEventListeners(object) - returns the event listeners on an object
  • inspect(object/function) - jump to object / node / function
  • keys(object) - dump keys of an object
  • monitor(function) - monitor calls to a function
  • monitorEvents(object[, events]) - listens to events on a DOM node of a given event type
  • profile() / profileEnd() - adds perf logging start and end to functions
  • table(data, [columns]) - dumps object as a table with optional named columns
  • values(); - dumps values of an object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment