creating same set of tags for a set number of times javascript code example Example: javascript repeat element in array Array(5).fill(2) //=> [2, 2, 2, 2, 2]