Basic JavaScript - Finding Frequency

Tell us what’s happening:

Describe your issue in detail here.

Your code so far

function findFrequency(a,size) {
   
    let ans = "";
    for (let i = 0; i < size; i++) {
        for(j=0;j<size.lenth;j++){
            if(a[i]===a[j]){
                ans +=a[i];
            }
        }

        
    // Only change the code above this line
    }
    return ans;
}

findFrequency([2,4,2,6,3,6],6)


     

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36

Challenge Information:

Basic JavaScript - Finding Frequency

You appear to have created this post without editing the template. Please edit your post to Tell us what’s happening in your own words.

Please Tell us what’s happening in your own words.

Learning to describe problems is hard, but it is an important part of learning how to code.

Also, the more you say, the more we can help!