3 ms·
The first is only weird if you expect the + operator to perform an operation on arrays. It doesn't, so each array becomes a string and those two strings are con
by zdragnar 5y ago
The first is only weird if you expect the + operator to perform an operation on arrays. It doesn't, so each array becomes a string and those two strings are concatenated.
The second is only weird in that you are constructing an array with implicit undefined values, which is exactly what I would expect to happen if my linter didn't complain about the syntax and I had to guess what might be happening.
- Izkata 5y ago> The first is only weird if you expect the + operator to perform an operation on arrays. Like GP said, comes from other languages. That line can be copy/pasted into python and it performs concatenation.