_hyperscript
_hyperscript copied to clipboard
feat(Syntax addition): to match language style, "for item in myList indexed by i"
for item in myList indexed by i
for item in myList by i
Support for both of the above index clauses because the normal one reads terribly in a language that otherwise reads amazingly.
The one way to do it before was obviously only
for item in myList index i
An example of the new syntax from a project
_="
on load put the children of the closest parent <div /> into myList
then for item in myList indexed by i
if the item's index does not exist
set the item's index to i
then set the item's id to item's id + '_' + i
"
As opposed to
_="
on load put the children of the closest parent <div /> into myList
then for item in myList index i
if the item's index does not exist
set the item's index to i
then set the item's id to item's id + '_' + i
"
I just realized, should I remove the built versions from this PR?
thank you sorry it took so long to merge!