Update grid.js
Merge pull request #1 from pembeci/patch-1

You can drop the conditionals inside the loop