We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.last()
.filter()
undefined
Hi!
Just starting with immutable-js, so please let me know if I'm missing something simple.
immutable-js
I would have expected the following node snippet to return 3:
node
3
var Immutable = require( "immutable" ); Immutable.Vector( 1, 2, 3, 4 ) .filter( function( x ) { return x === 3; } ) .last(); // undefined
It returns undefined. Is this due to the lazy nature of sequences?
If I use toVector() in the chain, it returns 3 as expected.
toVector()
var Immutable = require( "immutable" ); Immutable.Vector( 1, 2, 3, 4 ) .filter( function( x ) { return x === 3; } ) .toVector() .last(); // 3
The text was updated successfully, but these errors were encountered:
Solved in 9e63cc0 - will be on npm soon
Sorry, something went wrong.
Thanks again for the report!
That's awesome—thanks!
No branches or pull requests
Hi!
Just starting with
immutable-js
, so please let me know if I'm missing something simple.I would have expected the following
node
snippet to return3
:It returns
undefined
. Is this due to the lazy nature of sequences?If I use
toVector()
in the chain, it returns3
as expected.The text was updated successfully, but these errors were encountered: