<script language="javascript">
function space(n)
{
var arr = new Array(n+1);
return arr.join(" ");
}
function string(char, n)
{
var arr = new Array(n+1);
return arr.join(char);
}
alert("a" + space(5) + "a")
alert("a" + string("+", 7) + "a")
</script>