{"ScriptPreparationCode":null,"TestCases":[{"Name":"sort filter","Code":"//\r\nfilterFoo = (x) =\u003E x.action === \u0022BID\u0022;\r\nsortFoo = (a, b) =\u003E a.price - b.price;\r\nreduceFoo = (value, item) =\u003E {\r\n if (!(item.action === \u0022BID\u0022)) return value;\r\n return value \u003E= item?.price ? value : item?.price;\r\n}\r\n//\r\narr = [{\r\n price: 1000000000,\r\n action: \u0022ASK\u0022,\r\n symbol: \u0022BTC_IRT\u0022\r\n}, {\r\n price: 1000000,\r\n action: \u0022ASK\u0022,\r\n symbol: \u0022BTC_IRT\u0022\r\n}, {\r\n price: 111111,\r\n action: \u0022BID\u0022,\r\n symbol: \u0022BTC_IRT\u0022\r\n}, {\r\n price: 100000,\r\n action: \u0022BID\u0022,\r\n symbol: \u0022BTC_IRT\u0022\r\n}, {\r\n price: 11111,\r\n action: \u0022BID\u0022,\r\n symbol: \u0022BTC_IRT\u0022\r\n}, {\r\n price: 10000,\r\n action: \u0022BID\u0022,\r\n symbol: \u0022BTC_IRT\u0022\r\n}, {\r\n price: 1111,\r\n action: \u0022BID\u0022,\r\n symbol: \u0022BTC_IRT\u0022\r\n}, {\r\n price: 1000,\r\n action: \u0022BID\u0022,\r\n symbol: \u0022BTC_IRT\u0022\r\n}, {\r\n price: 100,\r\n action: \u0022BID\u0022,\r\n symbol: \u0022BTC_IRT\u0022\r\n}, {\r\n price: 1,\r\n action: \u0022BID\u0022,\r\n symbol: \u0022BTC_IRT\u0022\r\n}, {\r\n price: 11111,\r\n action: \u0022ASK\u0022,\r\n symbol: \u0022BTC_USDT\u0022\r\n}, {\r\n price: 25000,\r\n action: \u0022ASK\u0022,\r\n symbol: \u0022USDT_IRT\u0022\r\n}, {\r\n price: 11111,\r\n action: \u0022ASK\u0022,\r\n symbol: \u0022USDT_IRT\u0022\r\n}, {\r\n price: 10000,\r\n action: \u0022ASK\u0022,\r\n symbol: \u0022USDT_IRT\u0022\r\n}, {\r\n price: 1111,\r\n action: \u0022BID\u0022,\r\n symbol: \u0022USDT_IRT\u0022\r\n}]\r\n\r\n\r\narr.filter(filterFoo).sort(sortFoo);","IsDeferred":false},{"Name":"reduce","Code":"//\r\nfilterFoo = (x) =\u003E x.action === \u0022BID\u0022;\r\nsortFoo = (a, b) =\u003E a.price - b.price;\r\nreduceFoo = (value, item) =\u003E {\r\n if (!(item.action === \u0022BID\u0022)) return value;\r\n return value \u003E= item?.price ? value : item?.price;\r\n}\r\n//\r\narr = [{\r\n price: 1000000000,\r\n action: \u0022ASK\u0022,\r\n symbol: \u0022BTC_IRT\u0022\r\n}, {\r\n price: 1000000,\r\n action: \u0022ASK\u0022,\r\n symbol: \u0022BTC_IRT\u0022\r\n}, {\r\n price: 111111,\r\n action: \u0022BID\u0022,\r\n symbol: \u0022BTC_IRT\u0022\r\n}, {\r\n price: 100000,\r\n action: \u0022BID\u0022,\r\n symbol: \u0022BTC_IRT\u0022\r\n}, {\r\n price: 11111,\r\n action: \u0022BID\u0022,\r\n symbol: \u0022BTC_IRT\u0022\r\n}, {\r\n price: 10000,\r\n action: \u0022BID\u0022,\r\n symbol: \u0022BTC_IRT\u0022\r\n}, {\r\n price: 1111,\r\n action: \u0022BID\u0022,\r\n symbol: \u0022BTC_IRT\u0022\r\n}, {\r\n price: 1000,\r\n action: \u0022BID\u0022,\r\n symbol: \u0022BTC_IRT\u0022\r\n}, {\r\n price: 100,\r\n action: \u0022BID\u0022,\r\n symbol: \u0022BTC_IRT\u0022\r\n}, {\r\n price: 1,\r\n action: \u0022BID\u0022,\r\n symbol: \u0022BTC_IRT\u0022\r\n}, {\r\n price: 11111,\r\n action: \u0022ASK\u0022,\r\n symbol: \u0022BTC_USDT\u0022\r\n}, {\r\n price: 25000,\r\n action: \u0022ASK\u0022,\r\n symbol: \u0022USDT_IRT\u0022\r\n}, {\r\n price: 11111,\r\n action: \u0022ASK\u0022,\r\n symbol: \u0022USDT_IRT\u0022\r\n}, {\r\n price: 10000,\r\n action: \u0022ASK\u0022,\r\n symbol: \u0022USDT_IRT\u0022\r\n}, {\r\n price: 1111,\r\n action: \u0022BID\u0022,\r\n symbol: \u0022USDT_IRT\u0022\r\n}]\r\n\r\n\r\narr.reduce(reduceFoo);","IsDeferred":false}]}