Re:Mnemonic for Shift() and Unshift()?
by kondrei on Friday March 29, 2024 @11:30PM
(#39871610)
I have this problem with splice and slice too
[ Parent
| on HN ]
Oof same, I'm always going back to the docs for these
Re:Mnemonic for Shift() and Unshift()?
by galaxyLogic on Sunday March 31, 2024 @12:36AM
(#39881479)
I try to get by with slice() since it is simpler to understand. Semantics is "taking a slice". splice() has a meaning of not only splitting but also putting slices back together, and is used less often. I too always have to look up its definitions from docs, partly because I use it so infrequently.