Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

JavaScript Number() Function

const a = '23'; // string
const b = true; // boolean

//converting to number
const result1 = Number(a);
const result2 = Number(b);

console.log(result1); // 23
console.log(result2); // 1
 
PREVIOUS NEXT
Tagged: #JavaScript #Function
ADD COMMENT
Topic
Name
2+1 =