Yes, please. Strings too.
I'd also love range access.. e.g. arr[2,5] to create a slice off the array/string/typedarray etc
/cc @MylesBorins @littledan @ljharbhttps://twitter.com/Fishrock123/status/1137072577925410816 …
-
-
Replying to @jasnell @MylesBorins and
-1 on doing this for strings. What would it even do?
1 reply 0 retweets 0 likes -
same thing as `.slice(-1)`, I’d expect - the syntax should ideally work on any arraylike
1 reply 0 retweets 1 like -
Would it return UTF-16 code units, code points, or graphemes? It’s confusing either way. Hard pass.
1 reply 0 retweets 5 likes -
if arraylike, it’d have to return code units; if based on iterables, code points. Nothing does graphemes. The syntax would be confusing imo if it only applies to arrays, and I’d be a hard pass on that.
1 reply 0 retweets 2 likes
Intl.Segmenter does graphemes.
1:16 PM - 7 Jun 2019
0 replies
0 retweets
3 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.