{"ScriptPreparationCode":null,"TestCases":[{"Name":"Filter","Code":"const arr = [{key: \u0022a\u0022, value: 0},\r\n {key: \u0022b\u0022, value: 0},\r\n {key: \u0022c\u0022, value: 1},\r\n {key: \u0022d\u0022, value: 0},\r\n {key: \u0022e\u0022, value: 1},\r\n {key: \u0022f\u0022, value: 1},\r\n {key: \u0022g\u0022, value: 0},\r\n {key: \u0022h\u0022, value: 1},\r\n {key: \u0022i\u0022, value: 0},\r\n {key: \u0022j\u0022, value: 1}]\r\n\r\narr.filter(item =\u003E item.value === 1)","IsDeferred":false},{"Name":"Reduce","Code":"const arr = [{key: \u0022a\u0022, value: 0},\r\n {key: \u0022b\u0022, value: 0},\r\n {key: \u0022c\u0022, value: 1},\r\n {key: \u0022d\u0022, value: 0},\r\n {key: \u0022e\u0022, value: 1},\r\n {key: \u0022f\u0022, value: 1},\r\n {key: \u0022g\u0022, value: 0},\r\n {key: \u0022h\u0022, value: 1},\r\n {key: \u0022i\u0022, value: 0},\r\n {key: \u0022j\u0022, value: 1}]\r\n\r\narr.reduce((acc,item) =\u003E { \r\n if (item.value === 1)\r\n acc.push(item) \r\n return acc;\r\n}, [])","IsDeferred":false},{"Name":"Foreach","Code":"const arr = [{key: \u0022a\u0022, value: 0},\r\n {key: \u0022b\u0022, value: 0},\r\n {key: \u0022c\u0022, value: 1},\r\n {key: \u0022d\u0022, value: 0},\r\n {key: \u0022e\u0022, value: 1},\r\n {key: \u0022f\u0022, value: 1},\r\n {key: \u0022g\u0022, value: 0},\r\n {key: \u0022h\u0022, value: 1},\r\n {key: \u0022i\u0022, value: 0},\r\n {key: \u0022j\u0022, value: 1}]\r\n\r\nlet result = []\r\narr.forEach(item =\u003E {\r\n if (item.value === 1)\r\n result.push(item);\r\n})","IsDeferred":false}]}