Search for '{{search_term}}'

Why does this code not work? (split, array slice)

What to do when you try to split a string and get several fields at once but it does not work?

I've received the following two examples in a short intervallum asking Why does this code not work?.

In order to answer the questions I actually need to know what is the expected result, something the person asking this question missed to provide, but luckily in these examples it seemed to be obvious.

In the second example, apparently in an attempt to simplify the code and find the problem
that way, the author has first created an array from the list returned by the
split and then tried to use array slicing.