Each blocks in Svelte, can't seem to wrap my head around this block of code
I understand const colors, I get the each block, but I'm failing to wrap my head around why we're setting selected to colors[0]; and why some of the code in button has color wrapped in {}, and sometimes it doesnt?
4 Replies
So you have a current selected to start with
the {} 's are for vars/js code
so you have like on:click= which is a svelte attribute (like onClick="")
I haven't experimented with Svelte yet but {} usually means that the code within should be parsed as JavaScript
Ok that makes more sense
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View