Skip to main content

Part

WLJS
Wolfram Kernel
Execution environment
Supports dynamics
symbol[[i]]

gives the i-th part of a symbol

symbol[[-i]]

gives the i-th part of a symbol form the end

symbol[[i, j]] or Part[symbol, i, j]

takes i-th and then j-th part of a symbol (better optimized than the sequence of two Part)

symbol[[{i, j, k}]]

takes i,j,k parts and arrange it as a list

symbol[[begin ;; end]]

takes elements from begin to end (included)

symbol[[begin ;; end ;; step]]

takes elements from begin to end though step

symbol[["key"]] or symbol[[Key["key"]]]

takes "key" from the association symbol

Notes on WLJS Interpreter

If used inside Offload or directly on WLJS Interpreter multiple parts pattern is not yet supported, i.e. use

val[[3]][[1]] // Offload ✅

instead of

val[[3,1]] // Offload ❌

Any other patterns are not supported