Q:

Replacing a word with numbers

I'm trying to take a word(ex. example) and replace its letters with numbers from an array using Javascript. 
ex: 

The word would be "example"(7 letters) and the numbers would be [ 19, 14, 1, 11, 5 ]
So, "example" would become [ 19, 14 , 1, 11, 5, 19, 14].
I can't figure out how to do this with words longer than the array of numbers. 
Thanks. 

A:

Here you go : 

var word = "example";
var numbers = [19, 14, 1, 11, 5];
var newNumbers = [];
var t = 0;

for (var i = 0; i <= word.length - 1; i++) {
  if (t == numbers.length) {
    t = 0;
  }
  newNumbers.push(numbers[t]);
  t += 1;
}


console.log(newNumbers);

https://jsfiddle.net/emilvr/he8pchem/1/

