I have found many solutions about all posible combinations between array values but I need something different, I hope you could support me. Basically is to create all posible objects that combine array keys with true|false values, something like this:
Input: (Should return an array of 32 objects, 2exp5, two posible values in 5 keys)
let properties = ['arm','lens','season','food','size'];
Output:
let combinations = [
{"arm": "false","lens": "false","season": "false","food": "false","size": "false"}
{"arm": "false","lens": "false","season": "false","food": "false","size": "true"}
{"arm": "false","lens": "false","season": "false","food": "true","size": "true"}
{"arm": "false","lens": "false","season": "true","food": "true","size": "true"}
{"arm": "false","lens": "true","season": "true","food": "true","size": "true"}
{"arm": "true","lens": "true","season": "true","food": "true","size": "true"}
{"arm": "true","lens": "true","season": "true","food": "false","size": "true"}
{"arm": "true","lens": "true","season": "false","food": "false","size": "true"}
and so on...
]
Thank you so much!