Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

find biggest word in the string

function findLongestWordLength(str) {
  let words = str.split(' ');
  let maxLength = 0;

  for (let i = 0; i < words.length; i++) {
    if (words[i].length > maxLength) {
      maxLength = words[i].length;
    }
  }

  return maxLength;
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: react deep copy 
Javascript :: js dynamicly add script 
Javascript :: in select option how to make one default in angular 
Javascript :: splidejs pauseOnHover 
Javascript :: types of node in blockchain 
Javascript :: remove all white space from text javascript 
Javascript :: find element with data attribute jquery 
Javascript :: how to reverse loop in javascript 
Javascript :: sum of numbers array using for loop in javascript 
Javascript :: date.tolocaledatestring is not a function 
Javascript :: javascript ascending and descending 
Javascript :: node eventemitter emit error 
Javascript :: compare and filter two array of object 
Javascript :: get the integer after decimal in javascript 
Javascript :: encrypt data using SHA256 algorithm in JavaScript 
Javascript :: code Execution time in nodejs 
Javascript :: js poll dom 
Javascript :: sum numbers recursively js 
Javascript :: javascript transitionduration 
Javascript :: express get raw path 
Javascript :: js focus textarea 
Javascript :: how to fetch api in reactjs using axios 
Javascript :: javascript querySelectorAll id ends with 
Javascript :: rounding off numbers javascript 
Javascript :: cache remove using ajax 
Javascript :: fibonacci javascript 
Javascript :: javascript classlist 
Javascript :: javascript Multiline Arrow Functions 
Javascript :: json.stringify parameters 
Javascript :: putting a loop into an array javascript 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =