javascript – Why my app crashing after setting weights lower than previous? `const sum = weightGrades.reduce((acc, item) => acc + item.grade, 0);`

I have my app live on vercel. When I change weights to lower than previous (zmieƄ wagi button), it shows TypeError: Cannot read properties of undefined (reading ‘reduce’). How to fix it? I’v pasted here all code nesesary to fix it. Main problem shows at const sum = weightGrades.reduce((acc, item) => acc + item.grade, 0); … Read more

Sending Posix message via pipe

Sending Posix message via pipe I have the following file called helper.h, which I want to call in server and client files later. Code: #ifndef HELPER_H #include <iostream> … Read more