Created
February 4, 2020 07:30
-
-
Save dilani14/40805dd6b7285f5f3cc6162881ee1946 to your computer and use it in GitHub Desktop.
nested destructuring 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'], 'Philip']; | |
const [first, second, [third, fourth]] = students; | |
console.log(`Thrid and Fourth are : ${third} and ${fourth}`); | |
//output: Thrid and Fourth are : Steve and Daniel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment