{"ScriptPreparationCode":"var obj = {foo: {bar: {tar: [1,2,3]}}};\r\n\r\nfunction _get(obj, path, defaultValue = undefined) {\r\n const fullPath = path.replace(/\\[/g, \u0027.\u0027).replace(/]/g, \u0027\u0027).split(\u0027.\u0027).filter(Boolean);\r\n\r\n return fullPath.every(everyFunc) ? obj : defaultValue;\r\n\r\n function everyFunc(step) {\r\n return !(step \u0026\u0026 (obj = obj[step]) === undefined);\r\n }\r\n}\r\n","TestCases":[{"Name":"ramda path","Code":"R.path([\u0027foo\u0027, \u0027bar\u0027, \u0027tar\u0027, 2], obj)","IsDeferred":false},{"Name":"lodash get","Code":"_.get(obj, \u0027foo.bar.tar.2\u0027)","IsDeferred":false},{"Name":"custom get","Code":"_get(obj, \u0027foo.bar.tar.2\u0027)","IsDeferred":false}]}