Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

use + to parseint in js

const ratingValue = userInput.value;
if(+ratingValue > 1) {}   // + works exactly like a parseInt()

if(parseInt(ratingValue > 1)) {}
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #parseint #js
ADD COMMENT
Topic
Name
5+7 =