From 1bfe04cbd6881060590ee59a7b5c28291f96ee39 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Sun, 13 May 2018 15:19:04 -0700 Subject: [PATCH] [Refactor] `parse`: only need to reassign the var once --- lib/parse.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/parse.js b/lib/parse.js index 8c9872ec..47570132 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -54,8 +54,7 @@ var parseObject = function (chain, val, options) { var root = chain[i]; if (root === '[]') { - obj = []; - obj = obj.concat(leaf); + obj = [].concat(leaf); } else { obj = options.plainObjects ? Object.create(null) : {}; var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;