Tenary condition in map()


Please what is the best way to add the condition in map()

If you have three conditions, maybe try a switch.

Hey Esther!

In the future, please do not post screenshots of your code .

This lowers the chance that someone will help you, because they have to read and type a lot of code to test your stuff.

It would be awesome to see a (working) example of your project on codesandbox, so that we can fiddle around with it.


Currently, you take a list of numbers and convert each one into an object {backgrounColor...}. (you missed a d)

Then you create a div, don’t do anything with it and return the list of converted numbers to objects.

So that’s probably not what you want to do.

But because we do not know what you want to do, the first step would be to tell us something about your goal.