From fa95641f88df107abd17d8218272b40888e8535c Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Thu, 16 Aug 2018 05:15:06 +0900 Subject: [PATCH] Use Array.prototype.length to avoid magic number --- src/client/app/common/scripts/get-kao.ts | 8 +++++--- 1 file 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)];