Codington
0 of 8 problems solved • 0%
Use in a course

Exercise prompt

Recognize a Failed Conversion

Converting text that is not numeric produces the special number value NaN. Number.isNaN(value) checks for that failed result.

Example

const amount = Number("many"); console.log(Number.isNaN(amount));

The console displays true.

Your task

Convert quantityText, store the failure check in conversionFailed, and display Conversion failed: true.