Info
Demo 4.17
Diagnosing bugs (fixed)
Files in this demo
├─ index.html ├─ style.css └─ script.js
Here’s the fixed version of the previous demo! These are the 4 bugs that were fixed.
- 1
changeText("Ready to click!";was missing its closing). Missing brackets are syntax errors, which stop the entire script from running. - 2
"myElement"was missing the#, so it couldn’t find the element and returnednull. - 3
newtextshould benewText. JavaScript is case-sensitive, so these are two different variables! - 4
redwas missing quotes. Without quotes, JavaScript thinks it’s a variable name, not a string.
Keyboard Shortcuts
⌘ Z / ⌘ ⇧ ZCtrl Z / Ctrl ⇧ Z
Undo / redo
Tab / ⇧ TabTab / ⇧ Tab
Indent / unindent selection
⌘ ] / ⌘ [Ctrl ] / Ctrl [
Indent / unindent lines
⌘ ACtrl A
Select all
⌘ DCtrl D
Select next occurrence of selection
⌥ ClickAlt Click
Add another cursor
⌘ /Ctrl /
Comment / uncomment lines
Ctrl SpaceCtrl Space
Autocomplete
Ctrl EnterCtrl Enter
Reset layout
⌘ ⌥ [ / ⌘ ⌥ ]Ctrl ⇧ [ / Ctrl ⇧ ]
Fold / unfold block
Code
The editor didn't load — try refreshing the page. Navigation,
shortcuts and the info panel still work in the meantime.
Settings
View
Font size
14
Code
Preview
Delay
Zoom
Share
Reset
Preview
Currently previewing:
Dimensions0 × 0
Delay
Preview paused
Click to resume
Click to resume
The preview is disabled for this demo.
Use the console below.
Use the console below.
Console
›