А
const postIsAlreadyIncluded = posts.some(({ id }) => id === newPost.id);
if (!postIsAlreadyIncluded) {
posts.push(newPost);
}
я б так сделалSize: a a a
IS
const postIsAlreadyIncluded = posts.some(({ id }) => id === newPost.id);
if (!postIsAlreadyIncluded) {
posts.push(newPost);
}
я б так сделалА
const isNotExist =
posts.every(({ id }) => id !== newPost.id);
if (isNotExist) {
posts.push(newPost);
}
MU
AP
AP
IS
А
ГЧ
IS
AP
IS
А
IS
IS
MU
А
БО