Skip to content

Add element in store array #866

Answered by ryansolid
untlsn asked this question in Q&A
Feb 23, 2022 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

At the end of the list technically 2, 3, 1 in that order for performance. But I wouldn't sweat it. In most other situations 1 over 3. Generally speaking produce has a tax per index that changes so cloning the array is just easy/better.

I'd say number 1 is idiomatic but hey if there are places to optimize like 2 go for it. 3 makes certain logic easier to write.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@jmpedrosa
Comment options

Answer selected by untlsn
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants