

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 6
click for more info
Not enough gems
Cost: 6 gems
1: Learn JavaScript
incomplete
2: Basic Variables
incomplete
3: let and const
incomplete
4: Why JavaScript?
incomplete
5: Comments
incomplete
6: Numbers in JS
incomplete
7: Numbers Review
incomplete
8: Increment and Decrement
incomplete
9: Undefined vs. Undeclared
incomplete
10: Null vs. Undefined
incomplete
11: Dynamic and Weak
incomplete
12: Same Line Declarations
incomplete
13: JavaScript's Speed
incomplete
14: Strings
incomplete
15: Template Literals
incomplete
16: Java vs. JavaScript
incomplete
17: Semi-Colons in JS
incomplete
18: String Encoding
incomplete
19: Camel Case in JS
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
In Python, numbers without a decimal part are called Integers (int) and fractions are Floats (float). Contrast this to JavaScript where all numbers are just a Number type.
You're already familiar with the number type. Numbers aren't surrounded by quotes when created, but they can contain decimal parts and negative signs.
let x = 2; // this is a number
x = 5.69; // this is also a number
x = -5.42; // yup, still a number
You can do arithmetic as you'd expect:
let sum = 2 + 3 + 7; // 12
let difference = 5.3 - 2.1; // 3.2
let product = 2 * 3; // 6
let quotient = 6 / 2; // 3
Textio tracks the number of messages sent for different types of notifications. Between the comments, create a:
totalMessagesSent variable that contains the total number of messages sent.averageMessagesSent variable that contains the average number of messages sent across all types.