cd ../labs
JavaScriptbeginnerabout 45 minutes
JavaScript basics
Variables, functions, arrays and objects, written and run in the browser with checks on every step.
By the end you can
- Store values and print them
- Write functions that return results
- Work through arrays with map and filter
- Read and build objects
0 of 4 done
step 1 of 4
Values and printing
const holds a value that will not be reassigned. let holds one that will. Reach for const first and switch to let only when you need to.
console.log prints to the console below, which is how you check what your code is actually doing.
Make a const called price set to 600, a const called plan set to the text "Starter hosting", then print a sentence using both.
const name = "Ama";
let visits = 3;
console.log(`${name} has visited ${visits} times`);What we check
- price is the number 600
- plan is text
- You printed a sentence containing the price
- price is declared with const
script.jsjavascript
console
Nothing printed yet. Run your code.