Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Reverse a string

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

reverseString('string');    // "gnirts"
Source by essential-javascript.programming-books.io #
 
PREVIOUS NEXT
Tagged: #Reverse #string
ADD COMMENT
Topic
Name
7+6 =