I am trying to analyze multiple arrays in order to determine how frequently a specific value appears.
Although I can consolidate the values into a new array, I'm encountering issues when attempting to iterate through it.
Since this task is for an assignment, jQuery is off-limits - only pure logic allowed!
var mon = ["Ez, Caro"];
var tue = ["Ez, Matt, Pablo"];
var wed = ["Marta"];
var thur = ["Ez, Matt"];
var freq = 0;
var arr = [];
var input = prompt ("Enter a name");
arr.push(mon, tue, wed, thur);
for (var i = 0; i<arr.length; i++){
if (arr[i] == input){
freq = freq + 1;
}
}
document.write("The name appeared " + freq + " time(s)")