diff options
| author | Aya Morisawa <AyaMorisawa4869@gmail.com> | 2018-08-16 05:15:06 +0900 |
|---|---|---|
| committer | Aya Morisawa <AyaMorisawa4869@gmail.com> | 2018-08-16 05:15:06 +0900 |
| commit | fa95641f88df107abd17d8218272b40888e8535c (patch) | |
| tree | dacb240f559c8f82b1ec3085e4816ceaf071f9c3 /src/client/app/common/scripts | |
| parent | Merge pull request #2247 from syuilo/clickable-reaction (diff) | |
| download | sharkey-fa95641f88df107abd17d8218272b40888e8535c.tar.gz sharkey-fa95641f88df107abd17d8218272b40888e8535c.tar.bz2 sharkey-fa95641f88df107abd17d8218272b40888e8535c.zip | |
Use Array.prototype.length to avoid magic number
Diffstat (limited to 'src/client/app/common/scripts')
| -rw-r--r-- | src/client/app/common/scripts/get-kao.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/client/app/common/scripts/get-kao.ts b/src/client/app/common/scripts/get-kao.ts index ca7cebaebc..58857edfe1 100644 --- a/src/client/app/common/scripts/get-kao.ts +++ b/src/client/app/common/scripts/get-kao.ts @@ -1,6 +1,8 @@ -export default () => [ +const kaos = [ '(=^・・^=)', 'v(\'ω\')v', '🐡( \'-\' 🐡 )フグパンチ!!!!', - '🖕(´・_・`)🖕' -][Math.floor(Math.random() * 4)]; + '🖕(´・_・`)🖕', +]; + +export default () => kaos[Math.floor(Math.random() * kaos.length)]; |