Description
JavaScript code “NaN” shows up instead of “0” when users select obsolete currencies.
Problems:
Unexpected Output: If a user expects to see a number and instead gets NaN
, it can be confusing. This might make them think there’s a bug, or worse, make them mistrust the functionality or reliability of the app.
Lack of Context: Most users won’t understand what NaN
means or why it’s being shown. It’s a technical detail that shouldn’t be exposed in a user-facing interface.
Perception of Quality: Exposing technical details like NaN
diminishes the professionalism of the app. It looks like an error or bug to end-users, making the application feel unreliable or unpolished.
Possible Solution:
Please consider using the double tilde ( ~~ ) operator in JavaScript to convert NaN to 0 . The double tilde is a bitwise operator that performs a bitwise NOT operation twice, effectively converting non-numeric values to 0.
Priority:
Low