if(all_lat_length > 1) {
var i = 0;
var i2 = 0;
if(m['mcount'] > 1) {
while(i < m['mcount']){
while(i2 < all_lat_length) {
if(m['lat'][i] == all_lat[i2] && m['lng'][i] == all_lng[i2]){m['lat'].splice(i,1);m['lng'].splice(i,1);m['mcount']--;}
i2++;
}
i++;
}
}
if(m['mcount'] == 1) {
var i2 = 0;
while(i2 < all_lat_length) {
if(m['lat'] == all_lat[i2] && m['lng'] == all_lng[i2]){m['mcount'] = 0;}
i2++;
}
}
}
if(m['mcount'] > 1) { var i = 0;while(i < m['mcount']){insert_marker(m['lat'][i],m['lng'][i]);i++;} }
if(m['mcount'] == 1) { insert_marker(m['lat'],m['lng']); }
console.log(mcnt);
console.log(mcnt); должно выводить три, а выводит 4.