3 ms·
Can anyone summarize what the resulting syntax looks like?
by amelius 8y ago
Can anyone summarize what the resulting syntax looks like?
- foob 8y agoThere's a table in the GitHub repository that shows the inputs and outputs for various equivalent slices in JavaScript and Python [1]. If you're familiar with the Python slicing syntax, that should make the syntax mapping fairly clear. The way to translate a Python slice definition to JavaScript is to use double square brackets instead of single ones and to replace the colons with commas. So array[::-1] becomes array[[,,-1]], array[3:] becomes array[[3,]], etc. [1] - https://github.com/intoli/slice#for-people-who-know-python-already https://github.com/intoli/slice#for-people-who-know-python-a...