Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let a = ['a', 'a', 'b', 'a']
- let count = 0
- for(var i = 0; i <= a.length; i++){
- console.log(`i> ${a[i]}`)
- for(var j = 0; j <= a.length; j++) {
- console.log(`J> ${a[j]}`)
- // from array a if char is >= 3 remove from array a
- if(a[i] == a[j]){
- count = count + 1
- }
- }
- }
- console.log(count)
Add Comment
Please, Sign In to add comment