How to incorporate push or some kind of for loop with fillRect() for an array

I am trying to make a snake game in html and javascript, and I have been having trouble thinking of how I can use push() or some kind of for loop possibly to generate multiple squares (10px width and 10px height) behind the random snakehead generated. Can someone help or direct me?
Code so far: