code: function indegree(node){
      var degree = 0;
      function check(v){
        if(v === node){
          degree++;
        }
      }
      Object.keys(edges).forEach(function (u){
        edges[u].forEach(check);
      });
      return degree;
    }
docs: Computes the indegree for the given node. Not very efficient, costs O(E) where E = number of edges.