Skip to content

Instantly share code, notes, and snippets.

@ceaksan
Created September 18, 2015 14:20
Show Gist options
  • Select an option

  • Save ceaksan/9c76d21e8eab4febc46c to your computer and use it in GitHub Desktop.

Select an option

Save ceaksan/9c76d21e8eab4febc46c to your computer and use it in GitHub Desktop.
function findLongestWord(str) {
var cumle = str.split(' ');
var kacKelime = cumle.length;
var final = 0;
for(var i = 0; kacKelime > i; i++) if(final < cumle[i].length) final = cumle[i].length;
return final;
}
findLongestWord('The quick brown fox jumped over the lazy dog');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment