xxxxxxxxxx
var stringNumber = '23';
var number = parseInt(stringNumber, 10); // The second argument specifies the base, which is 10 for decimal.
console.log(number); // This will output 23 as a number.
xxxxxxxxxx
var stringNumber = '23';
var number = +stringNumber;
console.log(number); // This will also output 23 as a number.