From e7e45fef427d3d76f7f88ca919c73e28de5a301b Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sat, 20 Jun 2020 10:21:32 -0700 Subject: [PATCH 1/1] Use an array spread syntax instead of .fill(null) I don't really need null items. In fact, the copy here with the appray spread syntax gives undefined, not null items. All I need is items that map() will actually act on. The initial Array(9) gives only "empty" items which map() ignores. --- scribe/scribe.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scribe/scribe.jsx b/scribe/scribe.jsx index be0de37..7815594 100644 --- a/scribe/scribe.jsx +++ b/scribe/scribe.jsx @@ -268,7 +268,7 @@ class Game extends React.Component { game_info: {}, player_info: {}, other_players: [], - squares: Array(9).fill(null).map(() => Array(9).fill(null)), + squares: [...Array(9)].map(() => Array(9).fill(null)), moves: 0, next_to_play: "+" }; -- 2.43.0