microsoft / devicescript

TypeScript for Tiny IoT Devices (ESP32, RP2040, ...)
https://microsoft.github.io/devicescript/
MIT License
3.24k stars 112 forks source link

object returned by JSON.parse is not object #578

Closed pelikhan closed 10 months ago

pelikhan commented 11 months ago

I would expect raw to be of type object. typeof object looks correct but the InstanceOf fails.

const raw = JSON.parse(`{
  }`)
console.log({
    type: typeof raw,
    instance_of_object: raw instanceof Object,
})

output:

VM> {type:"object",instance_of_object:false,}