I have a array like this:
array = [
['ID','Name','Gender']
['1', 'John', 'Male']
['2', 'Mark', 'Male']
]
I want to delete the first array, which is ['ID','Name','Gender']
But how can I delete this array ?
I have a array like this:
array = [
['ID','Name','Gender']
['1', 'John', 'Male']
['2', 'Mark', 'Male']
]
I want to delete the first array, which is ['ID','Name','Gender']
But how can I delete this array ?
You can use shift()
to remove the first array
let array = [
['ID', 'Name', 'Gender'],
['1', 'John', 'Male'],
['2', 'Mark', 'Male'],
]
array.shift();
console.log(array);
Doc: shift()
Another option is to splice()
let array = [
['ID', 'Name', 'Gender'],
['1', 'John', 'Male'],
['2', 'Mark', 'Male'],
]
array.splice(0, 1);
console.log(array);