This is a beginner LeetCode-style problem about strings.
Write a function that takes a string as input and returns the reversed string.
Example:
Input: "string" Output: "gnirts"
let str = "string";
let reversed = str.split("").reverse().join("");
document.getElementById("rev-output").innerHTML = reversed;