js array clear

Solutions on MaxInterview for js array clear by the best coders in the world

showing results for - "js array clear"
Lisa
30 Sep 2018
1let aray = [1,2,3,4,5,6,7,8,9,10];
2
3//as with most coding there are several ways you can do anything
4//see whichever works best for your scenario
5
6//set the array to equal a blank array
7array = [];
8
9//set the array's length to 0
10array.length = 0;
11
12//using splice, starts at index 0 & removes everything up to and including that last index 
13array.splice(0, array.length);
14
15//map or loop through and shift() or pop();
16//goes through the array one at a time and removes the last item each time
17array.map( () => array.pop());
18
19//goes through the array one at a time and removes the first item each time
20array.map( () => array.shift());
Mads
18 Aug 2018
1A = [];
Blake
10 Jun 2019
1var cars = ["mazda","honda","tesla"];
2	cars = []; // clear/empty the array
Mika
25 Jul 2019
1A = [];
2
Patrick
22 Jun 2016
1let list = [1, 2, 3, 4];
2function empty() {
3    //empty your array
4    list.length = 0;
5}
6empty();
7
Diego Alejandro
21 Jun 2017
1A.length = 0
2
queries leading to this page
empty 5 in javascript arrayjs delete element from arrayjs clear arrarcreate empty array of length jsarray remove element jsjs reset arrayhow to delete all object in an array javascriptlist remove in jshow to check empty array in javascriptempty array jsarray remove objectremove all array elements javascripthow to clear a list in jsjavascript how to reset an array clear array jsmake javascript array emptyjavascript reset arrayjavascript code to assign array to nullhow to initiate an empty array in javascriptclearing an array in javascriptjavascript clear array contentsclear items in array javascripthow to clear arraylisyjavascriptarray clearhow to create an empty arrayjavascript how to reset to empty arrayjs delete all from arrayhow clear an arrayempty array with one element jsdelete all items in an arrayempty a list jsremove all content from array jsjquery clear an arrayjs remove all items from listpurging jaavascript arrayjavascript make empty arrayclear content of array in javascripthow to empty an array in javascript geeksforgeekshow to erase an array jsempty array length javascript 5b 5d javascript empty array 3d 3d 3djavascript emptyarrayclear all elements of array in javascripthow to delete all the elements in an arrayarray remove javascriptarray remove all itemsjavascript delete all elements in arraytype script clear an arraywho to delete all valus from array in jsempty array with objects javascriptwhy create an empty array javascriptpop index from array javascriptdelete js arraycreate empty arraydelete a list javascriptjs how to empty arraytypescript array clear js create empty arrayremove method in javascripthow can we clear an arrayjavacript array cleardoes an empty array have 0 jshow to remove all items in array javascripthow to empty array in javascript 3fcreate a empty array in javasciptdecakre empty arrayja array remove by indexdelete elemet from arrayremove from array nodejsremove element in array jsjavascript remove from array arrayreset var array javascriptemptying out list javascriptdelete all from array jsjs find and delete from arrayremove array from array javascriptjava script list without an arrayclear an array javascriptdelete item from array javascriptall remove in array javascriptjs reset array to initialjavascript clear all value in arrayblank array in jshow to clearn arraydelete all array elementjavascript array remove allremove an item from an araryjavascript clearing an arrayclear arrayjs remove all items from arrayjavascript how to clear an arrayreturn an empty array nodejsjs remove all items in arrayempty array is false 3f jshow to clear array declarationclear in array jsjavascript best practice empty arrayhow to clear an array in javascripthow to remove specific index from array javascriptdelete all array element in js domhow to make a blank spot in a javascript arrayarray is empty jsremove amn item form an arraynode js array data how to cleardelete item array javascriptempty the array in typescripthow to clear array javascriptjquery empty arryjs how to remove index from arrayhow to delete all the element from the arrayremove all 27 27 from array javascriptjavascript make new empty arrayremove all list items javascripthow to find array is empty in javascriptjavascript array remove all elementsjs array clearhow to delete all in array jsdelete element from arrayhow to clean an arraylist in nodejshow to clear out arrayclear js listremove array by indexjavascript remove array from arraytypescript clear all objects in arrayjavascript clear array memoryremove all item in array javascriptspecify array as emptytypescript remove all object in arrayjs remove all values from arrayjquery empty array remove item array javascriptlist js cleararray remove javascript slicetypescript reset un arrayjs clear array itemshow to delete every item in array in jsjavascript list clearjs splice empty arrayempty array valuejs best way to remove all item from arraymake an empty array jaclear and push in arrayclear arrary jafvascriptclear an arrayjs clean arrayempty array javascript objectjavascript clear object arrayarr clearremove all items from array javascriptclear data from arrayes6 empty arrayremove item from arratdelete all entreies of array javascriptjs how to clear an arrayhow to reset an array in typescripthow to delete all items of an array in jsremove all element from array javascriptjs function to clear a arrayjs how to clear arrayhow to remove all elements in an array javascripthow to remove all items from an array in javascriptjavascript empty arrayans array clearremove element from javascript arrayjavascript remove all from arrayclear array in javascjs check empty arraynodejs delete all listarray reset javascriptwhat does an empty arry return in javascritstrip array jsjs delete element from array by indexhow to remove all items from array in javascriptjs empty array size nhow to set empty array for jsclearing element is arrayclear an arry jsnew empty list in javascriptcheck if empty array jscheck array empty jscreate an empty array jshow to make an empty arrayremove all elements of array in javascriptvider array javascriptarr clear 28 29how to remove item from array javascriptempty function in arrayjavscript array clearjavascript clearing an arratnodejs clear arrayjavascript empty an arraydelete from array where object value javascriptremove all items in array javascriptremove all items in array jsempty the array jshow to make javascript array emptyhow to set an array to empty in javascripthow to make an empty array jsclear an array typescriptjs remove all empy arraysclear out array javascripthow to create an empty array in javascriptremoving elements from an arratmake an array empty javascripthow to remove all array element in javascripthwo to clear all of the array in javcascritjavascript how to remove everything from an arrayajavascript clear all array elementsitems out of array jsdelete all items from array javascriptremoving specific element from array javascripthow to declare an empty array in javascripthow to clear a arrayhow to clean array in jshow to clear all element of arrjavascript array emptyjavascript list clearhow to cempty an arrayset empty array javascriptgive empty array in javascriptjavascript check empty arraydeclaring empty array in javascriptreset the existing array in javascripthow to clear out an array in javascriptclear data in array javascripthow to clear array valuedelete all data in array javascripthow to clear all element of arrey in jshow to remove an item from an array javascriptjs remove element from array by stringclear array function javascriptremove specific string element from array jsto clear a arrayhow to make an empty array in javascriptarray clear method javascriptextract an element of an array in jshow to create empty arrayjs array remove all itemsremove all elements from an array javascripthow to set empty array in javascriptjavascript mutate array to emptyjs arrayy clearjs list emptyhwo to clear array javascriptjavascript empty listdelete and reset array size in javascriptjavascript delete all items from arrayreset array in javascrtpjs remove all from arrayremove all elements of an array jsempty array condition in javascriptjavascript remove item from arrayhow do i empty a list in typescripthow to delete everything in an arrayjavascript clearing my arrayajavscript empty arrayjavascript re initialize arrayhow to empty a array in jsclear array lshow to reset an array to empty in javascriptjs erase all elements of arrayhow to delete entire array in jsjavascript clean arayremove all elments of an arrayjquery empty arraynodejs clear an arrayclear an array jsarray empty 28 remove all element in array javascripthow to clear array in jsdelete array from array javascriptjs clearing ana rrayhow to clear array in vue jsw3schools declare empty javascript arrayjavascript array empty itemsclear array dataremove item from list javascriptcreate empty array with empty values in javascriptclear array es6delete all elements from array javascriptjavascript use splice to empty arrayr c3 a9initialiser un array js js array delete itemclear out array jshow do you clear an array in javascriptdelete entire array javascriptjs clear values from arraydelete all values in array javascripthow to make none array javascriptjs remove all elements in an arrayjavascript delete element from array by indexjs delete from all arraysmake array empty in typescript on clickcheck empty array in javascriptarray delete all elements javascripthow to make array empty in jqueryhow to empty array javascripthow to clear java script arrayclean array javascriptarray cleararray remove item javascriptjavascript create an empty array of sizejavascript clear entire arrayjs clear array valueangular 5 how to empty an arrayangular clear arrayadd elements to empty array javascript es6empty array of objectsjs clear a created listhow to set empty arrays in object javascriptdelete sets value to emptyremove all elemets in an arrayremove all elements from a list javascriptsfunction to remove all the elements of an array in javascriptremove all from array javascriptjs make array emptyremoving array elementhow to empty an array using javascriptdelete all items in array javascriptarray prototype clear 28 29clear the data from an array one shotejavascript return empty arrayjs array removeatbest way to clear an arrayarray function clear an arrayclear array nodejsdelete array all content javascripthow to empty an array jsjs clear the arrayhow to clear arry in javascriptjs empty array without losing referencenodejs remove item from arrayempty array jqueryhow to clean an array with javascriptjs remove item from arayarray clean lookempty a javascript array javascript how to empty an arraydefine empty array javascripthow to delete all the elements in array in javascriptdelte elemtn from arrraynode js clear arrayclearing array in javascriptjavascript delete element arrayempty an array using javascriptfunction that empties an array javascripthow to clear array object in javascriptremove from arrahow to clear the list in javascriptremoving all objects from an array jsjavascript array clear fucntionclear array typescriptarray empty 28 29typescript clean arraydelete all elements from arrayfor of empty arrayclear array and add new element javascriptarray remove method jsdelete all elements in arrayhow to make array empty in javascript define empty array in javascriptremove empty array javascripttypescript remove all object from arraycreate empty array javascript with sizehow to empty the array in javascriptarray clearhow to initialize an empty array in javascriptremoving elements from arraymethod to clear array in javascriptarray find and delete javascriptjavascript remove all array elementshow to clear array in typescripthow to remove all elements from inside array javascriptenpty the whole array variablearray elements getting empty while post call javascriptremove all instances array javascriptremove first element in an arjs clearing array clear array javascriptjavascript value empty arrayjs remove 1 element from arraydoes an empty array have a length javascripthow to reset the array in javascripthow to clear data of an array javascriptarr clear javascripthow to clean an array in javascripthow to declare a completely empty array javascripthow to remove empty files while splice in javascripthow to remove from arrclear all items in array javascriptarray clean arrayempty arrays in javascriptempty an array in javascriptjs clear arrayremove item from array 3fjavascript emtpy arraytypescript reset arrayempty arrayclear whole arrayemptying array jsclear array items in jsjavascript empty arrausing an empty array javascriptremove all items array jshow to declare an array without resetting its itemsjavascript how to remove all elements from arrayjs empty array lengthdistruture empty array in jshow to check an empty array in js use empty for clearing javascripttype of empty array javascriptjavascript is array emptydump empty array jshow to clear array items in javascriptjavascript how to clear a listremove some data from array javascriptjs array remove allmethod for empty an arrayremove value from list jshow to empty array object in jshow to clear a whole arrayhow to remove element javascript arrayremove al values array jsjavascript array remove all ifclear all array javascriptjs clear an arrayclean array element jsclearn array jsclear array 5b 5darray clear in javascriptjavascript remove from array by indexdelete all eelements from list javascriptnode js array cleanjsquery empty arraybest way to empty an array javascriptjs remove all element from arrayset array to null typescripthow to make empty array javascripttypescript empty arrayhow to clear the array values in typescriptdelete all values that 3d 22 22 in js arrayset javascript array to emptyjavascript array delete allempty array shorhow to clear everything from an array in jsshorthand for creating empty array javascriptarray length empty javascriptjavascript remove ket from arrayhow to remove all elements from an array in javascriptclean array jsremove all elements array javascriptdelete all elements in array javascriptjavascript initialize empty arrayhow to remove all the elements from array in javascripthow to remove all array elements in javascriptarray method to deleteclean and populate arrayjavascript remove all elements from an arrayremove all in array javascriptjs delete all elements in arrayjavascript delee all items in an arrayremove element from array javascripthow to all remove array in js es6js clear arryahow to delete all elements from an arrayhow to javascript all array deletejs for of empty arrayarray clear 28i 2c 0 2c i length 29 3barray delete all element javascriptempty array javascriptremoving item from the arra y flush an array javascriptclear js arrayremove element from arrayjavascript remove element from arrayarray set to empty value javascripthow to clear arrjs create empty array of sizedelete all items in an array javascriptes6 declare empty arrayclear the array javascriptjs wiping all contents of arraycheck for empty array in javascriptempty array of length jsreset an array javascriptclear or reset a javascript arrayjs declare empty arrayjs define empty arrayhow to clear a array in jsremove all elements arrays javascriptjavascript delete arrayclear the array in jsjavascript removeall arrayjquery clear the content of an arraydeclare an empty array jsemptye array with es 6splice all items in arrayjavasxcript remove all elements arraydelete string element of array javascriptclear array elements in javascript list delete jsjs remove all elements from arrayempty an array jsto empty array javascriptclear the arrayjavascript how to clear arrayes6 set array object value emptyarry clearhow to reset array after returning it in js 5cremove specific element from array javascriptpop all items from array javascripthow to reset var array value in javascriptjavascript nullify an arrayhow to remove all the elements from an array in javascriptremove all elements from array typescripthow to empty arrayarray remove all jsjs create array with empty elementdelete whole array javascriptjavascript array pop until emptyjavascript initialize an empty arrayjs array clearhow to remove all elements in array javascriptdelete all elements of an array jsjs list clearjavascript clear array keep referencejs 3a vider un arrayarray from empty elements jsclear list jsjs delete all array itemsjava script wempoty arrayclear an array from reference jsreset array in jsjs array emptydelete all data from array javascripttypescript how to clear an arrayarray empty javascriptnodejs array cleararray clear jsdelete all elements in an array javascripthow to reset an array to emptyhow to check empty array in node jsempty a js arrayreset array splice 0delete all list item code in javascriptnode js array automatically emptyempty an arrayhow to clear an array javascripthow to clear the array of objects in typescriptmake empty an array jsset array empty javascriptjs var array emptyclear arraylstsjs empty a listclean an array jsreturn an empty array javascriptjs array of array remove js is empty array hmtlclear array before push javascriptclear arraylist javascriptdelete all item of array javascriptjs exclude item from arrayjs remove all array itemshow to empty an array in jsclear an array in jshow to declare blank array in angularhow to define array in blank jsbest way to clear array javascripttake out all objects from array javascriptclearall in array javascriptcreate empty arrayhow to remove all elements from array javascriptremove an item from an arraatremove items from array by indexhow to clear arrayjavascript array remove item fron arrayreset a list javascriptmake array empty javascriptempty an array javascriptremove all but one in array jscreate an empty arrayarray delete javascriptempty an arrray javascriptjavascript array define emptyhow to clear array of datadelete all array dataarray is clearing itself javascripthow clear array jsempty the array in javascripthow to remove all the elements from a array in node jsjs empty object with arrayjavascrit array delete all but fisrtarray clear 28 29js erase arraydeclare an empty array variable in javascripotclear all elements in array javascriptcreat an empty array in javascriptjs array emptyhow to remove all values in an arrayjs creating empty arrayhow to clear the array in javascriptdelete all 1 in array javascriptjavascript wipe arraynew array empty javascriptclear array c c3 a4array pop at index javascripthow to empty an arrayhow to remove all values in array in jsempty hashmap jshow clear an array in javascriptarray emptyjs clear array methodjs how to know if empty arrayremove the item in a arrrrayjs empty array falseydelete an array itemremove all elements from array in jsjs remaove array valuehow to remove all objects from a aray in jshow to reset an array to empty javascriptclear angular array with blankhow to delete all the elements in an array jsclear the array and add new element javascriptjavascript array is emptyjavascript cleararrayclear array javascritset old array to new empty arraynodejs array emptyhow to return empty array in javascriptdelete all elements of an array javascripthow to delete array element jsempty array declaration in javascriptremove all elements from arrayjs produce clearjs remove element from array by indexhow to check for an empty array in javascripthow to clear an array in jshow clear arrayhow clear an array javascriptarray exclude jsarray set empty in jsjavascript remove at indexjavascript array clearjs empty listhow to remove all elements from an array in jshow to define empty array in javascripthow to remove all items from array in jqueryjavascript pop using item from array empty arrayempty array in nodejsempty array javascript undefinedwhat is the type of an empty array jsarray remove itemjavascript array cleararray clear 28 29how can i clear an array in jsclear array jqueryclear all elements in array angular typescriptjs array cleanremove everything from array javascriptremoving all elements from array in javascriptclear array javascript es6javascript destroy array with single typescript clear array objecthow to clear the array in jshow to delete all element in arrayclear a array in jscheck array empty javascriptdelte a value in arrayreset the diff in array js javascript remove a element from a arrayjavascript two array if i empty one other also get emptyhow to mark position in array as empty jsjavascript set empty arraydelete element from js arrayjs array remove atjavascript set array to emptyempty array falsy javascriptclear the array in javascriptjs check array emptyhow to assign empty array in javascriptarray full clear in javascriptempty a list in javascriptclear arraylist in javascriptdelete array content jsjavascript array clone and clearjavascript remove all items from arrayadd remove item from array javascriptjs create empty arrayclear typescript arraremove all item from array javascriptclear arr jsremove all array in javascriptclear and set array element to 0javascript array remove all but onehow to remove all elements from an array javascriptjavascript array how to clearclear const array typescriptempty array in jqueryerase array javascriptremove all items from array in typescriptclear javascript arrayjavascript delete item in arraycheck for empty array javascriptjs reset an arraydelete all from array javascripthow to clear an arrayempty js arrayjavascript empty arrauhow to empty an array javascriptjavscript clear arrayhow to clear array variableclear 27 27 in arrayhow to delete all the element in the arraytypescript set array length to zerojs array is emptyjavascript create empty array jshow to all remove array in jshow clear array in javascripthow to clear an array 3fempty large array tremove from araymake array empty jsjavascrpt clear whole arrayhow to empty an array in javascripthow to remove something from an array jshow to empty the array in jsremove empty array from array javascriptjavascript resetting array after adding itemsremove lement from arrayhow to empty my list at once using javascriptempty entire list javascriptwhat is a function in javascript to clear arraydelete everything in an arrayhandle empty arrays javascripthow to remove all element from array in javascriptjavascript array cleanwhat is an empty array in javascriptremove all of one item in an array javascript 28empty array 29 redosjavascript array filter and deleteclear aray jshow to remove empty array in javascriptcreate empty array jsclear array spothow empty array in javascriptarray set to empty javascriptjavascript clear arrayempty array jaavascriptdelete all elements of array javascriptclearing a javascriopt arrayhow to reset an array in javascripthow to clear list jsdelete an array jshow to clear array in javascript empty array check in jshow to check array empty in javascriptarray delete 28 29delete all array content jsdelete all elements in array jstypescript how to clean arraymake array empty in jqueryjavascript list emptyset array to emptyclearing an array javascriptdelete all array elements javascriptreset array javascriptclear old array in object before push new value jsdeclate empty array in jsclear elements in array javascriptjs remove all item of arrayclear a array in javascriptjavascript remove all items in an arrayhow to remove all elements in an arrayclean array in javascripthow to remove all items of an array javascriptjavascrpit empty arrayhow to reset array value in javascriptclear array haxehow to delete everything in array jsremove element from arrauhow to clear array jsjavascript check for empty arraynodejs empty arrayhow to empty a const array jsstatic empty array jsremove all elements from array javascriptclearing an array in tsts clear arrayremove ele 2cment form arrayujs clear array 23js neatest way to clear arrayclear array values jshow to delete all elements of array in javascriptclear one array valueblank array in javascriptempty array check in node jsarray remove all clear elements javascriptjs create an empty arrayclear i array javascripthow to clear arrray in jsjavascript delete empty arraydelete all elements array javascriptarray clear javascripthow to delete all itemsa in an array jsclear array at once in typescriptremove specific iteme from arraaycreate empty array length javascriptlength of an empty array javascriptdelet all value in array javascript exclude array javascriptarray is empty javascriptclear an array in javascriptclear whole array javascriptremove all from arrary jsjava script empty arrayrremove two things from javascriptjs empty arrayto clear array in javascriptreinitialize array in javascripthow to clear an array nodejshow to make an array empty in javascripthow to make array empty 27best way to clear an array 27empty array methodsent empty array in javascriptes6 loop all array items and deletehow to make new array empty in jsclear array and pushempty array value javascriptjs initialize empty arrayjs clear listremove all content array javascriptfor of on empty array jsdelete index data in array javascriptjavascript clear an arrayjs how to remove element from arrayempty array check in javascriptjavascript create empty array with sizearrar removecreate an empty array in javascriptremove all objects in array in jshow to empty a array in javascriptjavascript delete all array elementsarray element removehow to delete all elements of arrayhow to clear an array jsarray cleanclear an array nodejsvanilla javascript clear arraycheck empty array javascriptempty a list in jsempty entire arrayhow to remove all from array in javascriptclean arrayhow to remove all list items in jsremove values with number javascript vectorhow to clear an element in array of objects in javascripthow to return an empty array javascriptjavascript remove all before arrayclearing array jsempty array in javascriptclear typescript arraycheck empty array jsarray remove 2cremove all elements from array jsarray removejs remove all certain elem in arrayjavasript clear attaywhat is empty arrayhow to define an empty array in javascripthow to declare empty array in jshow to delete all in array javascriptjavscript how to clear an arraydelete all elaments in a ararayhow to clear array in node jsremove from array using index clear array data in javascripthow to delete everything from an array jsis data empty array javascriptin an array delete all elements except on injsremove all objects in array javascriptjavascript delete from array indexwhat are the method of empty array javascripthow to clear javascript arrayhow to delete one item from an arrayremoving par items javascriptreset const array javascriptclear an entire array javascriptjs array oushjavascript create empty arrayarray empty 3c 3eclear a javascript arrayclear everything inside an arrayjavascript remove all elements from arrayclear array in javascriptclear an array javashow to remove all elements from javascript arraydelete all element in array javascripthow to clearn an array jsjs remove all items before from arrayarray clear javascriptdeclare empty array in javascriptarray how to clearhow to empty an array in javascript w3reset array jsjs remove element from arraynode js array cleardeclaring an empty array in javascripthow to declare an empty array in javascriptjavascript delete a value from arraycreate empty array javascriptarray clearhow to delete all the elements from an array in javascripthow to remove array iof items from and arrayjavascript remove all list itemsdelete all array element in jsempty array of size javascripthow to declare empty array in javascriptreset array in javascriptremove all from list javascriptjavascript remove all items in array by proeprtyremove all items from arraymeke array emptyhow to make an array emoty in jsdefine array javascript emptyjavascirpt empty arraytypescript clear arrayhow to null array in javascriptbefore pushing data in array empty the arrayclear arrays in jqueryis empty array javascriptremove data from list injscreate empty array in javascriptremove from array javascriptjavascript empty all the arrayjs is array emptyjavascript clear array without losing referenceclear a arrayjs remove from arrayremove items from array javascriptjavascript new empty arrayhow to create an empty array in jshow to remove an element from an array in javascriptjavascript empty array valuesjavascript clear array element valueclear array javascriptempty array angularnodejs empty listdelete element form array jsangular 9 array make emptyexcluding numbers from an array javascriptcan you clear an array in jsmaking an array epmtyhow to remove all objects from array in javascriptclear all array datahow to clear an array typescripthow to delete an element in array javascriptclear contents of array javascriptempty number array angularhow to delete all elements of an array in javascripthow to return empty array item in javascriptjavascript best way to clear arrayjavascript clean arrayjs vanilla array reset 28 29reset array typescriptangular array pop allsetting array length to 0 javascriptjavascript fastest way to clear arrayjavascript remove a item of arrayremove array elements javascriptremove all element in array javascriptjavascript remove all within arrayremove all elements in array javascriptjavascript clear empty array elementsjs how to empty for an array andempty out array javascriptjs clear an array from referencesto remove an element from arrayjs pull item from array to list of valuesclear arry jsremove empty array elements javascriptjs remove arrays of objects within arrayset an empty array in javascriptclearing a javascript arrayclear array in jsdeclare empty array javascriptmake an empty arrayremove all objects in arrayhow to empty array in javascriptcreate empty array with length javascriptjs list remove elementclear array in node jsclear all elements in arrayjs how to empty an arrayjs clear whole arrayjs remove item from arrayempty array nodejshow to wipe array in jsmake array emptyclearing array javascripthow to write out empty arrayjavascript for empty arrayjavascript set array empty to various variableclear out arrayjavascirpt clear an array deleting all items in javascriptremove 2c from array javascriptcall empty on array javascripthow to empty an array use function in javascriptreset a const arrayhow to delete all elements in array in javascriptremove all elements from a list javascripthow to make a null arrat in jsways to clear out a array in javascriptes6 find object in array and removejavascript list emptuclear array jsremove all elements in js arrayremove and get all ements from array jsjs clear array javascript clear arrayyjs remove all array elementsjs array clear