As written in a string, I want to convert the "first" variable into a Number. In order to perform further calculations. Code is below:
let first = "34+4-5";
console.log(first);
console.log(typeof(first));
let second = Number(first)
console.log(second);
console.log(typeof(second))
let third = parseInt(first);
console.log(third);
console.log(typeof(third));
But I get Output
34+4-5
string
NaN
number
34
number
I want to calculate it further (34+4-5), so that answer will be 33