JavaScript lessons: learn from scratch
Short lessons: the first line, then a condition, a loop and a function. Written by Nibras Code.
Questions and answers
- How do I start JavaScript? console.logWrite one sentence with console.log on your first HTML page.
- JavaScript if, for and functionsWrite a condition, a loop and your own function.
- JavaScript arrays: push and lengthKeep several values in one list, add an item at the end and read the count.
- JavaScript: walk an array with a for loopRead the items, find the sum and the largest, pick the evens and walk the array backwards.
- What happens when a button is clicked in JavaScript?A click event, changing text and a counter.
- JavaScript: read text from an inputprompt, HTML input.value and turning text into a number. Cancel returns null.
- A JavaScript error: what does undefined mean?A variable with no value, a missing index and the difference from null.