Is it possible to test a variable to see if it is a primitive?
I have seen lots of questions about testing an variable to see if it is an object, but not testing for a primitive.
This question is academic, I don't actually need to perform this test from my own code. I'm just trying to get a deeper understanding of JavaScript.
typeof myVar !== 'object' && typeof myVar !== 'string'...
? – Microwavetypeof
operator – Padang