Using the JavaScript language, have the function LongestWord(sen) take the sen parameter being passed and return the largest word in the string. If there are two or more words that are the same length, return the first word from the string with that length. Ignore punctuation and assume sen will not be empty.

Use the Parameter Testing feature in the box below to test your code with different arguments.

Longest Word

Parameter Testing

sen =

Correct Sample Outputs

  • Input = "fun&!! time"Output = "time"
  • Input = "I love dogs"Output = "love"

  • Run your code

    Submit Code
    JavaScript Parameter Examples
  • Strings


  • Integers, Floats, etc.


  • Arrays, Lists, etc.