{"ScriptPreparationCode":"var data = Array(1000000).fill({ a: [{ bar: { c: 3 } }] });\r\n\r\nvar newGet = (obj, path, defValue) =\u003E {\r\n // If path is not defined or it has false value\r\n if (!path) return undefined\r\n // Check if path is string or array. Regex : ensure that we do not have \u0027.\u0027 and brackets.\r\n // Regex explained: https://regexr.com/58j0k\r\n const pathArray = Array.isArray(path) ? path : path.match(/([^[.\\]])\u002B/g)\r\n // Find value\r\n const result = pathArray.reduce((prevObj, key) =\u003E prevObj \u0026\u0026 prevObj[key], obj)\r\n // If found value is undefined return default value; otherwise return the value\r\n return result === undefined ? defValue : result\r\n}","TestCases":[{"Name":"Lodash Get with string","Code":"_.get(data, \u0027a[0].bar.c\u0027)","IsDeferred":false},{"Name":"Native Get with String","Code":"newGet(data, \u0027a[0].bar.c\u0027)","IsDeferred":false},{"Name":"Lodash Get with Array","Code":"_.get(data, [\u0027a\u0027, \u00270\u0027, \u0027bar\u0027, \u0027c\u0027])","IsDeferred":false},{"Name":"Native Get with Array","Code":"newGet(data, [\u0027a\u0027, \u00270\u0027, \u0027bar\u0027, \u0027c\u0027])","IsDeferred":false}]}