var arr = [11,-2,3,-4,5], allInt = arr.every(function (elem) { return elem % 1 == 0; }); if (allInt) { arr = arr.map(function (elem) { return elem * 2; }); } alert(arr);