Timeline for answer to javascript : filter array of objects using another array as filter by Mohit Bhardwaj
Current License: CC BY-SA 3.0
Post Revisions
11 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 22, 2017 at 15:56 | comment | added | NeverGiveUp161 | chat is blocked on our network.Already tried continuing.Thanks anyways for the help. | |
| May 22, 2017 at 15:50 | comment | added | Mohit Bhardwaj | Let us continue this discussion in chat. | |
| May 22, 2017 at 15:49 | comment | added | NeverGiveUp161 | ok,let me try again.Tried it but did not work,might be i missed something | |
| May 22, 2017 at 15:23 | comment | added | Mohit Bhardwaj |
okay :). You just need to change the equality operator to not equal operator i.e. use return removeNames.indexOf(emp.name.toLowerCase()) !== -1; instead.
|
|
| May 22, 2017 at 15:13 | comment | added | Mohit Bhardwaj | Sorry I still did not get the exact requirement. You mean you want the logic reversed? That is, now only those elements should be kept which ARE IN removeNames array and others should be filtered out? | |
| May 22, 2017 at 15:09 | comment | added | NeverGiveUp161 | its just a minor change,that is the reason.So filteredEmployees now have everything except removeNames content.But i want filteredEmployees should have only matching element in removeNames array.I think tweaking return removeNames.indexOf(emp.name.toLowerCase()) === -1; would help? | |
| May 22, 2017 at 14:27 | comment | added | Mohit Bhardwaj | @NeverGiveUp161 sorry I did not get that. Do you mean that you want to store the removed employees in a separate array? Also, I think you should create a separate question for a separate problem as it may help other people also. | |
| May 22, 2017 at 12:18 | comment | added | NeverGiveUp161 | inside the filter if i want to store the matching name in filtered employees | |
| May 19, 2017 at 16:22 | vote | accept | NeverGiveUp161 | ||
| May 19, 2017 at 15:18 | history | edited | Mohit Bhardwaj | CC BY-SA 3.0 |
added 108 characters in body
|
| May 19, 2017 at 15:12 | history | answered | Mohit Bhardwaj | CC BY-SA 3.0 |