Write a function to remove array element based on object property?