For some reason the Waypoint: Iterate over Arrays with map won't let me pass while JS bin gives me the correct results. Does anyone see what's wrong here? And what purpose does the var newArray = oldArray; serve?

Let's say you were writing a more complex piece of code, or part of a larger project, and didn't foresee that oldArray would be needed elsewhere. If you didn't put its value into newArray in order to work on it here, you could break or get unexpected results elsewhere.

thats becouse you need to actually save that to variable, as map method does not modify the array that it is used on. And you need to assign it in newArray, becouse function below what you can change expects result from variable newArray

@iccomq I have tried changing my return statement to return val < 6; I get the correct output but it is not correct according to what FCC is trying to teach me. What do mean by changing the callback function? I was thinking that the filtering should be done in the function and not in the return --- Im so confused now

@orkist so .filter is a method used on array, it takes an argument which is a function that compares each value and return those that are true, so return (comparison here) is either true or flalse for each element.

@mrguru2016 think about all that 'action' and 'alt' and 'id' as attributes you can add to a tag, you separate them with a space. so when you have <form action='blabla' alt='blabla' id='blabla'> you stick a notes that browser can read and associate them with element.

I just completed "2h Object Oriented and Functional Programming " 5. Waypoint: Make Object Properties Private ... I completed it. But, I don't understand it. Is there any way that I can get more explanation of this Waypoint?

Closures are functions that refer to independent (free) variables. In other words, the function defined in the closure 'remembers' the environment in which it was created.

functioninit(){
var name = "Mozilla"; // name is a local variable created by initfunctiondisplayName(){ // displayName() is the inner function, a closure
alert(name); // use variable declared in the parent function
}
displayName();
};
init();

The current context of execution. The context in which values and expressions are "visible," or can be referenced. If a variable or other expression is not "in the current scope," then it is unavailable for use. Scopes can also be layered in a hierarchy, so that child scopes have access to parent scopes, but not vice versa.

@iccomq lol. just checking how in depth it is. i know what it is. just not enough info about how to apply it. thinking about doing codeacademy and youtube videos and such before continuing on with the bonfires :smiley_cat:

@RoadtoMastery every so often when i complete a Waypoint and go to the next, everything is gone and i have to return to the list and go back to the one i just completed and try to move on again and then it picks everything up...

@jkidunot click on your fcc profile to see which waypoints you have completed. click on any of the completed ones and "see my solution" and see if the code is there. if not then this is a much bigger issue.

I'm working on one of the front end projects and i'm using this line of code to pass the article title and link but it is passing it multipe times into my html. Any assistance?? Here is the line of code $('.meta' + i).prepend("<a href='" + headline + "'>" + metaData + "</a>");

Explanation:

It can be quite complicated to understand what needs to be done. There is always many ways to do something when coding but regardless of the algorithm used, we have to create a program that does the following:

It has to add two numbers passed as parameters and return the sum.

It has to check if any of the numbers are actual numbers, otherwise return undefined and stop the program right there.

It has to check if it has one or two arguments passed. More re ignored.

If it has only one then it has to return a function that used that number and expects another one, to then add it.

When programming is there ever a logical explanation example: firstName[firstName.length - 1] chooses the last letter of first name. Is there a way to look at that code and know that IS what it is doing?

I guess I mean to say a logical explanation put into simple english haha

@mtbuck24 it's intuitive after a while. the characters in a string have an index position that starts at 0. So, a word that has a length of 8 will have an index range of 0 - 7. thus, word[word.length - 1] will always select the last character, or last element if you prefer

@huanzhaoca it's the magic of how sort works. if the result from the operation is negative, a is sorted before b. if it's 0, sort order remains unchanged, and if the result of the operation is positive, a is sorted after b

Im nearly there on this "Confirm the ending" bonfire but need a bit of guidance...Was successfully able to get nearly all tests to pass, except 2. It seems that anything that's pulling more than 2 characters and it suppose to return false blows up in my face.

I've been trying to play with the str.substr length but can't seem to get the exact results. A bit confused as to how to nail the arguments for substr and still have it pass for all tests.

I'm stuck at #163. I appear to have completed the code differently than the lesson intended me to but somehow ended up with the proper output. I thought I had hit all the right notes, but the debug is telling me I haven't hit any of them. Can someone help? I would super appreciate it :)

I'm on lesson 172 "Waypoint: Make Unique Objects by Passing Parameters to our Constructor" and while I continue to complete the lessons, I feel like I am more-so following the format of the given example rather than retaining what I am being taught. Should I be concerned about this? Any advice? Maybe upcoming lessons will build upon this and test my knowledge?

Hi all. I just completed "Bonfire: Title Case a Sentence" and was wondering. Is there a smooth way to do it without splitting the string into an array? The challenge brings up the question of mutability of strings in js, which I'm now a wee bit confused about.

Sorry guys, still stuck on the coin game even after reading the instructions over and over again. From what I understand, the variable 'flip' is pre-coded on the first line and generates a random number between 0 and 1. I'm supposed to return the string "heads" if flip = 0 and tails otherwise (If flip is 1) using if and else statements. So in the body of myFunction I tell the computer that if the variable flip === 0 then return string "heads" else return string "tails". Sorry if my question is really long winded, but I'm just trying to grasp everything so I really understand. I know the answer is probably going to be something simple.

@bjornkeyser Hi all I m tryibg to pass a code but it is refused even the one in Wiki Guides . So what is wrong here please : var gear = 100; // privatethis.getGear = function () { // publicreturn addUnit(speed);};this.setGear= function (){};

@raw1211 i mean yea, im talking to a lot of people behind avatars that i was really unfamiliar with a few days ago, still feels kinda shitty to tell someone you dont remember last conversation that well

@magsprescott don't do them to just get that green bubble to make you feel all warm inside :D The links provided in help section in exercise is a gold mine and will help you understand what yo are doing better. jQuery section is pretty short and depanding on what you want you may not need to dive deep into jQuery that deep. But that tip will keep being very relevant a little later on.

hey guys, i have a quick question, if i declare a variable globally and I make changes to it within a function, will accessing the global variable outside the function be the originally declared value or the modified one?

The current context of execution. The context in which values and expressions are "visible," or can be referenced. If a variable or other expression is not "in the current scope," then it is unavailable for use. Scopes can also be layered in a hierarchy, so that child scopes have access to parent scopes, but not vice versa.