In Parse.com JS SDK, how to delete an element from inside an array of pointers?
<p>Not the best moment to ask for a Parse.com question, but I have to keep working with parse for some months. Here is my question:</p>

<p>In Parse.com I'm using the Javascript SDK. 
I have an <strong>array</strong> of pointers to class User:</p>

<p><code>[{userObject1.id}, {userObject2.id}, {userObject3.id}]</code> </p>

<p>how can I delete for example object {userObject2} from <strong>inside of the array</strong> when I just have the id of the object I want to remove?</p>

<p>Currently I'm removing the inside object by doing a <strong>forEach</strong> loop using array.splice(indexDelete, 1);. I'm looking for better solution.</p>

<pre><code>var wasSomethingDeleted = 0;
var MyParseFollow = Parse.Object.extend('Follow');
var query = new Parse.Query(MyParseFollow);
query.equalTo("user", channelUser); // fetch all followers
query.first().then(
    function (Follow) {
        if (Follow){
            if (Follow.get("followedBy").length &gt; 0){ // check if there is any follower
                var listOfFollowers = Follow.get("followedBy"); // get the array of userObjects of followers
                var indexDelete = 0;
                listOfFollowers.forEach(function(user){
                    if( user.id == Parse.User.current().id ){ // I want to remove the current authenticated user
                        wasSomethingDeleted++;
                        listOfFollowers.splice(indexDelete, 1); // remove the element
                    }else{
                        indexDelete++;
                    }
                });
                if( wasSomethingDeleted &gt; 0 ){
                    Follow.set('followedBy', listOfFollowers); // save new updated array list of followers
                    Follow.save();
                }
            }
        }
    }
);
</code></pre>