This is my code. I have an array of object with 5 fields - name, achievements, points, age, city
var inputData = [{
name: 'Nick',
achievements: 158,
points: 14730,
age: 23,
city: 'London'
}, {
name: 'Jordan',
achievements: '175',
points: '16375',
age: 24,
city: 'Paris'
}, {
name: 'Ramon',
achievements: '55',
points: '2025',
age: 25,
city: 'NYC'
}];
var removeThisFields = ['name', 'age'];
I want to remove this two fields. I cannot use jQuery or lodash. I want to do this using Plain JS. How should I do this? Here I have 5 attributes and I want to remove 2 but in reality I will have more attributes. So I need to achieve this with the help of loops.
I want to remove removeThisFields
from inputData
.