All Tracks/lab debug increment and decrement operator errors/
Đang tải...
Hướng dẫn thử thách
1 / 1

Debug Increment and Decrement Operator Errors in a Buggy App

Your friend has asked you to help them debug their code. They are practicing increment and decrement operators but are getting unexpected results in the console. Your task is to help them identify the mistakes and update the code so that the console outputs match the expected results. You can refer back to the prior lessons on increment and decrement operators as well as prefix and postfix notation. **User Stories:** 1. You should have a variable named `updatedCounter` that correctly produces the value `11` by using the increment operator. Update the expression to use the correct prefix or postfix notation instead of hardcoding the value. 2. You should have a variable named `finalScore` that correctly produces the value `8` by using the increment operator. Update the expression to use the correct prefix or postfix notation instead of hardcoding the value. 3. You should have a variable named `updatedCoins` that correctly produces the value `2` by using the decrement operator. Update the expression to use the correct prefix or postfix notation instead of hardcoding the value. 4. You should have a variable named `newHealth` that correctly produces the value `7` by using the decrement operator. Update the expression to use the correct prefix or postfix notation instead of hardcoding the value.
Vượt qua bài kiểm tra hiện tại để mở khóa bài tiếp theo.
main.js
UTF-8 • Tab Size: 2Kiểm tra bài:⌘↵
Test Output
Thử thách này không có bài test tự động. Hãy quan sát kết quả trực tiếp ở khung Preview.