SolidJSS
SolidJSβ€’2y agoβ€’
8 replies
innards7

Question about store `range` update API

I've been trying to update the docs for the store page and I noticed an API decision I found surprising.

The path syntax for specifying a range of indices to update in an array { from: 3, to: 7 } is inclusive for both start and end.
Most similar JS APIs I can think of (.slice for example) are start inclusive, end exclusive.

Does anyone know why the index range API works this way? I thought it might be worth calling out in the docs, but I'm also just curious even if it's not.
Was this page helpful?