Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let people = [{
- "id": 1,
- "firstName": "Frank",
- "lastName": "Herbert",
- "job": "Lead Software Engineer",
- "Skills": ["JavaScript", "C#", "SQL", "HTML", "CSS", "SCRUM
- Master"],
- "Salary": 120196
- },
- {
- "id": 2,
- "firstName": "Joan",
- "lastName": "Armorett",
- "job": "Jr Software Developer",
- "Skills": ["JavaScript", "HTML", "CSS"],
- "Salary": 70000
- }
- // This is the .map function, which will show me all of the names,
- regardless of their salary.
- let answer = people.map((person) => {return person.firstName});
- // This is the .filter function, which will show me all data, not
- just names on everyone with a salary of 100000 or higher.
- let answer = people.filter((person) => {
- return person.Salary > 100000;
- });
Add Comment
Please, Sign In to add comment