Comments (2)
Yes there seems to be a bug in exercise 20. It passes if you run it in the website but if you run it externally it will give you an error where that last .map() is.
from learnrx.
CC: You can probably close this as a duplicate of #44 @morenoh149.
Good catch! It seems like a bug if you run reduce(...).map
outside of the site but this is actually intentional. In Exercise 16 we write our own implementation of Array.prototype.reduce
that returns the result in an Array
. It has this little note:
Let's add a reduce() function to the Array type. Like map. Take note this is different from the reduce in ES5, which returns a value instead of an Array!
I found it confusing too. This was an intentional design choice that is discussed in #44. I'd summarize #44 by saying "we" decided to use the modified version of Array.prototype.reduce
that returns an Array
because it is similar to Observable.prototype.reduce
returning an Observable
. It's "more clear" to chain calls like reduce().map
then it is to explain why the result types are different. (Personally I disagree with this approach. It'd be straightforward to explain we need to return an Array so we can chain the calls. 🤷♂️ )
from learnrx.
Related Issues (20)
- Exercise 38 pre correction
- Typos in exercises 16 and 13 HOT 2
- Revise lesson 36 and onward for the RxJS 5 API HOT 5
- Tutorials / Exercises for monads
- Exercise 29 - Wrong explanation HOT 7
- Reduce implementation on exercise 16 is wrong HOT 1
- Order of keys matters HOT 1
- Exercise 23 - broken? HOT 3
- Porting the exercises to codewars.com HOT 4
- Debugging
- rx library implementation? HOT 3
- exercise 3 and onwards broken HOT 3
- exercise 8 fails opening new exercise although the correct answer was submitted. HOT 2
- Enhancement - Any interest in a helper function to show exercise by number?
- Bug - Exercise 37 does not show a movie list HOT 1
- Exercise 26 another way
- Exercise 21 "Before" seems wrong
- Inserting braces cause dramatic indentation
- debounceTime is better for the autocomplete example
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from learnrx.