KB
Size: a a a
KB
IS
KB
IS
KB
KB
IS
KB
KB
KB
IS
ym
Ш
const store = []
const item = {
age: 35,
name: 'blabla',
count: 1,
};
function pushItems() {
const itemIndex = store.findIndex(el => el.name === 'blabla');
if (itemIndex >= 0) {
return (store[itemIndex].count += 1);
}
store.push(item)
}
pushItems();
IS
KB
IS
Ш
IS
Ш