how to find length of string in javascript without using length method

Solutions on MaxInterview for how to find length of string in javascript without using length method by the best coders in the world

showing results for - "how to find length of string in javascript without using length method"
Gianluca
21 Feb 2016
1function strLength(s) {
2  var length = 0;
3  while (s[length] !== undefined){
4    length++;
5  } 
6  return length;
7}
8
9console.log(strLength("Hello")); // 5
10console.log(strLength("")); // 0
Ashton
25 Feb 2020
1var str = new Array(len + 1).join( character );
queries leading to this page
javascript count string lengthhopw to find out length of a string in jsjs create string of lengthjavascript create string of certain lengthfind the length of string javascript without length 28 29 methodhow to create strings of same characters javascriptjavascript string lengthmake a string of a character a certain length jacascriptconcatenate space to string of particular size node jscount length of string in javascriptwritw a function length of string in javascriptjavascript fill string with charactersfill a string with a certain number of same charhow long would it take for a string with x length to fill up datastorecheck length of string without using inbuilt methods in javascriptset length of word from set number jsjs generate string with lengthjavascript make string a lengthhow create an empty string of certain length java scriptdo strings hold a length value jsjs how to make a string with 10 constant charscreate string of length jscalculate length of string in jscreate string of length n javascripthow to create a string of specified length in javascriptjs string of lengthmake string certain length in nodejshow to make a string a letters x letters long jsgenerate n length string jshow does javascript count string lengthhow to add something at string by lentgh javascriptfind string length without using length function javascriptcount the length of string in javascriptfunction to find length of string in javascriptjavascript create string of lengjavascript generate string with lengthjavascript create string of given lengthjavascript create astring with fixed lineght and intialize ith same valuejavascript string repeathow i can konw string length javascripthow to increase string length in jsjavascript create string with specific lengthcreate string of repeated charater certain lengthjs create string of repeating char of variable lengthtypescript add characters to string until some lengthjs generate string based on lengthhow to make a string of a specific length javascriptjavascript create string of lengthgenerate dynamic words between 2 letter javascriptjs create fixed size stringarray n length specific charactersjavascript creating a string that always has a fixed length add symbol string by size jsstring length without length jsjs create string 7 chars the samejs generate string of lengthjs create string with lengthhow to calculate length of string in javascriptgenerate string with length javascriptgenerate string with length jshow to fill string with particular character in javascripthow to count string length in javascriptfill out empty space untill its at a specific length string jsjavascript to calculate length of stringjavascript stirng with ceratin elngthjavascript define string with lengthhow to decipher the length of string in javascriptgenerate large sring nodejsjavascript make string certain lengthhow to calculate length of string i javascripthow to create a string based on length in javascripthow to check length of string without using length in javascriptjava script add scharacters to the left of the string until lengthcreate string length javascripthow to create string that is lengthfinding length of a string in javascriptcreate a string of chars for a lennth javascripthow to write a custom string length in jshow to find length of string in javascript without using length methodjavascript generate string of lengthcount length string jshow to find length of string in javascript without using length method