Validating Values
Recap
Housekeeping
- Question: Why does
3 > 2 > 1
evaluate tofalse
? - This afternoon: Dark Mode in VueJS/Nuxt
1. Utility Functions
Materials
Demo: Ratio to Percentage Converter
- Bonus Activity from Wednesday
- Starter code
2. Value validation
Materials
- Slides: Value Validation
- Client-side form validation
- Logical AND (
&&
) - Logical OR (
||
) - Logical NOT (
!
)
Breakout Activity
In pairs, refactor the GST Calculator so that:
NaN
no longer appears in the responsetoPercentage()
will returnfalse
for negative numbers- The response for negative numbers is "Please use a positive rate."
- Any others?