This function takes a string as input and returns the same string in reverse order. It works by using the split() method to convert the string into an array of characters, then reverse() method to reverse the order of the array, and finally join() method to convert the array back into a string.
This function takes a string as input and returns true if it's a palindrome (i.e. the same forwards and backwards), and false otherwise. It works by using the same approach as the previous example to reverse the string and then compare it to the original string.
This function takes an array of numbers as input and returns the maximum value in the array. It works by using the Math.max() method, which can accept any number of arguments. The spread operator (...) is used to spread the array into individual arguments.
This function takes an array as input and shuffles its elements randomly. It works by using the sort() method, which sorts the array in place, and a comparison function that returns a random number between -0.5 and 0.5.
This function takes an array of numbers as input and returns the sum of all its elements. It works by using the reduce() method, which applies a function to each element of the array and accumulates the result. The acc parameter represents the accumulated value and curr represents the current element being processed. The initial value of the accumulator is set to 0.
This function takes an object as input and returns an array of its key-value pairs. It works by using the Object.entries() method, which returns an array of arrays, where each inner array contains a key-value pair.