Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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)
 
PREVIOUS NEXT
Tagged: #How #length #string #javascript #native #length #method
ADD COMMENT
Topic
Name
4+2 =