Sobes.tech
Junior — Senior

Function for sorting words in a sentence by numbers

livecode

Task condition

Implement a function that takes a sentence string where each word contains a single digit, and returns a new string with the words arranged in ascending order of the found digits.

 reorderWords('T4est 3a Thi1s is2') === 'Thi1s is2 3a T4est';