make a string of length js code example
Example 1: js fill string with n characters
var str = new Array(len + 1).join( character );
Example 2: How to get length of string in javascript without using native length method
var str = userInput[0];
var count = 0;
while(str[count] !== undefined)
{
count += 1;
}
console.log(count)