I need to assign colour randomly to 80 words, so I use this Python code:
colorList = ['red', 'green', 'blue']*80 shuffle(colorList)
best_color = colorList.pop()
Using a JS version of this code does not create an error, however after 3 iterations, all words are displayed in black. I tried different versions of JS code, but none of them works. Do you have any idea how to fix this?
colorList = Array(80).fill(["red", "green", "blue"]).flat() shuffle(colorList);
colorlist = (['red', 'green', 'blue'] * 80); shuffle(colorList);
best_color = colorList.get(1);