Question: I It has to be in javascript //reversestring: you should be able to reverse a string // Example: abc => cba function reversestring(str) { /**
I
It has to be in javascript
//reversestring: you should be able to reverse a string // Example: "abc" => "cba" function reversestring(str) { /** can be achieved by combining: 1. string.prototype.split 2. array.prototype.reverse 3. array.prototype.join * * * * * * Can even be done on one line return (String.prototype.split) (array.prototype.reverse) (array.prototype.join); }
Step by Step Solution
There are 3 Steps involved in it
To reverse a string in JavaScript you can use split reverse and join metho... View full answer
Get step-by-step solutions from verified subject matter experts
