{"ScriptPreparationCode":"function executePromises() {\r\n const vals = [];\r\n Promise.resolve(1)\r\n .then((val) =\u003E {\r\n vals.push(val);\r\n return Promise.resolve(2);\r\n })\r\n .then((val) =\u003E {\r\n vals.push(val);\r\n return Promise.resolve(3);\r\n })\r\n .then((val) =\u003E {\r\n vals.push(val);\r\n return Promise.resolve(4);\r\n })\r\n .then((val) =\u003E {\r\n vals.push(val);\r\n return Promise.resolve(5);\r\n })\r\n .then((val) =\u003E {\r\n vals.push(val);\r\n return Promise.resolve(6);\r\n })\r\n .then((val) =\u003E {\r\n vals.push(val);\r\n console.log(vals);\r\n });\r\n}\r\n\r\nfunction executePromises2() {\r\n const vals = [];\r\n Promise.resolve(1)\r\n .then((val) =\u003E {\r\n vals.push(val);\r\n return 2;\r\n })\r\n .then((val) =\u003E {\r\n vals.push(val);\r\n return 3;\r\n })\r\n .then((val) =\u003E {\r\n vals.push(val);\r\n return 4;\r\n })\r\n .then((val) =\u003E {\r\n vals.push(val);\r\n return 5;\r\n })\r\n .then((val) =\u003E {\r\n vals.push(val);\r\n return 6;\r\n })\r\n .then((val) =\u003E {\r\n vals.push(val);\r\n console.log(vals);\r\n });\r\n}\r\n\r\nasync function executeAwaits() {\r\n const vals = [];\r\n vals.push(await Promise.resolve(1));\r\n vals.push(await Promise.resolve(2));\r\n vals.push(await Promise.resolve(3));\r\n vals.push(await Promise.resolve(4));\r\n vals.push(await Promise.resolve(5));\r\n vals.push(await Promise.resolve(6));\r\n console.log(vals);\r\n}\r\n\r\nfunction executePromiseAll() {\r\n Promise.all([Promise.resolve(1), Promise.resolve(2), Promise.resolve(3), Promise.resolve(4), Promise.resolve(5), Promise.resolve(6)]).then(\r\n (vals, rej) =\u003E {\r\n console.log(vals);\r\n }\r\n );\r\n}\r\n","TestCases":[{"Name":"Promise Chain","Code":"executePromises();","IsDeferred":false},{"Name":"Async Await","Code":"executeAwaits();","IsDeferred":false},{"Name":"Promise.all","Code":"executePromiseAll();","IsDeferred":false},{"Name":"Promise Chain normal","Code":"executePromises2();","IsDeferred":false}]}