Created
January 12, 2019 04:22
-
-
Save tranduclinh2067/eb0ecaad42d1eff02263199a93012e43 to your computer and use it in GitHub Desktop.
Bạn muốn lấy các phần tử còn lại có trong mảng?
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 [a, b, ...arr] = [1, 2, 3, 4, 5, 7]; | |
console.log(a, b); // 1, 2 | |
console.log(arr); // [3, 4, 5, 7] | |
// => a = [0], tương tự vậy b[1], nhưng ...arr sẽ lấy hết các phần còn lại bao gồm arr[n++] tiếp theo sau đó. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment