{"ScriptPreparationCode":null,"TestCases":[{"Name":"substring \u0026 array result","Code":"const object = {\u0027key1\u0027: \u0027value1\u0027, \u0027key2\u0027: \u0027value2\u0027, \u0027key1 variant\u0027: \u0027value1 variant\u0027}\r\nconst result = []\r\nconst key=\u0027key1 variant\u0027\r\n for (let i = 0; i \u003C= key?.length; i\u002B\u002B) {\r\n if (key[i] === \u0027 \u0027 || i === key.length) {\r\n const current = key.substring(0, i)\r\n if (object[current]) {\r\n result.push(object[current])\r\n }\r\n }\r\n }\r\n const final = result.join(\u0027 \u0027)","IsDeferred":false},{"Name":"string builder \u0026 array result","Code":"const object = {\u0027key1\u0027: \u0027value1\u0027, \u0027key2\u0027: \u0027value2\u0027, \u0027key1 variant\u0027: \u0027value1 variant\u0027}\r\nconst result = []\r\nconst key=\u0027key1 variant\u0027\r\nlet current = \u0027\u0027\r\n for (let i = 0; i \u003C= key?.length; i\u002B\u002B) {\r\n current \u002B= key[i]\r\n if (key[i] === \u0027 \u0027 || i === key.length) {\r\n if (object[current]) {\r\n result.push(object[current])\r\n }\r\n }\r\n }\r\n const final = result.join(\u0027 \u0027)","IsDeferred":false},{"Name":"substring \u0026 string result","Code":"const object = {\u0027key1\u0027: \u0027value1\u0027, \u0027key2\u0027: \u0027value2\u0027, \u0027key1 variant\u0027: \u0027value1 variant\u0027}\r\nlet result = \u0027\u0027\r\nconst key=\u0027key1 variant\u0027\r\n for (let i = 0; i \u003C= key?.length; i\u002B\u002B) {\r\n if (key[i] === \u0027 \u0027 || i === key.length) {\r\n const current = key.substring(0, i)\r\n if (object[current]) {\r\n result \u002B= \u0027 \u0027 \u002B object[current]\r\n }\r\n }\r\n }","IsDeferred":false},{"Name":"string builder \u0026 string result","Code":"const object = {\u0027key1\u0027: \u0027value1\u0027, \u0027key2\u0027: \u0027value2\u0027, \u0027key1 variant\u0027: \u0027value1 variant\u0027}\r\nlet result = \u0027\u0027\r\nconst key=\u0027key1 variant\u0027\r\nlet current = \u0027\u0027\r\n for (let i = 0; i \u003C= key?.length; i\u002B\u002B) {\r\n current \u002B= key[i]\r\n if (key[i] === \u0027 \u0027 || i === key.length) {\r\n if (object[current]) {\r\n result \u002B= \u0027 \u0027 \u002B object[current]\r\n }\r\n }\r\n }","IsDeferred":false},{"Name":"substring \u0026 string result using concatenate","Code":"const object = {\u0027key1\u0027: \u0027value1\u0027, \u0027key2\u0027: \u0027value2\u0027, \u0027key1 variant\u0027: \u0027value1 variant\u0027}\r\nlet result = \u0027\u0027\r\nconst key=\u0027key1 variant\u0027\r\n for (let i = 0; i \u003C= key?.length; i\u002B\u002B) {\r\n if (key[i] === \u0027 \u0027 || i === key.length) {\r\n const current = key.substring(0, i)\r\n if (object[current]) {\r\n result = result.concat(\u0027 \u0027, object[current])\r\n }\r\n }\r\n }","IsDeferred":false}]}