Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

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

Instructions

How to remove array element based on object property?

Challenges (0/3 done)

  • removeArrayElement("money") returns the array without the money object.
  • removeArrayElement("id") returns the array without the id object.
  • removeArrayElement("cStatus") returns the array without the cStatus object.
const array = [
    { field: "id", operator: "eq" },
    { field: "cStatus", operator: "eq" },
    { field: "money", operator: "eq" },
];

const filterField = "money"

function removeArrayElement(filterField) {
    // write your solution here

    return
}

console.log(`filtered array: ${removeArrayElement(filterField)}`)