Skip to content
New issue

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

Object Oriented and Functional Programming DESPERATELY needs rewrite! #9403

Closed
manicmarvin opened this issue Jun 27, 2016 · 5 comments
Closed
Labels
first timers only Open for anyone doing contributions for first time. You do not need permission to work on these. help wanted Open for all. You do not need permission to work on these.

Comments

@manicmarvin
Copy link

Challenge Iterate over Arrays with map has an issue.

The description of this waypoint is completely inadequate. It reads:

The map method is a convenient way to iterate through arrays. Here's an example usage:

var timesFour = oldArray.map(function(val){
 return val * 4;
});

The map method will iterate through every element of the array, creating a new array with values that have been modified by the callback function, and return it. Note that it does not modify the original array.

In our example the callback only uses the value of the array element (the val argument) but your callback can also include arguments for the index and array being acted on.

It does not really explain the syntax, what results the map method produces and requires readers to speak CSspeak and decipher many implicit unstated things.

I am struggling to understand anything in the section Object Oriented and Functional Programming, not because the concepts are difficult but because the lessons are poorly constructed. I'm referring to Crockford, Eloquent JS and Codeacademy to provide information written in a manner that I can understand.

Forgive my shortness, I just hope that my suggestion that this need a rewrite is taken up.

@raisedadead
Copy link
Member

/cc @FreeCodeCamp/issue-moderators

Again as mentioned in #9404 we could have supplementary MDN links however let's see how this can be re-written?

@raisedadead raisedadead added help wanted Open for all. You do not need permission to work on these. status: discussing Under discussion threads. Closed as stale after 60 days of inactivity. labels Jun 27, 2016
@heldersepu
Copy link
Contributor

I think that the challenge is clear enough
...and at this point we should be familiar with the Read-Search-Ask

@BerkeleyTrue BerkeleyTrue removed the help wanted Open for all. You do not need permission to work on these. label Jun 27, 2016
@erictleung
Copy link
Member

erictleung commented Jul 4, 2016

@manicmarvin thanks for the feedback. Maybe we can expand the example code a bit to show what the oldArray is and what the .map function returns.

var oldArray = [1, 2, 3];
var timesFour = oldArray.map(function(val){
  return val * 4;
});
console.log(timesFour); // returns [4, 8, 12]
console.log(oldArray);  // returns [1, 2, 3]

This line needs to be changed to

"<blockquote>var oldArray = [1, 2, 3];<br>var timesFour = oldArray.map(function(val){<br>&nbsp;&nbsp;return val * 4;<br>});<br>console.log(timesFour); // returns [4, 8, 12]<br>console.log(oldArray);  // returns [1, 2, 3]</blockquote>",

What these changes should look like

image

To contributors, please first read the contributing guidelines before taking care of this issue. And feel free to visit the Contributors Help chat room if you have any questions about helping. We're there to help.

@manicmarvin
Copy link
Author

@erictleung That's super clear! Thank you.

@erictleung erictleung added help wanted Open for all. You do not need permission to work on these. first timers only Open for anyone doing contributions for first time. You do not need permission to work on these. and removed status: discussing Under discussion threads. Closed as stale after 60 days of inactivity. labels Jul 4, 2016
@dhcodes
Copy link
Contributor

dhcodes commented Jul 4, 2016

I'll take this one as my first potential commit if that's okay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first timers only Open for anyone doing contributions for first time. You do not need permission to work on these. help wanted Open for all. You do not need permission to work on these.
Projects
None yet
Development

No branches or pull requests

6 participants