Write Higher Order Arrow Functions (this challenge has an insane jump in what is asking you)

Write Higher Order Arrow Functions (this challenge has an insane jump in what is asking you)
0

#1

Tell us what’s happening:
This challenge is insane, suddenly asked to use 3 new methods, .map .filter and .reduce without teaching anything. At least the challenge could’ve been one at a time. There are some serious jumps in FCC challenges that are just badly placed.

Is there a good resource for this specific challenge? I am watching Travesty media for a tutorial but I’m finding it hard to follow and it’s more difficult to use within the context the challenge requires.

Your code so far


const realNumberArray = [4, 5.6, -9.8, 3.14, 42, 6, 8.34, -2];
const squareList = (arr) => {
  "use strict";
  // change code below this line




  const squaredIntegers = arr;




  // change code above this line
  return squaredIntegers;
};
// test your code
const squaredIntegers = squareList(realNumberArray);
console.log(squaredIntegers);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/write-higher-order-arrow-functions


#2

Possibly do it after you’ve done the functional programming section: that explains the concepts, and then this just becomes an introduction to using the arrow function syntax for map/filter callbacks


#3

So skip this? This is es6 section though right after Basic Javascript section, is that optimal or normal? I just came from html/css and that was very linear so I’m actually pretty jarred with how different JS is. Any insight on how to do things would be much appreciated.


#4

Looking at this, maybe I should leave es6 for the end right before the projects??


#5

This is just my personal opinion, but I think a the ES6 stuff should be part of the sections it relates to - all the other sections build up concepts one or two at a time per challenge, and build on one another. The ES6 challenges don’t, they just dump a load of concepts on learners that have not yet been introduced. Plus a fair % of the responses to threads like this one on the forum are just RTFM, which in this case seems unfair and counter to how the rest of FCC works.


#6

That’s what I’m doing right now (regarding RTFM), I see a term, I google it and study it as best as I can, but good lord christ almighty, this part was too much. Okay, I’ll try skipping es6 for now and heading on to other parts, maybe my flow with JS will improve. I also use other materials but FCC is my main one so when things like this happen, it can get really frustrating.


#7

I would suggest to

  1. Find out what the arrow function does (at least in my case)
  2. Find out what map does and play with the function for a bit
  3. Find out what filter does and play around with it for a bit
  4. Find out what reduce does and play around with it for a bit

Then break the problem down step by step.
Like how can you use these to extract what you want into a array.
Then how can you square the array without using for loops.

Programming is meant to be fun, if you are given 3 new functions to look at, see it as more fun!
To play with the functions create an array with numbers, create a new array by using these functions and the arrow method, I just tried some stuff out and got compiler errors but hey, it’s just compiler errors :smiley:
Oh and lots of prints, well in this case console.logs :stuck_out_tongue:


#8

thats happened to me too and i placed my issue here

, someone has to change this. :sweat_smile:

anyway while i don’t have the options of any other materials , i keeped searching for a basic information about array functions methods , and this art helped me.


#9

But is it really a logical flaw?

I mean how will you solve real life problems, since there isn’t any FCC to partially hold your hand there. FCC has given you the name of the functions to use, usually in real life you get a bunch of functions and it is your job to google it out or find the function definitions in the code of your company.
Functions pop up, you find out about them and if you can’t there are nice forums where people try to help you, like this forum or stack :slight_smile:


#10

I think many programmers forget how much relational knowledge and pattern recognition they required to understand problems at the beginning before you build up a mental mind map…or maybe that’s the way they were taught and that’s what programmers know. It’s not bad per say but I believe good scaffolding gets better results.

Also the wording on many of the challenges are poorly worded,but I say that coming from different professions, every profession has there own nomenclature. Just look at the title of a physics paper and a biology paper the descriptives are very different. Personally I wonder if I’ll ever get used to how programmers explain things.

Anyhoo I guess more theory is needed, you definitely should be reading some Javascript books alongside this course to understand the deep fundamentals. Another post expressed the same dismay in trying to tackle React.

I do think there should be additional challenges included as an offshoot that people can take if they so choose. That way when they run up against something that makes them realize they didn’t actually understand the concepts they can go back and do more…or is there a recommended resource that is posted somewhere for more content appropriate practice?

