Jak przekonwertować ciąg na int JS
let string = "1";
let num = parseInt(string);
//num will equal 1 as a int
Unusual Unicorn
let string = "1";
let num = parseInt(string);
//num will equal 1 as a int
var myString = "869.99"
var myFloat = parseFloat(myString)
var myInt = parseInt(myString)
// try using parsInt(x)
// you can then use typeof(x) to confirm
var myString = "555";
var myInt = parseInt(string);
console.log(typeof myInt); // number
const three = "3";
typeof(three);
// 'string'
const threeInt = parseInt(three, 10);
typeof(threeInt);
// 'number'