Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript Loops Working with 'for' Loops Dynamically Display HTML with a Loop

Nik Oaks
Nik Oaks
8,056 Points

Exponential growth in loops

I tried making the sequence exponential instead of linear by typing "i*i" and Math.sqrt(i) but that didn't work so i'm wondering how or if you can do that.

1 Answer

Steven Parker
Steven Parker
231,268 Points

I would have thought i*i would have worked well, but you might also try something like Math.pow(2, i).

If that's also not what you are looking for, perhaps you could give an example of the sequence you're trying to generate?

Nik Oaks
Nik Oaks
8,056 Points

There could have been a syntax error in my code, because I was sure that both of those would have worked.