{"ScriptPreparationCode":"var placeHolderElem = document.createElement(\u0027div\u0027);\r\nplaceHolderElem.id = \u0022PlaceHolder\u0022;\r\ndocument.body.append(placeHolderElem);\r\nvar placeHolder = document.querySelector(\u0027#PlaceHolder\u0027);\r\nvar isEnabled = true;\r\nvar itemList = [1, 2, 3, 4];","TestCases":[{"Name":"Template String","Code":"const subTemplate = (item) =\u003E \u0060\u003Cli\u003E${item}\u003C/li\u003E\u0060;\r\nconst template = \u0060\u003Cdiv class=\u0022container\u0022\u003E\r\n ${isEnabled ? \u0027Enabled\u0027 : \u0027Disabled\u0027}\r\n \u003Cul\u003E${(()=\u003E { var output = \u0027\u0027; itemList.forEach((item) =\u003E{ output \u002B= subTemplate(item) }); return output})()}\u003C/ul\u003E\r\n\u003C/div\u003E\u0060;\r\nplaceHolder.innerHTML = template;","IsDeferred":false},{"Name":"Template Function","Code":"const templateFunction = function (obj) {\r\n obj || (obj = {});\r\n var __t, __p = \u0027\u0027, __j = Array.prototype.join;\r\n function print() { __p \u002B= __j.call(arguments, \u0027\u0027) }\r\n with (obj) {\r\n __p \u002B= \u0027\u003Cdiv class=\u0022container\u0022\u003E\\r\\n \u0027 \u002B\r\n ((__t = (isEnabled ? \u0027Enabled\u0027 : \u0027Disabled\u0027)) == null ? \u0027\u0027 : __t) \u002B\r\n \u0027\\r\\n \u003Cul\u003E\\r\\n \u0027;\r\n itemList.forEach((item) =\u003E {\r\n ;\r\n __p \u002B= \u0027\\r\\n \u003Cli\u003E\u0027 \u002B\r\n ((__t = (item)) == null ? \u0027\u0027 : __t) \u002B\r\n \u0027\u003C/li\u003E\\r\\n \u0027;\r\n });\r\n __p \u002B= \u0027\\r\\n \u003C/ul\u003E\\r\\n\u003C/div\u003E\u0027;\r\n\r\n }\r\n return __p;\r\n}\r\nplaceHolder.innerHTML = templateFunction({ isEnabled });","IsDeferred":false},{"Name":"Template String Map","Code":"const subTemplate = (item) =\u003E \u0060\u003Cli\u003E${item}\u003C/li\u003E\u0060;\r\nconst template = \u0060\u003Cdiv class=\u0022container\u0022\u003E\r\n ${isEnabled ? \u0027Enabled\u0027 : \u0027Disabled\u0027}\r\n \u003Cul\u003E${itemList.map(subTemplate).join(\u0027\u0027)}\u003C/ul\u003E\r\n\u003C/div\u003E\u0060;\r\nplaceHolder.innerHTML = template;","IsDeferred":false},{"Name":"Template String Map Inside","Code":"const template = \u0060\u003Cdiv class=\u0022container\u0022\u003E\r\n ${isEnabled ? \u0027Enabled\u0027 : \u0027Disabled\u0027}\r\n \u003Cul\u003E${itemList.map((item)=\u003E\u0060\u003Cli\u003E${item}\u003C/li\u003E\u0060).join(\u0027\u0027)}\u003C/ul\u003E\r\n\u003C/div\u003E\u0060;\r\nplaceHolder.innerHTML = template;","IsDeferred":false}]}