-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
forEachChild improvements #3
Comments
Same can be applied for forEachLeafNode |
I don't think there's a real use case for either suggestion. forEachChild is iterating through the subscript values at a particular level of subscripting within a Global - the only 2 relevant values you need are the next subscript value and its corresponding DocumentNode, from which you can derive any other information. |
The simple use case for before: var index = 0;
myDoc.forEachChild(function (nodeName, node) {
console.log(`{index}: {nodeName}`)
index++;
}) after myDoc.forEachChild(function (nodeName, node, index) {
console.log(`{index}: {nodeName}`)
})
|
ewd-document-store/lib/proto/forEach.js
Line 123 in 55179cb
index
aftergnode
thisArg
toforEachChild
method likeArray.forEach
doesThe text was updated successfully, but these errors were encountered: