arrCheck(arr) { var newArr = []; for (var i = 0; i < arr.length; i++) { var temp = arr[i]; var count = 0; for (var j = 0; j < arr.length; j++) { if (arr[j] == temp) { count++; arr[j] = -1; } } if (temp != -1) { newArr.push(temp + ":" + count) } } return newArr; }