Answers for "covert number in string in js"

5

js get number from string

thenum = "foo3bar5".match(/\d+/)[0] // "3"
Posted by: Guest on January-08-2021
-1

javascript convert number to string

const num = 2
const a = num.toString() // This throws an Error if num is null or undifined
const b = String(num) // In a case above, puts "null" or "undifined"
Posted by: Guest on September-24-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language