how to create an array with a set number of identical values code example Example: javascript repeat element in array Array(5).fill(2) //=> [2, 2, 2, 2, 2]