I am practicing js and i encounter this line of code in a for each loop
function test(arr1){
let fq1 = {}
for(val of arr1){
fq1[val] = (fq1[val] || 0) + 1
}
}
test([1,2,3,3]);
i have provided the code what i encounter can anyone please exaplian what is happening in
fq1[val] = (fq1[val] || 0) + 1
i tried and i have seen the object key is storing the number of value are provided in array. But i am not clear about the line of code i have mentioned above.