I have a simple program like:
var a = {\'a\': 1, \'b\': 2} console.log(a) console.log(a instanceof Array) console.log(a.constructor instanceof Array)
Would that work ?
function isDictObj(obj: any) { try { const test = {...obj} } catch(err) { return false } return true }
My logic is that if it is a dictionnary object (key:values), then using spread operator with {} should work, otherwise throw an exception