Created
April 6, 2022 04:23
-
-
Save ashutoshkrris/4ca82f420d3b7cc29233a6ab0a3e0191 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 postData = [1, 'Getting Started With Rich', 'Ashutosh Krishna']; | |
| const [postId, postTitle, postAuthor] = postData; | |
| console.log(postId, postTitle, postAuthor); | |
| // With Objects | |
| const anotherPostData = { | |
| anotherPostId: 1, | |
| anotherPostTitle: 'Getting Started With Rich', | |
| anotherPostAuthor: 'Ashutosh Krishna' | |
| }; | |
| const {anotherPostId, anotherPostTitle, anotherPostAuthor} = anotherPostData; | |
| console.log(anotherPostId, anotherPostTitle, anotherPostAuthor); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment