From f8a2acd37ee49560624fe49a80911ee781ab1825 Mon Sep 17 00:00:00 2001 From: Itamar Held Date: Fri, 4 May 2018 17:13:55 +0300 Subject: [PATCH] fix randInRange to be inclusive of the upper bound --- ch11-code/mock-server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ch11-code/mock-server.js b/ch11-code/mock-server.js index 98b3adef..d6636daa 100644 --- a/ch11-code/mock-server.js +++ b/ch11-code/mock-server.js @@ -59,5 +59,5 @@ setTimeout( function randomStockUpdate(){ // !!SIDE EFFECTS!! function randInRange(min = 0,max = 1E9) { - return (Math.round(Math.random() * 1E4) % (max - min)) + min; + return (Math.round(Math.random() * 1E4) % (max - min + 1)) + min; }