I will be glad if I can get help with this issue.

I created a set of questions with options for users and the computer to select from using jquery. The selections of the user and that of the computer are stored in 2 different arrays like the one shown below:
userSelection = ["a","b","c","a","d"];
computerSelection = ["e","b","a","d","d"];

Now I want to count the items that matched in both selections e.g. items 2 & 5 ("b" and "d") in the example shown above, how can I go about it? I have tried using the "==" and "===" signs to compare but I couldn't solve this. I really will appreciate if I can be pointed in the right direction. I don't mind if the answer is in jquery or javascript. Thanks