Is JavaScript's array.clear() not a function? [duplicate]

Solution 1:

Nope, it's not. But drawnDivs.length = 0 should work.

Solution 2:

drawnDivs = [];