I tried using instanceof but it can't differentiate between {}
, []
, and Date
.
For example, If I want to make an if tree that goes like this:
function foo(someVar){
if (/*someVar is an {}*/) {
} else if (/*someVar is an []*/) {
} else { //someVar could be a String or a Date or anything
}
}
How do I write that first if condition? Any help would be appreciated, thank you!