I have two Arrays in a VueJS instance. The arrays display courses a student can attend at school. First are the courses the user attend, and second are all the courses with students in them.
The arrays looks like this:
let mainVue = new Vue({
el: '#mainContent',
data: {
myCourses: [{Course: "A"}, {Course: "B"}],
allCourses: [{Course: "A"}, {Course: "B"}, {Course: "C"}, {Course: "A"}]
}
Both arrays consist of data populated from user inputs, so they changes over time. The first array are user specific content (Courses the user attends) and the second array are an array of all courses which have someone attend to.
I want to check the amount of people who attend the same course as the user. So in this case I want to check how many from array myCourses (Course a and b) are in array allCourses.
In other words, I want to check how many occurrences from array "myCourse" are in the array "allCourses".