{"ScriptPreparationCode":null,"TestCases":[{"Name":"Optional chaining","Code":"const dataObject = {some: {deep: {hidden: {value: 1}}}};\r\n\r\nfor (let temp, i = 0; i \u003C 1000; i \u002B=1) {\r\n temp = dataObject?.some?.deep?.hidden?.value;\r\n temp = dataObject?.some?.deep?.black?.magic;\r\n}","IsDeferred":false},{"Name":"Manual chaining","Code":"const dataObject = {some: {deep: {hidden: {value: 1}}}};\r\n\r\nfor (let temp, i = 0; i \u003C 1000; i \u002B=1) {\r\n temp = dataObject \u0026\u0026 dataObject.some \u0026\u0026 dataObject.some.deep \u0026\u0026 dataObject.some.deep.hidden \u0026\u0026 dataObject.some.deep.hidden.value;\r\n temp = dataObject \u0026\u0026 dataObject.some \u0026\u0026 dataObject.some.deep \u0026\u0026 dataObject.some.deep.black \u0026\u0026 dataObject.some.deep.black.magic;\r\n}","IsDeferred":false},{"Name":"Loop chaining","Code":"const dataObject = {some: {deep: {hidden: {value: 1}}}};\r\n\r\nfunction get(obj, steps) {\r\n let value = obj;\r\n for (let i = 0, l = steps.length; i \u003C l; i \u002B= 1) {\r\n if (value \u0026\u0026 steps[i] in value) {\r\n value = value[steps[i]];\r\n continue;\r\n }\r\n return undefined;\r\n }\r\n return value;\r\n}\r\n\r\nconst path1 = [\u0027dataObject\u0027, \u0027some\u0027, \u0027deep\u0027, \u0027hidden\u0027, \u0027value\u0027];\r\nconst path2 = [\u0027dataObject\u0027, \u0027some\u0027, \u0027deep\u0027, \u0027black\u0027, \u0027magic\u0027];\r\nfor (let temp, i = 0; i \u003C 1000; i \u002B=1) {\r\n temp = get(dataObject, path1);\r\n temp = get(dataObject, path2);\r\n}","IsDeferred":false},{"Name":"Try/Catch","Code":"const dataObject = {some: {deep: {hidden: {value: 1}}}};\r\n\r\nfor (let temp, i = 0; i \u003C 1000; i \u002B=1) {\r\n try {\r\n temp = dataObject.some.deep.hidden.value;\r\n temp = dataObject.some.deep.black.magic;\r\n } catch(e) {}\r\n}","IsDeferred":false}]}