{"ScriptPreparationCode":null,"TestCases":[{"Name":"Extend prototype","Code":"String.prototype.toBinary = function () {\r\n let output = \u0027\u0027;\r\n for (let i = 0; i \u003C this.length; i\u002B\u002B) {\r\n output \u002B= this[i].charCodeAt(0).toString(2) \u002B \u0022 \u0022;\r\n }\r\n \r\n return output;\r\n}\r\n\r\nString.prototype.toHex = function () {\r\n let output = \u0027\u0027;\r\n for (let i = 0; i \u003C this.length; i\u002B\u002B) {\r\n output \u002B= this[i].charCodeAt(0).toString(8) \u002B \u0022 \u0022;\r\n }\r\n \r\n return output;\r\n}\r\n\r\nfor (let i = 0; i \u003C 1000; i\u002B\u002B) {\r\n let t = new String(\u0022test\u0022);\r\n console.log(t.toString(), t.toBinary(), t.toHex());\r\n}","IsDeferred":false},{"Name":"Object.assign","Code":"Object.assign(String.prototype, {\r\n toBinary() {\r\n let output = \u0027\u0027;\r\n for (let i = 0; i \u003C this.length; i\u002B\u002B) {\r\n output \u002B= this[i].charCodeAt(0).toString(2) \u002B \u0022 \u0022;\r\n }\r\n\r\n return output;\r\n },\r\n toHex() {\r\n let output = \u0027\u0027;\r\n for (let i = 0; i \u003C this.length; i\u002B\u002B) {\r\n output \u002B= this[i].charCodeAt(0).toString(8) \u002B \u0022 \u0022;\r\n }\r\n\r\n return output;\r\n }\r\n});\r\n\r\nfor (let i = 0; i \u003C 1000; i\u002B\u002B) {\r\n let t = new String(\u0022test\u0022);\r\n console.log(t.toString(), t.toBinary(), t.toHex());\r\n}","IsDeferred":false}]}