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?
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?
With Arrays, you’ll have to do it explicitly with instanceof
.
> obj.b instanceof Array
// true
> obj.c instanceof Array
// false