Define additional parameters of objects (e.g. conditions)

Did you check out this post? It should give you enough context to solve your issue.

This is not a forum to get started learning JavaScript, unfortunately.