While using JavaScript statement for… in, we get functions of objects. If you need only properties without functions, use that:
for (key in object) {
if (object.hasOwnProperty(key)) {
...
}
}