empty array javascript
arr = []; // set array=[]
//function
const empty = arr => arr.length = 0;
//example
var arr= [1,2,3,4,5];
empty(arr) // arr=[]const myArray1 = []
// or...
const myArray2 = new Array()var colors = ["red","blue","green"];
colors = []; //empty the arrayA.length = 0let myArray = [12 , 222 , 1000 ];
myArray.length = 0; // myArray will be equal to [].// set array
arr = [1,2,4];
// empty array
arr = [];
Also in JavaScript:
- apply event listener on id but why not style
- how to open new tab in vscode using keyboard
- testing a function in jest on click react
- mongoose custom object schema
- react native multiple touchableopacity
- javascript push array
- how to get text which is in input td using jquery
- chartJs height
- js date now format
- set variable inside div angular
- find in string javascript
- chrome back button click event react
- npm i material ui
- react function exec when button is clicked
- how do i activate my mangekyou sharingan
- casl react redux
- angular inline component
- javascript regex only letters and spaces
- Material-ui clock icon
- javascript object
- react routes
- You need to inject a global window.jQuery first.
- ipa failed react native after processing
- Peerjs WebRTC video screen becomes black if not on wifi