Write a program to find Reverse a String using node js

// Function to reverse a string
function reverseString(str) {
  return str.split('').reverse().join('');
}

// Example usage
const reversed = reverseString('Hello, World!');
console.log(reversed);

 

Post your Answer