Skip to content
Advertisement

Add to a array using a formula based on the last entry in an array n number of times

I’m attempting to build an array from a known starting value that appends to itself based on a formula that includes the last number of the list. I’d like to do this a specified number of times. So for example:

JavaScript

My non-working code is below:

JavaScript

I’d like to be able to tell the array to stop after 30 entries.

Advertisement

Answer

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement