You are viewing a single comment's thread. Return to all comments →
function getCount(objects) { let count = 0 for(let o of objects){ if(o.x == o.y){ count = count + 1; } } return count; }
OR
function getCount(objects) { return objects.reduce((count, o) => o.x == o.y ? count + 1 : count, 0); }
Seems like cookies are disabled on this browser, please enable them to open this website
Day 4: Count Objects
You are viewing a single comment's thread. Return to all comments →
OR