Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function cutAndReverse(input) {
- let firstHalf = input.substr(0, input.length / 2);
- let secondHalf = input.substr(input.length / 2, input.length / 2);
- splitReverseJoin([firstHalf, secondHalf]);
- function splitReverseJoin(argument) {
- argument.forEach(element => {
- let result = element.split('').reverse().join('');
- console.log(result);
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement