Hi I am having an array like below and trying to push the item on map, but i am not able to push, Please tell what wrong i am doing here.
firstClassPrices: [
[
"Kan ej ombokas",
"431",
"SEK",
"Företagspris"
],
[
"Kan ombokas",
"525",
"SEK",
"Företagspris"
]
]
trying to push '1' like below:
let ticketi = firstClassPrices.map((price) => {
price.push("1");
});
i need o/p as
firstClassPrices: [
[
"Kan ej ombokas",
"431",
"SEK",
"Företagspris",
"1"
],
[
"Kan ombokas",
"525",
"SEK",
"Företagspris",
"1"
]
]
.map()while not returning any elements from its callback function so the return value (which you store inticketiwill only containundefinedvalues. But the originalfirstClassPriceswill contain what you are looking for.