Problem Using _.compact lodash to eliminate null values on an array of objects

I’m manipulating an array of objects that i get from an http request containing coordinates to create markers in google-maps , but i need to eliminate all the null values in the array. I’m trying with compact but it gives back the same array unchanged.

//this is the resulting array structure

var array=

var comp =_.compact(array) 

i dont get any error in the cosole , but the variable comp return the same exact array without removing null values

Source: AngularJS