Today's tip: From Hello, World to hired.

Courses / JavaScript & the DOM / Lesson 1

1. Values, variables and const

Every programmer starts here. In this lesson you write a complete program, run it, and change it until it does what you want.

Arrays: map, filter, reducejavascript
const orders = [12.5, 80, 7.25, 43];

const big = orders.filter(total => total > 20);
const withTax = big.map(total => total * 1.19);
const sum = withTax.reduce((a, b) => a + b, 0);

console.log(sum.toFixed(2)); // "146.37"

Your turn

Change the program so it greets you by name, then run it in the playground. The checks turn green when the output matches.

Open the playground Next lesson →