You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@lightnguyen not sure, but I added this test case and it seems to work as expected?
it("filters out things as expected when returning empty array",function(){vararray=Immutable(["drop the numbers!",3,2,1,0,null,undefined]);varexpected=Immutable(["drop the numbers!",null,undefined]);varactual=Immutable.flatMap(array,function(value){if(typeofvalue==="number"){return[];}else{returnvalue;}});TestUtils.assertJsonEqual(actual,expected);});
Looks like you expecte immutable variable 'array' is ["drop the numbers!", 3, 2, 1, 0, null, undefined]. This is not right. You need a another variable to take the return of Immutable.flatMap
I tried this example in the docs and the returned array isn't changed at all
I'm using seamless-immutable v7.1.4. Is this a bug or am I doing anything wrong?
The text was updated successfully, but these errors were encountered: