I created a function that removes an object property + value if its value is an array. Here's how it looks like:

```
function removeArrayValues(obj) {
  for(var key in obj){
    if( Object.prototype.toString.call(obj[key]) === '[object Array]' ) {
     delete obj[key];
     }
  }
}

```

Notice this part:

```
Object.prototype.toString.call(obj[key])

```

I got this from a friend's solution however it's not clear to me what is it really doing. Also instead of just `'Array'` why do we need to put it within `[]` and call it `[object Array]`.

ALSO is there a better way to do this other than this solution???

I am an absolute beginner to JavaScript.

Can anyone teach me or discuss to me in layman's term what this code does? 

Anyone?