I am trying to populate items of an array with same items and order.
As an example, I have an array like this, with two string elements.
const myArr = ['A','B'];
What I'm trying to do is something like that. I need to populate items 10 times or more. I'm thinking of a for loop but maybe there are more efficient alternatives.
const myArr2 = ['A','B','A','B','A','B','A','B','A','B'];
How can I achieve this with Vanilla JS ?