Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Reverse words

Description

You will be given a string and your goal is to reverse every word in it.

Implementation

reverseWords(string) should return the origin string with every word reversed.

There are some conditions:

  • every word should be reversed but the string as a whole should not be reserved.
  • don't use Array.reverse() method.

Example:

reverseWords('This is a string of words') // 'sihT si a gnirts fo sdrow'