Comparing word length to each other
<script>
alert(findLongestWordLength("Go was designed with parallel and concurrent processing in mind.")); // 10
function findLongestWordLength(str) {
return str.split(" ")
.reduce((highest, next) => { // comparing word length to each other
return Math.max(highest, next.length);
}, 0);
}
</script>
Most Helpful This Week
jQuery check if an element is visible or hidden
jQuery show input text inside div after on click event
Write a function that splits an array into groups the length of size and returns them as a two-dimensional array
Highlight and get the details of table row on click using JavaScript
JavaScript example to change image on click
Image Rollover Using onMouseOver and onMouseOut