Created
October 21, 2019 15:35
-
-
Save epjuan21/90018089236aba036e676a94888a069b to your computer and use it in GitHub Desktop.
Empty an 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
// Empty an array | |
var fruits = [“banana”, “apple”, “orange”, “watermelon”, “apple”, “orange”, “grape”, “apple”]; | |
fruits.length = 0; | |
console.log(fruits); // returns [] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment