let x = [Math.random(), Math.random(), Math.random(), Math.random()];
This is not the same as his example. Here, you have a set of random values that you keep changing. In Staltz's example, he has a set pointing to the random function.
Right, but you're not addressing the same point the author is making. If you pass in the functionMath.random, the method should always return the same value. In the case for a function f(x,y) that sums x, y, the returned value should be 0 if either x or y are non-numbers.
In your example you're simply passing in different numeric values for x,y,....
3
u/hahaNodeJS Aug 28 '16
This is not the same as his example. Here, you have a set of random values that you keep changing. In Staltz's example, he has a set pointing to the random function.