# How can I get different numbers?

Tell us what’s happening:

I can understand how to get a number but how can I get a different number for different strings?

``````
function findLongestWordLength(str) {
var words = str.split("");
var maxLength = 0;

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

findLongestWordLength("The quick brown fox jumped over the lazy dog");

``````

User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36`.

Challenge: Find the Longest Word in a String

Hello @maeforest ,

I don’t really get what your question is asking, but assuming that you mean every string gives out different numbers meaning the string length. If you do `"The quick brown fox jumped over the lazy dog".length;` it will return 44, because there is 44 characters inside the string. In your function, you are splitting the sentence into an array and looping through it. So there will be different numbers because each word have different lengths.

``````var words = str.split("");