We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Increment and Decrement

In Python we use the += operator to increment a number. That operator works in JavaScript as well, but JS also has a ++ operator for when you only want to increment by 1.

let bootdevCourseRating = 4;
bootdevCourseRating++;
console.log(bootdevCourseRating); // 5
bootdevCourseRating += 5;
console.log(bootdevCourseRating); // 10

And of course, there is a -- operator for decrementing by 1.

let bootdevCourseRating = 11;
bootdevCourseRating--;
console.log(bootdevCourseRating); // 10
bootdevCourseRating -= 5;
console.log(bootdevCourseRating); // 5

Assignment

Textio tracks how many messages have failed to send on a given day. Use the ++ operator in between the comments to increment the numFailedMessages.