Created
January 4, 2021 17:05
-
-
Save Sanchithasharma/5b3c22d6e0690ce21d2580b20d667ac7 to your computer and use it in GitHub Desktop.
Using to String to flatten 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
favMovies = ['Begin Again', 'Soul', ['Matrix', 'Matix Reloaded', 'Matrix Revolutions'],['Frozen', 'Frozen 2', ['Tangled', 'Alladin']]] | |
favMovies.toString().split(",") | |
// expected result: ["Begin Again", "Soul", "Matrix", "Matix Reloaded", "Matrix Revolutions", "Frozen", "Frozen 2", "Tangled", "Alladin"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment