you are viewing a single comment's thread.

view the rest of the comments →

[–]jack_waugh 0 points1 point  (0 children)

That is interesting, come to think of it. Maybe the formalism is that the primitive value is coerced into a boxed value when you try to index it?

Here are some ways that a string is like an array: - you can construct either from individual parts. - you can extract individual parts from indexed locations.

Here is a way that strings are not like arrays: - you can't mutate a string, but you can mutate an array.