Created
February 4, 2020 07:19
-
-
Save dilani14/456dfbe16186cfd6bd114833b7b0b3c3 to your computer and use it in GitHub Desktop.
assigning rest of the array
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
let students = ['Bob', 'John', 'Steve', 'Daniel', 'Gorge', 'Philip']; | |
const [first, second, third, ...other] = students; | |
console.log('Students except 1st, 2nd, 3rd:',other); | |
// output: Students except 1st, 2nd, 3rd: (3) ["Daniel", "Gorge", "Philip"] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment