Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function pilindromeIntegers(array) {
- let isPilindrome = true;
- for (let i = 0; i < array.length; i++) {
- let num = array[i].toString();
- let currentEl = num.split("");
- let firstEl = currentEl[0];
- let lastEl = currentEl.pop();
- console.log(firstEl == lastEl ? isPilindrome : !isPilindrome);
- }
- }
- //pilindromeIntegers([123, 323, 421, 121]);
- pilindromeIntegers([32, 2, 232, 1010]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement