Search This Blog

2023/07/25

How to emply array

 var arrayList = ['a', 'b', 'c', 'd', 'e', 'f'];


console.log("Before:",arrayList)

arrayList.splice(0,arrayList.length)

console.log("After:",arrayList)

output:
Before: [ 'a', 'b', 'c', 'd', 'e', 'f' ] After: []

No comments:

Post a Comment