Answers for "js how to see the type"

3

get type of var js

function doSomething(x) {
  if(typeof(x) === 'string') {
    alert('x is a string')
  } else if(typeof(x) === 'number') {
    alert('x is a number')
  }
}
Posted by: Guest on October-12-2020

Code answers related to "js how to see the type"

Code answers related to "Javascript"

Browse Popular Code Answers by Language