Use of higher-order functions not being taught
See original GitHub issueChallenge Name
Higher-order functions challenges, e.g. https://www.freecodecamp.com/challenges/filter-arrays-with-filter
Issue Description
The code in the screenshot below lets the learner pass the challenge simply by reading “create a new array with all the values from oldArray which are less than 6”, seeing val !== 5
and changing it to val < 6
, without having to understand that the higher-order function is passing each of the array’s elements to the callback function (as val
), and the syntax for that. I’ve helped a learner on Gitter with this lack of knowledge, which prompted me to create this issue.
I suggest the callback function is changed to /* your function here */
.
Screenshot
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Higher order functions, how, why and what not to do.
Higher order functions are powerful and of course (the cliche) with great power comes great responsibility. As the documentation says: A high-order function...
Read more >When should I use higher order functions? - Quora
Higher-order functions let us cleanly abstract over control flow. This is so useful that it transcends functional programming—modern imperative languages, ...
Read more >Higher Order Functions (Composing Software) | by Eric Elliott
A higher order function is a function that takes a function as an argument, or returns a function. Higher order function is in...
Read more >Higher-Order Functions :: Eloquent JavaScript
Higher-order functions allow us to abstract over actions, not just values. They come in several forms. For example, we can have functions that...
Read more >What are some interesting uses of higher-order functions?
The workaround is to create a class with methods and pass in an element of the class in as an argument, as a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @willnwhite
The issue tracker is for reporting bugs only. If this is a request for help with a challenge, please use the help chat room or try looking through the forum for help with a specific challenge.
If this is the case, please close this issue.
Happy Coding.
– Automated response by Var.CI 🤖
Hi @no-stack-dub-sack. The Contributor’s Guide is worded as though the reader was looking to work on an issue they hadn’t raised themselves: “Find an issue that needs assistance by searching for the Help Wanted tag.” So I didn’t think about that as I didn’t think it was intended for me. I’m happy to propose a change to the wording.
As we’ve both spent time finding out for ourselves, the issue doesn’t apply in the development version of the website. I hope having two versions of the website will be avoided in future, to minimise hurdles for more casual contributions. I’ve raised this on the discussion forum: https://forum.freecodecamp.com/t/have-one-single-version-of-fcc-not-a-beta-too/117837.
For interest’s sake, I suggested the example be:
The answerer has to learn how to write a callback function for a higher-order function, where presently they can skip that (and end up in the chat room).