This forum is now read-only. Please use our new forums at discuss.codecademy.com.

## Big O Forum

# How do I turn my numbers into letters?

I can make it so that the output will give me one random position in the array via a pre-determined number, but I don't know how to output a letter from the array instead. Pretty much, I have the random positioning right, but I need that letter from the position and not the number.

*var array = ["P", "e", "a", "n", "u", "t", "s", "R", "o", "c", "k"];
var out =*

*Math.floor(Math.random()*11)*

*;*

console.log(out);

console.log(out);

The bolded part is the part I have been changing and so far have gotten to.

The Math.floor() function outputs a number, and in this case you have it so it outputs a random number representing the location of a number in the array.

The easiest way to fix this would be to simply make the third like:

console.log(array[out]); — this outputs the letter in the position your random function found.

Hope that makes sense.

In addition to what Lukas stated:

`Math.random()`

should be multiplied by the length of the array to generate numbers from `0`

to `array.length-1`

, inclusive.