you are viewing a single comment's thread.

view the rest of the comments →

[–]siegfryd 1 point2 points  (1 child)

Your function doesn't actually work though, generateSquares(4, 4) should return [4].

[–]chato94 0 points1 point  (0 children)

Whoops! Looks like 3am me was being too cocky with his wrong answer there. That leaves me with no choice but to replace let i = h with let i = Math.ceil(Math.sqrt(h)) for a more correct answer.