Answered by : marton
const myArray1 = []
// or...
const myArray2 = new Array()
Source : | Last Update : Wed, 02 Sep 20
Answered by : ilham-surya
arr = [];
Source : https://www.tutorialspoint.com/in-javascript-how-to-empty-an-array | Last Update : Sat, 05 Mar 22
Answered by : philani-sithembiso-ndhlela
let list = [1, 2, 3, 4];
function empty() { //empty your array list.length = 0;
}
empty();
Source : https://www.jstips.co/en/javascript/two-ways-to-empty-an-array/ | Last Update : Mon, 08 Jun 20
Answered by : mike-keller
let arrayName = [];
Source : | Last Update : Tue, 24 Mar 20
Answered by : philani-sithembiso-ndhlela
// define Array
let list = [1, 2, 3, 4];
function empty() { //empty your array list = [];
}
empty();
Source : https://www.jstips.co/en/javascript/two-ways-to-empty-an-array/ | Last Update : Mon, 08 Jun 20
Answered by : jessica-koekemoer
// Variable array for a wider scope:
var arrayName = [];
// Local scope variable array:
let arrayName = [];
Source : | Last Update : Wed, 17 Jun 20
Answered by : gbor-deutsch
let myArray = [12 , 222 , 1000 ];
myArray.length = 0; // myArray will be equal to [].
Source : https://stackoverflow.com/questions/1232040/how-do-i-empty-an-array-in-javascript | Last Update : Fri, 27 Nov 20
Answered by : modern-mouse
A.length = 0
Source : https://stackoverflow.com/questions/1232040/how-do-i-empty-an-array-in-javascript | Last Update : Sat, 06 Jun 20
Answered by : kvz
// n is the legth of the array
int[] IntArray = new int[n] // int array
String[] StrArray = new String[n] // String array
Source : | Last Update : Fri, 16 Sep 22
Answered by : dangerous-dragonfly-wrxk59dbuf47
Array
(
)
Source : | Last Update : Tue, 26 Oct 21