{"ScriptPreparationCode":"\r\nfunction executePromises() {\r\n let 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\nasync function executeAwaits() {\r\n const val = await Promise.resolve(1);\r\n const val2 = await Promise.resolve(2);\r\n const val3 = await Promise.resolve(3);\r\n const val4 = await Promise.resolve(4);\r\n const val5 = await Promise.resolve(5);\r\n const val6 = await Promise.resolve(6);\r\n const vals = [val, val2, val3, val4, val5, val6];\r\n console.log(vals);\r\n}\r\n\r\nfunction executePromiseAll(){\r\n Promise.all([\r\n Promise.resolve(1),\r\n Promise.resolve(2),\r\n Promise.resolve(3),\r\n Promise.resolve(4),\r\n Promise.resolve(5),\r\n Promise.resolve(6)\r\n ]).then((vals, rej) =\u003E {\r\n console.log(vals);\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}]}