Created
July 17, 2020 15:50
-
-
Save alexgodin/a189f92b08fc0ab01d455d61ff1aab51 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const feedback_types = ["Postive", "Neutral", "Negative"] | |
const feedback_array = [{ | |
first_name:"Dayrell", | |
type:"Positive", | |
body:"Great", | |
date:"2020-07-16T16:56:36.847875" | |
}] | |
// THIS RETURNS NOTHING | |
feedback_types.map((ftype) => { | |
return feedback_array.filter((x) => x.type == ftype) | |
}) | |
// THIS RETURNS SOMETHING | |
feedback_types.map((ftype) => { | |
return feedback_array.filter((x) => x.type == "Positive") | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment