Skip to content

Is it better to use the map directive or a normal js array map? #4186

Discussion options

You must be logged in to vote

The primary difference is that the map directive works with any iterable, including arrays, sets, maps, and even generators, whilst Array.prototype.map only works on arrays. So it really depends on what iterable you are mapping over.

See https://lit.dev/tutorials/working-with-lists/#2 for more info!

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@jdcoldsmith
Comment options

@jdcoldsmith
Comment options

@augustjk
Comment options

@jdcoldsmith
Comment options

Answer selected by jdcoldsmith
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants