Raphael Paper when Empty
<p>Splice is not working for array with an object and i am getting the following error. I am just reordering stuff based on the condition.</p>

<pre><code>this.generatePartipant = function(userData,creatorID) {
    //arrange order based on order: owner, presenter and others
    var creatorObject;
    var ownerObject;
    for(var i=0;i &lt; userData.length; i++){
        if(userData[i].senderId = creatorID)
            {
            creatorObject = jQuery.extend({},userData[i],{creator:true});
            userData.splice(i,1);
            }
        if(userData[i].senderId = whiteboardDesigner.user){
            ownerObject = jQuery.extend({},userData[i],{owner:true});
            userData.splice(i,1);
        }
    }
    if(creatorObject != null){
        userData.push(creatorObject);
    }
    if (ownerObject != null){
        userData.push(ownerObject);
    }
}
</code></pre>

<p><strong>> error:</strong></p>

<pre><code>            userData.splice(i,1);
Uncaught TypeError: Object [{"senderId":"9e61ec7e-8d7c-469d-88e5-38213dcb34f4","userName":"lkwerj","thumbnailId":null,"active":true,"camStarted":false,"micStarted":false,"imageUrl":null}] has no method 'splice'
</code></pre>
