Skip to content

PRO TIP Block youtube.com at the DNS level — Pi-hole, NextDNS or your hosts file — but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

JavaScript ARITHMETIC OPERATORS in 8 minutes! ➕

126.1K views on YouTube

00:00:00 arithmetic operators
00:03:21 augmented assignment operators
00:04:54 increment/decrement operators
00:05:23 operator precedence
00:07:51 conclusion

// arithmetic operators = operands (values, variables, etc.)
// operators (+ – * /)
// ex. 11 = x + 5;

let students = 30;

//students = students + 1;
//students = students – 1;
//students = students * 2;
//students = students / 2;
//students = students ** 2;
//let extraStudents = students % 3;

console.log(students);

//students += 1;
//students -= 1;
//students *= 2;
//students /= 2;
//students **= 2;
//students %= 2;

//students++;
//students–;

/*
operator precedence
1. parenthesis ()
2. exponents
3. multiplication & division & modulo
4. addition & subtraction
*/