MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/4zukyt/is_your_javascript_function_actually_pure/d6z1nmm/?context=3
r/javascript • u/vinnl • Aug 27 '16
48 comments sorted by
View all comments
13
If the input to a function always is random, then the input is never the same - or am I missing something here?
1 u/ChronoChris Aug 27 '16 assignment and calculation of the Math.random should be done when you instantiate math.random to the variable. It shouldn't be every time the multiplication is ran on the variable.
1
assignment and calculation of the Math.random should be done when you instantiate math.random to the variable. It shouldn't be every time the multiplication is ran on the variable.
13
u/reeferd Aug 27 '16
If the input to a function always is random, then the input is never the same - or am I missing something here?