Introduction

Hello, and welcome! Are you ready to elevate your string manipulation skills in JavaScript? Today, we'll delve into a task that bolsters your comprehension of strings and enhances your creativity. The task involves splitting a string into words and then reversing each word as if reflected in a mirror. Does that sound interesting? Let's get started!

Task Statement and Description

You're tasked with considering a string filled with words and writing a JavaScript function that accepts this string. The function should reverse the character order of each word and form a new string consisting of these reversed words.

Here's what you need to keep in mind:

  • The input string will contain between 1 and 100 words.
  • Each word in the string is a sequence of characters separated by whitespace.
  • The characters can range from a to z, A to Z, 0 to 9, or even an underscore _.
  • The provided string will neither start nor end with a space, and double spaces won't be present either.
  • After reversing the words, your program should output a single string with the reversed words preserving their original order.

Example

Consider the input string "Hello neat javascript_lovers_123".

Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal