{"ScriptPreparationCode":"var str = \u0027style\u0027;\r\nvar obj = {\r\n \t \u0027style-2\u0027: true,\r\n \t \u0027style-3\u0027: false,\r\n \t \u0027style-4\u0027: true,\r\n}\r\nvar arr = [\u0027style-5\u0027, \u0027style-6\u0027]\r\n","TestCases":[{"Name":"classnames","Code":"let result = window.classNames(str, obj, arr, \u0027test classname\u0027)","IsDeferred":false},{"Name":"clsx","Code":"let result = window.clsx(str, obj, arr, \u0027test classname\u0027)","IsDeferred":false},{"Name":"My attempt using templateLiterals","Code":"const classname = (...args) =\u003E {\r\n let joined = \u0022\u0022;\r\n args.forEach((arg) =\u003E {\r\n if (!arg || typeof arg === \u0027boolean\u0027) {\r\n return;\r\n }\r\n if (typeof arg === \u0022string\u0022) {\r\n joined \u002B= \u0060 ${arg} \u0060;\r\n } else if (typeof arg === \u0022object\u0022) {\r\n if (arg?.join) {\r\n joined \u002B= arg.filter((v) =\u003E !!v).join(\u0022 \u0022);\r\n } else {\r\n const keys = Object.keys(arg);\r\n keys.forEach(key =\u003E {\r\n if(!!arg[key]){\r\n joined \u002B= \u0060 ${key} \u0060\r\n }\r\n })\r\n }\r\n }\r\n });\r\n\r\n return joined;\r\n};\r\n\r\nlet result = classname(str, obj, arr, \u0027test classname\u0027)","IsDeferred":false}]}