-2
Good afternoon, I am trying to modify a script that I am creating to create a simple web page, the beginning of the code I was able to create, however I have difficulties in separating the result, like: in the code I created Oce inserted a value and returns 52 different results, and with that I want to separate from in blocks, it would be a total of 13 blocks, the first contains the result from 1 to 4, the second from 5 to 8 and so on, but besides that I want to add the result, and I am not getting, I searched on the internet for options and I arrived at the split, however I cannot fit into the script I am creating, below follows the code.
var plan = prompt("Valor depositado.");
for (var i =1; i<=52; i++){
console.log(`${i} = ${i*plan}`);
}
The idea in this code is to try to "replicate" the 52-week spreadsheet, the 13 blocks would be the months (remembering that it would have a 13°month that n has in the calendar), the separation would be more for the sake of organization, and the sum would be the value that would be given from the beginning each week.. But the way you did it already gave me a light, I’m still learning I tried to replicate this spreadsheet just as exercise to learn faster.
– rui davi