1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

懸賞にどうしても当選したいので

1
Last updated at Posted at 2020-08-19

どうやったらレビューをすり抜けられるかJSでちょっと考えてみましたw

function getRandomNumber(length) {
  return
    Math.floor(Math.random() * length);
}

function getRandomWinner() {
  const entries = [
    '',
    'あなた'
  ];
  const index = getRandomNumber(entries.length) >> 0;
  return entries[index];
}

下らないようで他言語にはない落とし穴を使っています。わからなかった場合は O'reillyのJavaScript をオススメします。

答えはこちら:
https://speakerdeck.com/reverentgeek/javascript-past-present-and-future-ndc-porto-2020?slide=25

1
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?