2018-07-29から1日間の記事一覧
タイトルはつまり new Hoge(1, 2, 3) === new Hoge(1, 2, 3)を実現するということです。 実装 まず実装をお見せします。 const pool = []; class Hoge { constructor(x, y, z) { if (!pool[x]) pool[x] = []; if (!pool[x][y]) pool[x][y] = []; if (pool[x]…
タイトルはつまり new Hoge(1, 2, 3) === new Hoge(1, 2, 3)を実現するということです。 実装 まず実装をお見せします。 const pool = []; class Hoge { constructor(x, y, z) { if (!pool[x]) pool[x] = []; if (!pool[x][y]) pool[x][y] = []; if (pool[x]…