Write a function printWords(sentence) that prints every word of a string on its own line with console.log.
sentence can also start and end with spaces.'Hi, Ann!' has the words Hi, and Ann!.printWords('My Name is Nikhil')Prints My | Name | is | Nikhil
printWords(' Hi, Ann! ')Prints Hi, | Ann!
Asked at Ness Digital · Source
printWords('My Name is Nikhil')My
Name
is
NikhilprintWords('Hello')HelloprintWords('I love JavaScript')I
love
JavaScriptHidden tests run on Submit.