I want to do some Calculation inside array, I want to push back to array after iteration.
let dataValue = [90, 150, 180, 200, 230, 270]
dataValue.map((data) => {
let ValueAs = angleToVaue(data); //calculations I do I get some output like this example: 1000, 3500, 7000, 6000
//I want to put back to array
let arraValue =[];
arraValue.push(...ValueAs);
console.log(...ValueAs); // error: valueAs is not iterable
});
>Solution :
I guess my answer is what you want to achieve. You have typos in your code and wrong logics
let dataValue = [90, 150, 180, 200, 230, 270]
let angleToVaue = (value) => {
return value/360
}
let arraValue = [];
dataValue.map((data) => {
let valueAs = angleToVaue(data);
arraValue.push(valueAs);
console.log(valueAs);
console.log('I am the array', arraValue)
});