-
-
Save JoanMora/947f785aa1876a3696e3d875b18b3140 to your computer and use it in GitHub Desktop.
head and tail destructuring in javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const [head, ...tail] = [1,2,3]; | |
// head 1 | |
// tail [2,3] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment