Answers for "remove 0 from 01"

0

remove 0 from 01

const numString = "065";

//parseInt with radix=10
let number = parseInt(numString, 10);
console.log(number);

// Number constructor
number = Number(numString);
console.log(number);

// unary plus operator
number = +numString;
console.log(number);

// conversion using mathematical function (subtraction)
number = numString - 0;
console.log(number);
Posted by: Guest on July-10-2021

Code answers related to "remove 0 from 01"

Code answers related to "Javascript"

Browse Popular Code Answers by Language