We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Day 4: Count Objects
Day 4: Count Objects
Sort by
recency
|
386 Discussions
|
Please Login in order to post a comment
function getCount(objects) { var counter = 0; objects.forEach(function(object){ if (object.x==object.y){ counter++; } }); return counter; }
function getCount(objects) { return objects.filter(obj => obj.x === obj.y).length; }