Sort by

recency

|

386 Discussions

|

  • + 0 comments

    function getCount(objects) { var counter = 0; objects.forEach(function(object){ if (object.x==object.y){ counter++; } }); return counter; }

  • + 0 comments
    function getCount(objects) {
        let counter = 0;
        objects.forEach((obj) =>{ 
            if (obj.x === obj.y)
                counter++;
        });
        return counter;
    }
    
  • + 0 comments
    function getCount(objects) {
      let count=0,i;
      for(i=0; i<objects.length; i++){
        if(objects[i].x==objects[i].y){
            count++;
        }
      }
      return count;
    }
    
  • + 0 comments
    function getCount(objects) {
        return objects.filter((item)=> item.x === item.y).length;
    }
    
  • + 0 comments

    function getCount(objects) { return objects.filter(obj => obj.x === obj.y).length; }