/js_array_reverse

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

Write tests for a function arrayReverse that accepts an array of strings words consists of Latin letters, numbers and special symbols.

Function reverses the given strings in the array and their order so that the length of the strings from the original array does not change, e.g. if the length of the first string is 1, and the length of the last is 5, then when reversing, the first string in the array will contain only the last character from the last string.

Examples:

arrayReverse(['Hell0']) === ['0lleH']
arrayReverse(['Mate', 'Academy']) === ['ymed', 'acAetaM']
arrayReverse(['I', 'am', 'a', 'student!']) === ['!', 'tn', 'e', 'dutsamaI']

Guideline

Read more about Jest expectations