// Function to check if a string is a palindrome
function isPalindrome(str) {
const reversed = str.split('').reverse().join('');
return str === reversed;
}
// Example usage
const isPalindromeResult = isPalindrome('level');
console.log(isPalindromeResult);