From 133e0f21069817788696a27895de118ad87abcd6 Mon Sep 17 00:00:00 2001 From: Ildar Shaimordanov Date: Sun, 30 Oct 2022 11:07:55 +0300 Subject: [PATCH] cosmetic change: follow the author code style --- json2.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/json2.js b/json2.js index 9bc78eb..adac444 100644 --- a/json2.js +++ b/json2.js @@ -244,7 +244,8 @@ if (typeof JSON !== "object") { // Emulate [].includes(). It's actual for old-fashioned JScript. function includes(array, value) { - for (var i = 0; i < array.length; i++) { + var i; + for (i = 0; i < array.length; i += 1) { if (value === array[i]) { return true; } @@ -320,7 +321,7 @@ if (typeof JSON !== "object") { // Check the value is not circular object. Otherwise throw TypeError. if (includes(seen, value)) { - throw new TypeError('Converting circular structure to JSON'); + throw new TypeError("Converting circular structure to JSON"); } // Keep the value for the further check on circular references.