Hi!, the task here is to figure out how many items in a list are repeated at least once.
There's a function below, countDupes
, that is currently unimplemented. Your task is to implement that function so the test below will pass.
You are free to ask me questions, use Google, or whatever else you need to do. Good luck!
const CITIES = [
'nashville',
'nashville',
'los angeles',
'nashville',
'memphis',
'barcelona',
'sevillia',
'isla canary',
'barcelona',
];
export const countDupes = (cities: string[]): number => {
// TODO: Fill in the code for this function to return
// the correct number of items that are repeated in the
// given list.
};