question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use of higher-order functions not being taught

See original GitHub issue

Challenge 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

screen shot 2017-05-18 at 12 47 56

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
VarCI-botcommented, May 18, 2017

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 🤖

0reactions
willnwhitecommented, May 22, 2017

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:

array = array.filter(/* your function here */);

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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found