felipernb/algorithms.js

prototype property issues.

Closed this issue · 1 comments

var graph = graphFromEdges(false, [
[1, 2],
[1, 5]
]);

graph.edge("1","2")
1

graph.edge("1","constructor")
function Object() { [native code] }

hasOwnProperty can help here.

Object.create(null) may be a better option.