reverseString(str)/*
Takes a string as input and returns it with the characters reversed
*/reverseString('world');// "dlrow"reverseString('JavaScript');// "tpircSavaJ"
functionreverseString(str){// Splits the string into an array of characters
str = str.split("")// Reverses the order of the array
str = str.reverse()// Joins the array back into a string
str = str.join("")// Returns the stringreturn str
}