JS cheat sheet
programming-idioms.org · 9,991 words · saved by 1 readers
The snippets are under the CC-BY-SA license. Creative Commons Attribution-ShareAlike 3.0
JS 1 Print Hello World Print a literal string on standard output document.write("Hello World!"); Demo Doc Alternative implementation: console.log('Hello World'); Demo Doc Alternative implementation: console.log('Hello World') Doc 2 Print Hello 10 times Loop to execute some code a constant number of times for (let i = 0; i < 10; i++) { console.log("Hello"); } Demo Doc Alternative implementation: let count = 0; while (count < 10) { count++; console.log('Hello'); }; Alternative implementation: [...Array(10)].forEach(() => console.log('Hello')) Demo Alternative…
saved by
related reading
- JavaScript Articles - 30 seconds of code30secondsofcode.org
- Code Snippets • Josh W. Comeaujoshwcomeau.com
- SEO Cheat Sheet and Checklist Onlinehtmlcheatsheet.com
- Just JavaScriptjustjavascript.com
- Everything is Fertilenickcammarata.com
- JavaScript Articles - 30 seconds of code30secondsofcode.org
- CoffeeScriptcoffeescript.org
- GitHub - Experience-Monks/math-as-code: a cheat-sheet for mathematical notation in code formgithub.com
- Visual Effect - Interactive Effect Playgroundeffect.kitlangton.com
- Rust Iterator Cheat Sheetdanielkeep.github.io
- TypeScript: Documentation - The Basicstypescriptlang.org
- Numbers Every Programmer Should Know By Yearcolin-scott.github.io