Hard
This question is a daily question and will count towards your daily streak.
You are tasked with finding the most common element in an array. Which of the following code snippets correctly accomplishes this?
1const items = ['apple', 'banana', 'apple', 'orange', 'banana', 'apple'];23// Your task: Write a function to determine the most frequent item in the array.