Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(arr, test) {
- const input = JSON.parse(arr);
- const [name, value] = test.split('-');
- const filterResult = [];
- for (let i = 0; i < input.length; i++) {
- if (input[i][name] === value) {
- filterResult.push(input[i]);
- }
- }
- filterResult.forEach((epml, index) => {
- console.log(`${index}. ${epml.first_name} ${epml.last_name} - ${epml.email}`);
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement