Open original
Info
Demo 2.4

JavaScript libraries make your life easier

Files in this demo

├─ index.html
└─ script.js

Animating a burst of confetti from scratch would take a lot of code. Luckily, you don’t have to write it ~ a library is a bundle of pre-written code that someone else has shared for anyone to use.

To use one, you load it with a <script> tag that points to its address on the web (often a CDN). After it loads, you can call its features from your own code. This entire celebration is a single line: confetti().

There are libraries for almost everything ~ animation, sound, maps, 3D graphics, and more. You’ll find some in action in the other collections.

You finished this book!Start another book
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
⌘ /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.
Preview
Dimensions0 × 0
Delay
Console