Javascript Reverse String Method 1

Опубликовано: 12 Июль 2026
на канале: Web Development
7
0

Javascript Reverse String Method 1

Reverse String Method 1
DIRECTIONS
Given a string,
return a new string with the reversed order of characters
Examples
reverse of apple is elppa

Logic:
Turn string into an array
Call 'reverse' method on the array
Join the array back into a string
Return the result

Coding
function reverse(str) {
return str.split('').reverse().join('');
}