You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a function that recurses up a tree from a source array of leaf nodes, collecting parents along the way via nodes.mapBy('parent'). Normally, node.get('parent') yields undefined, but suppose it ever yields null. On the next pass over the array, to get the parents of the parents, my function fell into an infinite loop which led me to discover that mapBy yields the Window object for nulls, and window.parent refers back to window. Nice!
I have a function that recurses up a tree from a source array of leaf nodes, collecting parents along the way via
nodes.mapBy('parent')
. Normally,node.get('parent')
yields undefined, but suppose it ever yields null. On the next pass over the array, to get the parents of the parents, my function fell into an infinite loop which led me to discover thatmapBy
yields the Window object for nulls, andwindow.parent
refers back to window. Nice!http://jsbin.com/fehayaza/43/
The text was updated successfully, but these errors were encountered: