📜  从 01 中删除 0 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:16.582000             🧑  作者: Mango

代码示例1
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);