0👍
✅
You can use Array.prototype.reduce, here is the complete code
if (data.reduce((a, v) => a + v.y, 0) === 0) {
alert('The sum of data.y is zero!');
}
Source:stackexchange.com