var arr = "1111";
var count = 0;
var czarr = "";
for (var i = 0; i < arr.length; i++) {
for (var o = 0; o < arr.length; o++) {
console.log(parseInt(arr.charAt(i)) + ":" + parseInt(arr[o]))
if (parseInt(arr.charAt(i)) == parseInt(arr[o])) {
count++;
}
}
console.log(count)
if (count > 1) {
czarr += arr.charAt(i);
}
count = 0;
}
console.log("---------")
console.log(czarr)
var bool = true;
var text = "01 02 02";
var arr = text.split(" ");
var czarr = "";
for (var i = 0; i < arr.length; i++) {
var arri = parseInt(arr[i]);
if (arri >= limit_min && arri <= limit_max) {
for (var o = 0; o < arr.length; o++) {
if (i != o) {
var arro = parseInt(arr[o]);
if (arri == arro) {
count++;
czarr += arri + " ";
}
}
}
} else {
bool = false;
break;
}
}
if (bool) {
return count;
} else {
return 1;
}