I would like to loop through a simple array to count the number of double elements. I've started (below) but only run through the first set. I need a little guidance in how I could have it increment further.
var chars = new Array("a", "a", "b", "b", "c", "d", "c","a"
;
var doubles= 0;
for (x= 0; x<charsLen; x++){
for (i = 1; i< charsLen; i++){
if (characters[x] == characters){
doubles ++;
}
}
}
...
var chars = new Array("a", "a", "b", "b", "c", "d", "c","a"
var doubles= 0;
for (x= 0; x<charsLen; x++){
for (i = 1; i< charsLen; i++){
if (characters[x] == characters){
doubles ++;
}
}
}
...