I have an object in JavaScript:
var obj = { "a": "test1", "b": "test2" }
How do I check that te
The simple answer to this is given below.
This is working because every JavaScript type has a “constructor” property on it prototype”.
let array = [] array.constructor === Array // => true let data = {} data.constructor === Object // => true