Комментарии:
arr = [1, 2, 3, 4, 1, 2, 3, 3, 3];
const map = new Map();
arr.forEach((element) => {
if (map.has(element)) {
map.set(element, map.get(element) + 1);
} else {
map.set(element, 1);
}
});
const objFormat = Object.fromEntries(map);
console.log(objFormat);
// Try this
The last question, "occurrence of array elements," does not like a standard approach.
ОтветитьSince people request interviews for specific technologies may I ask for a vuejs interview? Thanks.
ОтветитьHow many year of exp is this interview for?
ОтветитьVery nice
Ответитьsir can you please provide 3 years experience react and javascript questions
Ответить