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
  • 7,343
  • 31
  • 80
  • 100

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
  • 34,573
  • 20
  • 89
  • 115
1

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

Jani Hartikainen
  • 42,745
  • 10
  • 68
  • 86