Answers for "reverse string in typescript"

0

reverse string in typescript

let toBeReversed: string = `.eslaf eb t'ndluow ecnetnes siht ,dehctiws erew eslaf dna eurt fo sgninaem eht fI`;

let charArray: string[] = toBeReversed.split('');
console.log(charArray);

let reverseArray: string[] = charArray.reverse();
console.log(reverseArray);

let reversedArray: string = reverseArray.join('');
console.log(reversedArray);

output:

If the meanings of true and false were switched, this sentence wouldn't be false.
Posted by: Guest on November-24-2020

Code answers related to "TypeScript"

Browse Popular Code Answers by Language