Communities for your favorite technologies. Explore all Collectives
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
For brevity with using ES2015 , if you plan to simply clear the array (this is an example, insert your own function for element "e", of course):
let MyArray = [1,2,3,4,5] MyArray = [].concat(MyArray.filter(e => e > 2)) console.log(MyArray)
For brevity, if you plan to simply clear the array (this is an example, insert your own function for element "e", of course):
For brevity, if you plan to simply clear the array (this is an example, insert your own function "e", of course):