Sorry I’m very passionate about teaching :slight_smile:


#11

This doesn’t apply here unless you ignore the fact that FCC teaches these concepts. This is exactly what I meant by this:

If FCC did not teach these concepts, then what you say might be a valid reply.

A lack of explanation being something people should get used to because it reflects real life seems to miss the point of why people would want to come to a site to learn in the first place.


#12

It’s not just here, through my whole education almost all programming tasks were poorly worded. In real life, they will be even more poorly worded from what I have heard, because there you have customers telling you with vague words what they want :stuck_out_tongue:

Personally I wonder if I’ll ever get used to how programmers explain things.

I think you will get there, by now I have seen so many patterns and explanations, which made me develop some intuition of what they mean. You just have to code enough in any language, use google a lot and play. These are just pointers of how to proceed, every time you see a new function or pattern it will be tricky, but having a playful logical mindset and not giving up helps :slight_smile:


#13

FCC does a great job of teaching you many concepts, if some are partially missed that should be ok. FCC doesn’t leave you with nothing in this problem also, it gives you an example and 3 options for functions to test and play with.
To get some experience of how the real world operates intertwined with previous good FFC teaching might be good. Otherwise how will you operate in the real world if you are used to having every single detail explained?
The real world won’t change and that’s why the programmers playfulness and curiosity is key.


#14

Again, what you’re saying would hold more weight if there wasn’t an entire section of the curriculum that explains these concepts: https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/functional-programming

Saying RTFM for concepts a learner has had no exposure to, when they have only the most basic exposure to JS (and when those concepts are carefully explained layer in the course) isn’t helpful, the OP is complaining about this particular section


#15

Well I see your point, if there is a section dedicated to these types of questions then there should be a better logical arrangement.
But people feeling helpless because they haven’t seen a function, wondering how to solve it without the proper steps being explained isn’t a good attribute to keep around. Or?
Maybe there should be an information gathering section or module somewhere.


#16

Having a set label for people to put additional information in would be great. I youtube everything.On this question alone there must be at least 20 different videos with people explaining their thought process.


#17

I don’t expect hand holding and I don’t know when you last did the JS section of FCC or if you ever needed to but everything up to that point, including HTML and CSS never asked you to use tags that they didn’t introduce. Suddenly this challenge asks you to use 3 new functions of a particular set (higher order) which wasn’t explained (both what higher order is and what these new functions are) in a new format (arrow =>) and for some reason you think that this inconsistency within FCC’s teaching method itself doesn’t lead you to believe that maybe there’s more to this than a learner wanting hand holding?

In a real world environment as you refer to it, well, I don’t know why bring it up. I just finished the very first section of FCC’s javascript and its name is literally “basic javascript”. Maybe if I get to 70% of the course then what you are saying will apply better to me, but as of now I don’t understand how I’m supposed to understand concepts I have never encountered before and take that in stride or how I’m supposed to google keywords I don’t know.

I can google .map .reduce and .filter usages and I did. I googled and watch youtube videos and I’m doing my due diligence but it’s not like I just have to use them, I have to use them in a specific way and you seem to think that someone who just finished basic javascript (section) with no prior coding experience is suppose to just get that and anything that betrays that expectation is “hand holding”.


#18

Hey thanks for this resource! have you finished the es6 section yet?


#19

I did the HTML and CSS section and I have a good idea of the FCC pattern, I agree that there is a big jump in learning and I am now aware that there is a section that teaches you the concepts in detail. So they should lie in a different order so that people can learn easier. Also some things in JS are harder than in other languages I have noticed, while doing the JS section, it is mainly due to abstraction from trying to simplify function notation by introducing arrow notation.
I apologize for any bad feelings that my thoughts have caused, but I will still believe that getting stuck sometimes is good. Since it gives you an opportunity to be creative and play around a bit. Maybe not in this case but in some other case.


#20

I apologize as well man, thanks for taking the time to read this post. I just really can’t understand this stuff. I agree that getting stuck is good, you learn to deal with it and find what process works so you can get yourself unstuck, that’s the main reason I’m here, so I can continue with my study in the most effective way possible by asking more experienced people what courses of action is possible. Just this section, it’s really not good.