LoginSignup
0
0

More than 3 years have passed since last update.

りばうしをリスペクトして一定時間ごとにシャッフルされるリバーシを作った時に得た知見について

Posted at

記事概要

制作過程を載せるのではなく、
制作にあたって得た知見を共有して欲しいという意見をツイッターで見たので、
制作過程については一切触れずに完成品と得た知見について書こうと思った。

完成品

得た知見

JavaScriptにおいて配列のswapを行う際は以下の書き方が出来る。
[array[j], array[i]] = [array[i], array[j]];

配列内のとある条件を満たす要素の数を数えたい場合以下の書き方が便利。
array.filter((e=>{return e == hoge})).length

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0