课程: JavaScript: Best Practices for Data

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Challenge: Compare values

Challenge: Compare values

(upbeat bouncy music) - [Narrator] Ready to try your hand at writing better comparisons? It's time for a challenge. I've written some code that simulates a shopping cart and performs a few actions based on values in the cart object. Your task is to update the code to make it easier to read and to follow best practices for comparisons. Add rules as appropriate to .ESLint RC, to check for issues, as well as fixing those issues in the app.js file. Note that the code I've written is intentionally convoluted here and there. So if you're not sure what a statement is doing, take a moment, step back, and break it down. This exercise should take you about 15 minutes. When you're done, join me in the next video, and I'll walk you through how I approached it.

内容