Cmd + O
Ctrl + O
Cmd + Opt + F
Ctrl + Shift + F
function addFour(num) {
return num + 4;
}
function calculateValue() {
...
}
function multiplyByThree(num) {
...
}
function subtractTwo(num) {
...
}
function onButtonClick() {
...
}
function addFour(t){return t+4}function calculateValue
(){var t=6;return t=subtractTwo(t),t=multiplyByThree(t)
,t=addFour(t),console.assert(16===t,"Value wasn't 16.")
,t}function multiplyByThree(t){return 4*t}function
subtractTwo(t){return t-2}function onButtonClick(){var
t=document.getElementById("value");t.innerHTML="Value:
"+calculateValue()}
function calculateValue() {
var t = 6;
return t = subtractTwo(t),
t = multiplyByThree(t),
t = addFour(t),
console.assert(16 === t, "Value wasn't 16."),
t
}
{
"version": 3,
"sources": ["add-four.js", "on-click.js",...],
"names": ["addFour", "num", "value",...],
"mappings": "AAAA,QAASA,SAAQC,GACb,...",
"file": "bundle.js"
}
todo: pic of visualizer
"all source maps do is map a position in the compiled source to a position in the original source"
<=> WebSockets <=>
Chrome Desktop
DevTools
(Chrome Debugger Protocol)
<=> WebSockets <=>
Chrome Desktop
Chrome on Android
Node
DevTools
Sublime Text
WebStorm
Visual Studio Code
IntelliJ IDEA
(Chrome Debugger Protocol)
node-debug test.js
<=> WebSockets <=>
Chrome Desktop
Chrome on Android
Node
DevTools
Sublime Text
WebStorm
Visual Studio Code
IntelliJ IDEA
(Chrome Debugger Protocol)
bit.ly/js-debugging
@mattzeunert