How can I check if a var is a string in JavaScript?
I’ve tried this and it doesn’t work…
var a_string = "Hello, I'm a string.";
if (a_string typeof 'string') {
// this is a string
}
How can I check if a var is a string in JavaScript?
I’ve tried this and it doesn’t work…
var a_string = "Hello, I'm a string.";
if (a_string typeof 'string') {
// this is a string
}