python
In [1]: [n for n in range(10)] Out[1]: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
javascript (ES6以降)
[...Array(10).keys()] > (10) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
牌語備忘録 -pygo
In [1]: [n for n in range(10)] Out[1]: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
[...Array(10).keys()] > (10) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]