Skip to content

Instantly share code, notes, and snippets.

@jimmiehansson
Created February 5, 2017 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimmiehansson/1dc7ed58e800a37d9d03e167853139c6 to your computer and use it in GitHub Desktop.
Save jimmiehansson/1dc7ed58e800a37d9d03e167853139c6 to your computer and use it in GitHub Desktop.
let x;
if(typeof x === "string"){
console.log("This is a string");
}
else if(typeof x === "number"){
console.log("This is a number");
}
else if(typeof x === "object"){
console.log("This is a object");
}
else if(typeof x === "undefined"){
console.log("This is a object");
}
else {
console.log("I cannot see what this is");
}
// This is a object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment