Hacker News new | ask | show | jobs
by vorticalbox 1151 days ago
little JS trick for you you can use Array.from so you can skip one of the .fill

> let board = Array.from({length: N_ROWS}).map(() => new Array(N_COLS).fill(0));

probably doesn't matter for this size of a board but its one less loop of the array