写一个方法,让"1234"变成回文数字“1234321”,就是顺着读和倒着读都是一样的:注:不让用reverse()方法: function palindrome(str){ var arr = str.split(""); var arr1 = []; for (var i = arr.length - 1; i >= 0; i--) { arr1.push(arr[i]);}var arr2=arr.concat(arr1);var index=arr2…
if (!Array.prototype.forEach) { Array.prototype.forEach = function (callback, thisArg) { var T, k; if (this == null) { throw new TypeError(" this is null or not defined"); } var O = Object(this); var len = O.length >>> 0; // Hack to con…