Predict Increment
Predict Increment
Increment operators update a number by one. The prefix form updates before the value is read. The postfix form reads the old value first, then updates.
Read this code without running it:
let count = 4;
const first = count++;
const second = ++count;
const final = count;Your task: Set the answer variables to the values of first, second, and final.
Free with a JS Exercises account
Sign in to start coding, run your solution, and keep your progress saved for later. No payment needed.
By continuing, you agree to our Terms and Privacy Policy. We'll send occasional product updates and news. You can unsubscribe anytime.
Predict Increment
Increment operators update a number by one. The prefix form updates before the value is read. The postfix form reads the old value first, then updates.
Read this code without running it:
let count = 4;
const first = count++;
const second = ++count;
const final = count;Your task: Set the answer variables to the values of first, second, and final.