{"ScriptPreparationCode":"function compareEndsWith(val, comparator) {\r\n return val.endsWith(comparator)\r\n}\r\nfunction compareEndsWith2(val, comparator) {\r\n return val.endsWith(comparator, comparator.length)\r\n}\r\nfunction compareSliceMethod(val, comparator) {\r\n const thingToCompare = val.slice(-comparator.length)\r\n return thingToCompare === comparator\r\n}","TestCases":[{"Name":"endWith","Code":"const value = Math.random().toString().padEnd(20,\u00270\u0027);\r\nconst ending = \u0022asdf\u0022\r\ncompareEndsWith(value, ending)","IsDeferred":false},{"Name":"slice","Code":"const value = Math.random().toString().padEnd(20,\u00270\u0027);\r\nconst ending = \u0022asdf\u0022\r\ncompareSliceMethod(value, ending)","IsDeferred":false},{"Name":"endsWith2","Code":"const value = Math.random().toString().padEnd(20,\u00270\u0027);\r\nconst ending = \u0022asdf\u0022\r\ncompareEndsWith2(value, ending)","IsDeferred":false}]}