Y
Hacker News
new
|
ask
|
show
|
jobs
by
somewhereoutth
857 days ago
I prefer the js:
ys = [1, ...xs, 5]
It is more visually indicative of a 'spread' of values.
1 comments
squeaky-clean
857 days ago
It's definitely more visually intuitive for someone new to the language. But Python has used asterisk for unpacking lists in other places, so the first time I saw it done for array spreading it made perfect sense.
link