This is a simple npm library where you can pass a value and flag and it will reverse it.
npm install reverse-everything
const { reverseEverything } = require('reverse-everything');
// Example 1: Reverse a number
console.log(reverseEverything(1234567, 'number')); // Output: 7654321
// Example 2: Reverse a string
console.log(reverseEverything('test', 'string')); // Output: tset
// Example 3: Reverse a sentence
console.log(reverseEverything('This will reverse every string and letter in it', 'sentence'));
// Output: sihT lliw esrever yreve gnirts dna rettel ni ti
// Example 4: Reverse words in a sentence
console.log(reverseEverything('This will only reverse word', 'reverse_word'));
// Output: word reverse only will this