More Related Content Similar to Debug like a doctor (20) Debug like a doctor1. DEBUG LIKE A DOCTOR
USING GOOGLE CHROME DEVTOOLS
Presented by @lahdiouiouadie
6. SELECTING ELEMENTS IN CONSOLE
$() = document.querySelector()
$$() = document.querySelectorAll()
$0 – $4 = A history of the five most recent DOM elements
24. FILTER FOR A FUNCTION OR SELECTOR WITHIN A
FILE
Ctrl + Shift + O
30. WRITING TO THE CONSOLE
console.log() | error() | warn()
console.log("Node count:", a.childNodes.length, "and the current time is:"
console.log
32. GROUPING OUTPUT
var user = "jsmith", authenticated = false;
console.group(
console.log(
// authentication
if (!authenticate
console
}
console.groupEnd(
34. MEASURING HOW LONG SOMETHING TAKES
console.time("Array initialize");
var array=
for (
array[i]
};
console.timeEnd(
39. RESOURCES
15 must know chrome devtools tips tricks by Danny
Markov
Devtoolstips by Jeferson Koslowski
www.developer.chrome.com