Javascript : how to remove complex array from a table?

Hi,

I’m using splice to do this, but it"s not the solution. How do you do to remove for example the level 3 in my snippet ?

Thanks in advance :wink:

	var sav_data = {
		0:{
			created: "string" ,
			number_player: "number" ,
			number_enemy: "number",
			position_enemy_x: [],
			position_enemy_y: [],
			scale_enemy: [],
		}

	}

	console.log(sav_data[0])

	var tmp_lvl = {
		created: "string" ,
		number_player: "number" ,
		number_enemy: "number",
		position_enemy_x: [],
		position_enemy_y: [],
		scale_enemy: [],
	}

	sav_data[1] = tmp_lvl
	sav_data[2] = tmp_lvl
	sav_data[3] = tmp_lvl
	sav_data[4] = tmp_lvl
	console.log(sav_data)
    // i want remove the sav_data[3] but this doesn't works "sav_data.splice is not a function"
	sav_data.splice(2,1)

sav_data needs to be an array.

var sav_data = [
  {
	created: "string" ,
	number_player: "number" ,
	number_enemy: "number",
	position_enemy_x: [],
	position_enemy_y: [],
	scale_enemy: [],
  }
]

cool it was it, thanks