Skip to content

Deprecation: legacy for

Taylor Hunt edited this page Aug 2, 2019 · 2 revisions

The <for> tag has been updated to take advantage of tag parameters.

Previously, <for> lived in an uncanny valley of being almost JavaScript, but with a bunch of extras. The new version uses tag parameters to support its three common variants without custom syntax. (See the changing pull request for more examples of the old <for> syntax.)

Lists

<for(item in array)>

…becomes:

<for|item| of=array>

Properties

<for(key, val in object)>

…becomes:

<for|key, value| in=object>

Ranges

<for(i from 0 to 10 step 2)>

…becomes:

<for|i| from=0 to=10 step=2>