Try
function makex(howMany)
{
console.log("The parameter was "+howMany);
string t;
for(var x = 0; x <= howMany; x++)
{
t = t + 'X';
}
console.log(x);
}
If you want to make the letter dynamic i.e. allow any letter instead of just X, try
function makex(howMany, text)
{
console.log("The parameter was "+howMany);
string t = t + 'X';
for(var x = 0; x <= howMany; x++)
{
t = t + text;
}
console.log(x);
}