How to determine what type of property has object

How to determine what type of property has object
0

#1

Hello,

I would ask how to determine what kind of type has an object?
As example if I have object

let obj = {
   a: 1,
  b:  [1,2,3],
  c: "String" 
}

How I can to check that b property is array?


#2

think you are looking for this info or this one


#3

With Arrays, you’ll have to do it explicitly with instanceof.

> obj.b instanceof Array
// true

> obj.c instanceof Array
// false