

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 5
click for more info
Not enough gems
Cost: 6 gems
1: Loops
incomplete
2: Break
incomplete
3: Continue
incomplete
4: While
incomplete
5: For...in
incomplete
This lesson's interactive features are locked, please to keep using them
A traditional "for loop" in JavaScript looks like this:
for (let i = 0; i < 5; i++) {
console.log(i);
}
// 0
// 1
// 2
// 3
// 4This syntax is common in C-style languages. In English, the code says:
Start with i equals 0. (let i = 0)
Start a loop iteration if i is less than 5. Otherwise, exit the loop.
Log i to the console. (console.log(i))
Add 1 to i. (i++)
Go back to step 2.
Complete the bulkSendCost function. It takes as input a number and returns a number.
For example, for four messages:
Message 1: 1.0 + 0.00
Message 2: 1.0 + 0.01
Message 3: 1.0 + 0.02
Message 4: 1.0 + 0.03
Total: 4.06