0
function removeItem(){
    for(i=0;i<rowData.length;i++){
        if(rowData[i].title = 'First Name'){
            rowData.splice(i,1);
            break;
        }
}

This does not delete the object whose has a title property 'First Name' instead deletes the last added object to the array.

John Cooper
  • 6,915
  • 27
  • 75
  • 99

2 Answers2

1

You have to use == operator instead of = in the if condition.= is for assignment and not for comparing.

Edit 1: For more info follow this thread.

Community
  • 1
  • 1
Mahesh
  • 33,625
  • 17
  • 84
  • 113
1

On line three you have a typo. Instead of =, it should say ==

Jani Hartikainen
  • 41,683
  • 10
  • 64
  • 84