Skip to content

Instantly share code, notes, and snippets.

@JWLangford
Created October 18, 2022 22:26
Show Gist options
  • Save JWLangford/276408e443ab111cfd4c135afe2ab419 to your computer and use it in GitHub Desktop.
Save JWLangford/276408e443ab111cfd4c135afe2ab419 to your computer and use it in GitHub Desktop.
const numInt = "10"
const convertedInt = parseFloat(numInt)
// 10
const numFloat = "10.51"
const convertedFloat = parseFloat(numFloat)
// 10.51
const notANumber = "chicken"
const convertedNaN = parseFloat(notANumber)
// NaN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment