Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Reverse a string in JavaScript

function reverseString(str) {
	let reversed = [];
	for (i = str.length - 1; i >= 0; i--) {
		reversed.push(str[i]);
	}
	return reversed.join('');
}
Source by exploretech.dev #
 
PREVIOUS NEXT
Tagged: #Reverse #string #JavaScript
ADD COMMENT
Topic
Name
8+4 =