In case you have an array in JavaScript and you want to remove all elements from that array , there are couple of ways by which you can remove all elements from your array.
#1
Arr = [];
#2
Arr.length = 0#3
Arr.splice(0,Arr.length)
#4
while(Arr.length > 0) {
Arr.pop();
}
No comments:
Post a Comment