How can I store each value of javascript array in variable such that I can use it to perform further actions?
Eg:
var plan = [100, 200];
var months = [3, 6];
for (var i = 0; i < plan.length; i++) {
p_det = plan[i];
}
for (var i = 0; i < months.length; i++) {
m_det = months[i];
}
console.log(p_det * m_det); //Gives me value of 200*6
Mathematical action I've to perform such that ((100 * 3) + (200 * 6))
Is storing each value in variable will help? How can I achieve this?