function removeFromArr (parray,ptag,pstring){
var b =[];
var count = 0;
for (var i =0;i<parray.length;i++){
if(pstring != parray[i][ptag]){
b[count] = parray[i];
count++;
}
}
return b;
}
var lobj = [ {
"SCHEME_CODE": "MIP65",
"YEARS": "1",
"CURRENCY": "GBP",
"MAX_AMT": 200000,
"MIN_AMT": 1000,
"AER_IR": "1.80",
"FREQUENCY": "Monthly",
"CUST_TYPE": "RETAIL",
"GROSS_IR": "1.79"
},
{
"SCHEME_CODE": "MIP65",
"YEARS": "2",
"CURRENCY": "GBP",
"MAX_AMT": 200000,
"MIN_AMT": 1000,
"AER_IR": "1.98",
"FREQUENCY": "Monthly",
"CUST_TYPE": "RETAIL",
"GROSS_IR": "1.96"
},
{
"SCHEME_CODE": "MIP65",
"YEARS": "3",
"CURRENCY": "GBP",
"MAX_AMT": 200000,
"MIN_AMT": 1000,
"AER_IR": "2.05",
"FREQUENCY": "Monthly",
"CUST_TYPE": "RETAIL",
"GROSS_IR": "2.03"
},
{
"SCHEME_CODE": "MIP65",
"YEARS": "5",
"CURRENCY": "GBP",
"MAX_AMT": 200000,
"MIN_AMT": 1000,
"AER_IR": "2.26",
"FREQUENCY": "Monthly",
"CUST_TYPE": "RETAIL",
"GROSS_IR": "2.24"
},
{
"SCHEME_CODE": "QIP65",
"YEARS": "1",
"CURRENCY": "GBP",
"MAX_AMT": 200000,
"MIN_AMT": 1000,
"AER_IR": "1.80",
"FREQUENCY": "Quarterly",
"CUST_TYPE": "RETAIL",
"GROSS_IR": "1.79"
},
{
"SCHEME_CODE": "QIP65",
"YEARS": "2",
"CURRENCY": "GBP",
"MAX_AMT": 200000,
"MIN_AMT": 1000,
"AER_IR": "1.98",
"FREQUENCY": "Quarterly",
"CUST_TYPE": "RETAIL",
"GROSS_IR": "1.97"
},
]
function myFunction(){
var final = removeFromArr(lobj,"SCHEME_CODE","MIP65");
console.log(final);
}
<html>
<button onclick="myFunction()">Click me</button>
</html>
var items = { id: "animal", type: "cat", cute: "yes" }
, arrayvar items = ["animal", "cat", "yes" ]
– Catercornered