Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Fix for #100 - calculate random index for array #101

Merged
merged 1 commit into from
Sep 5, 2017

Conversation

pabrams
Copy link
Contributor

@pabrams pabrams commented Sep 5, 2017

We want to get random tweet ID to retweet for indexing into the array data.statuses, so desired range for random number is [0..data.statuses.length-1]
see function getRandomIntInclusive at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random
Note that I also fixed a type in the error and added the exception message.

We want to get random tweet ID to retweet for indexing into the array data.statuses, so  desired range for random number is [0..data.statuses.length-1]
 see function getRandomIntInclusive at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random
Copy link
Owner

@spences10 spences10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@spences10 spences10 merged commit 9f22394 into spences10:master Sep 5, 2017
@pabrams pabrams deleted the patch-1 branch September 6, 2017 00:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants