Info
Demo 4.16
Diagnosing bugs
Files in this demo
├─ index.html ├─ style.css └─ script.js
This demo is broken! There are 4 bugs hiding in script.js. When it works, the text should say “Ready to click!” and turn big, red, and highlighted when you click the button.
How to diagnose a bug:
- 1Open the console. Bugs show up as red error messages.
- 2Read the error. It tells you what went wrong and which line it happened on.
- 3Fix one bug at a time. One error can hide others, so new errors may appear as you fix old ones.
Common bugs include typos, missing quotes, missing brackets, and mismatched capitalization.
Stuck? Check the next demo for the answers.
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
›