{"ScriptPreparationCode":"const users = [\r\n {\r\n firstName: \u0022Jane\u0022,\r\n personal: {\r\n data: [\u0022single\u0022],\r\n otherData: {},\r\n },\r\n professional: {\r\n data: [\u0022bachelors\u0022],\r\n otherData: {years_of_edu:[15,17]},\r\n }\r\n },\r\n {\r\n firstName: \u0022John\u0022,\r\n personal: {\r\n data: [\u0022married\u0022],\r\n otherData: {},\r\n },\r\n professional: {\r\n data: [\u0022ged\u0022],\r\n otherData: {years_of_edu:[10,12]},\r\n }\r\n },\r\n {\r\n firstName: \u0022Mike\u0022,\r\n personal: {\r\n data: [\u0022single\u0022],\r\n otherData: {},\r\n },\r\n professional: {\r\n data: [\u0022bachelors\u0027\u0022],\r\n otherData: {years_of_edu:[15,17]},\r\n }\r\n },\r\n {\r\n firstName: \u0022Sam\u0022,\r\n personal: {\r\n data: [\u0022single\u0022],\r\n otherData: [],\r\n },\r\n professional: {\r\n data: [\u0022ged\u0022],\r\n otherData: {years_of_edu:[10,12]},\r\n }\r\n },\r\n]\r\n\r\n\r\nconst input = {\r\n personal:{\r\n data: [\u0022single\u0022],\r\n extra: {}\r\n },\r\n professional: {\r\n data: [\u0022bachelor\u0027s\u0022],\r\n extra: {years_of_edu:[10,12]}\r\n }\r\n}","TestCases":[{"Name":"filter","Code":"const usersData = users.filter(function(x) {\r\nfor (let item in input) {\r\n for(let items in input[item].extra) {\r\n if (input[item]?.data?.length \u003E 0) {\r\n if (x[item]?.data.includes(...input[item]?.data) \u0026\u0026\r\n x[item]?.otherData[items][0] \u003E= input[item]?.extra[items][0] \u0026\u0026 \r\n x[item]?.otherData[items][1] \u003C= input[item]?.extra[items][1]\r\n ) {\r\n return x\r\n }\r\n }\r\n }\r\n}\r\n}\r\n)","IsDeferred":false},{"Name":"for loop","Code":"const usersData = []\r\nfor (i=0; users.length \u003E i; i\u002B\u002B) {\r\nfor (let item in users[i]) {\r\n for(let items in users[i][item].extra) {\r\n if (input[item]?.data?.length \u003E 0) {\r\n if (x[item]?.data.includes(...input[item]?.data) \u0026\u0026\r\n x[item]?.otherData[items][0] \u003E= input[item]?.extra[items][0] \u0026\u0026 \r\n x[item]?.otherData[items][1] \u003C= input[item]?.extra[items][1]\r\n ) {\r\n usersData.push(users[i])\r\n }\r\n }\r\n }\r\n}\r\n}\r\n)","IsDeferred":false}]}