From 86b8c7f899b1a53875eb22c5da377c275fbe86b0 Mon Sep 17 00:00:00 2001 From: Magnus Ulimoen Date: Sun, 7 Apr 2019 22:13:09 +0200 Subject: [PATCH] use stricter js --- main.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.js b/main.js index df30c8e..c5ac8ba 100644 --- a/main.js +++ b/main.js @@ -1,3 +1,5 @@ +"use strict"; + main(); function main() { @@ -81,15 +83,14 @@ function main() { const width = 4; const height = 5; const field = new Uint8Array(width*height); - for (var i = 0; i < height; i += 1) { - for (var j = 0; j < width; j += 1) { + for (let i = 0; i < height; i += 1) { + for (let j = 0; j < width; j += 1) { // Each bin is the same size when +1 // 0.1, 0.9, 1.0, ..., 255.0, 255.9, 256.0 // |------|, ,|-----------|, |--RNG stops here--| field[i*width + j] = Math.floor(Math.random() * (255 + 1)); } } - console.log(field); const texture = gl.createTexture(); {