{"ScriptPreparationCode":null,"TestCases":[{"Name":"obj and array methods","Code":"const FACET_PRIORITY = [\u0027trim\u0027, \u0027body\u0027, \u0027color\u0027, \u0027fueltype\u0027, \u0027cc\u0027, \u0027gearbox\u0027, \u0027seats\u0027, \u0027doors\u0027];\r\nconst descriptorParts = {\r\n trim: \u0027S Line\u0027,\r\n color: \u0027beiges\u0027,\r\n doors: \u00275 door\u0027\r\n};\r\nconst descriptorOrdered = [\u0027audi A1\u0027];\r\n\r\nconst sortedExtraFacets = Object.keys(descriptorParts)\r\n .sort((a, b) =\u003E FACET_PRIORITY.indexOf(a) - FACET_PRIORITY.indexOf(b))\r\n .map((key) =\u003E descriptorParts[key]);\r\n\r\nreturn [...descriptorOrdered,...sortedExtraFacets];","IsDeferred":false},{"Name":"old school","Code":"const FACET_PRIORITY = [\u0027trim\u0027, \u0027body\u0027, \u0027color\u0027, \u0027fueltype\u0027, \u0027cc\u0027, \u0027gearbox\u0027, \u0027seats\u0027, \u0027doors\u0027];\r\nconst descriptorParts = {\r\n trim: \u0027S Line\u0027,\r\n color: \u0027beiges\u0027,\r\n doors: \u00275 door\u0027\r\n};\r\nconst descriptorOrdered = [\u0027audi A1\u0027];\r\n\r\nfor (const facetKey of FACET_PRIORITY) {\r\n if (descriptorParts[facetKey]) {\r\n descriptorOrdered.push(descriptorParts[facetKey]);\r\n }\r\n }\r\n\r\nreturn descriptorOrdered;","IsDeferred":false}]}