These are chat archives for FreeCodeCamp/HelpJavaScript

30th
May 2017
Lenarey S. Torririt
@Lengzki
May 30 2017 00:02
I don't understand what to do, can you please help me?
wordBlanks("dog", "big", "ran", "quickly") should contain all of the passed in words separated by non-word characters (and any additional words in your madlib).
wordBlanks("cat", "little", "hit", "slowly") should contain all of the passed in words separated by non-word characters (and any additional words in your madlib).
You will need to use string operators to build a new string, result, using the provided variables: myNoun, myAdjective, myVerb, and myAdverb.
You will also need to use additional strings, which will not change, and must be in between all of the provided words. The output should be a complete sentence.
Code:
function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
var result = "";
// Your code below this line
// Your code above this line
return result;
}
// Change the words here to test your function
wordBlanks("dog", "big", "ran", "quickly");
Can you show me the syntax. Stuck here for days...
Ravi Kishore Thella
@ravikishorethella
May 30 2017 00:06
@Lengzki myNoun, myAdjective, myVerb, myAdverb are used to store words . concatenate these words with space beyween them
Joshua Small
@joshuaLoren
May 30 2017 00:07
Good evening, can anyone help me understand the following code: var arr = [
[1,2,3],
[4,5,6],
[7,8,9],
[[10,11,12], 13, 14]
];
arr[3]; // equals [[10,11,12], 13, 14]
arr[3][0]; // equals [10,11,12]
arr[3][0][1]; // equals 11
Nick Gray
@nicholasnbg
May 30 2017 00:08
@Lengzki make a sentance using the arguments, so result = "my " + myNoun etc
Ravi Kishore Thella
@ravikishorethella
May 30 2017 00:08
@joshuaLoren the count starts from 0. so in the array arr the element at index 0 is [1,2,3] at index 1 is [4,5,6] so..on
Joshua Small
@joshuaLoren
May 30 2017 00:10
@ravikishorethella thanks so arr[3] equals [[10,11,12], 13, 14]. I understand that at [3] we have [10,11,12] but why does it include 13, 14]?
CamperBot
@camperbot
May 30 2017 00:10
joshualoren sends brownie points to @ravikishorethella :sparkles: :thumbsup: :sparkles:
:cookie: 317 | @ravikishorethella |http://www.freecodecamp.com/ravikishorethella
Ravi Kishore Thella
@ravikishorethella
May 30 2017 00:11
@joshuaLoren arr[0] = [1,2,3]
arr[3] = [[10,11,12], 13, 14]
arr[3][0] = first element in the arr[3]; so it gives [10,11,12]
Proconsul
@proconsu1
May 30 2017 00:11
hello, all
Joseph
@revisualize
May 30 2017 00:12
hello.
Joshua Small
@joshuaLoren
May 30 2017 00:12
Got it. Thank you @ravikishorethella
CamperBot
@camperbot
May 30 2017 00:12
joshualoren sends brownie points to @ravikishorethella :sparkles: :thumbsup: :sparkles:
:warning: joshualoren already gave ravikishorethella points
Joseph
@revisualize
May 30 2017 00:13
@joshuaLoren
var myArray = [[1,2,3], [4,5,6], [7,8,9], [[10,11,12], 13, 14]];
myArray[0] is [1,2,3]
myArray[0][0] is 1
myArray[0][1] is 2
myArray[1] is [4,5,6]
myArray[1][1] is 5
myArray[2] is [7,8,9]
myArray[2][0] is 7
myArray[3] is [[10,11,12], 13, 14]
myArray[3][0] is [10,11,12]
myArray[3][0][1] is 11
myArray[3][1] is 13
Ravi Kishore Thella
@ravikishorethella
May 30 2017 00:13
@joshuaLoren :thumbsup:
Joshua Small
@joshuaLoren
May 30 2017 00:13
@revisualize Thanks
CamperBot
@camperbot
May 30 2017 00:13
joshualoren sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 4042 | @revisualize |http://www.freecodecamp.com/revisualize
Lenarey S. Torririt
@Lengzki
May 30 2017 00:17
@nicholasnbg thanks :)
Ahhmmm... I don't get this:
  • wordBlanks("dog", "big", "ran", "quickly") should contain all of the passed in words separated by non-word characters (and any additional words in your madlib).
CamperBot
@camperbot
May 30 2017 00:17
lengzki sends brownie points to @nicholasnbg :sparkles: :thumbsup: :sparkles:
:cookie: 324 | @nicholasnbg |http://www.freecodecamp.com/nicholasnbg
Joseph
@revisualize
May 30 2017 00:17

@Lengzki
Gist by revisualize / FreeCodeCamp - Word_Blanks.js
The function declaration was set up as... function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) giving the function name as wordBlanks and with four parameter of myNoun, myAdjective, myVerb and myAdverb.
There is more that I could go into (if you want I can) but, I'll sum it up with:
Parameters are treated like variables that represent the values that get passed into your function from the function call (arguments).

Here's an example of this:

function hello(fName, uName) {
     var result;
     result = "Hello " + fName + " " + uName + ", How is your day?";
     return result;
}
hello("Joseph", "@revisualize"); // "Hello Joseph @revisualize, How is your day?"
hello("Bella", "@bellaknoti"); // "Hello Bella @bellaknoti, How is your day?"
hello("Andy", "@dirn"); // "Hello Andy @dirn, How is your day?"

You can use the fName and uName parameters just like a variable inside of your function.
Now this example only uses two parameters fName and uName. Whereas, wordBlanks has four parameters.

When you have the function declaration of:

function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) { }

and you make the function call of:
wordBlanks("dog", "big", "ran", "quickly");
The parameter myNoun gets the first argument from the function call of a string "dog"
The parameter myAdjective gets the second argument from the function call of a string "big"
The parameter myVerb gets the third argument from the function call of a string "ran"
The parameter myAdverb gets the second argument from the function call of a string "quickly"

Parameters are treated like variables that represent the values that get passed into your function from the function call (arguments).

So, you need to use the parameters to create a string and assign that string value to the variable result. (String Concatenation)

@Lengzki If you'd like I can give you another example of parameters
Proconsul
@proconsu1
May 30 2017 00:21

i can't figure out why i am throwing a TypeError that arr.switch() is not a function. am i using the wrong syntax here?

function nextInLine(arr, item) {
  // Your code here
 arr.push(item); 
  return arr.switch();  // Change this line
}

// Test Setup
var testArr = [1,2,3,4,5];

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));

I am supposed to be appending the argument 'item' to the end of the array argument 'arr', then removing the first item from the array and returning it.

Joseph
@revisualize
May 30 2017 00:22
@proconsu1 What is .switch() .... I've never seen that method.
Daniel Zeff
@Diesirae9
May 30 2017 00:22
hey guys! I am really close on this code, but seems to be accepting some weird things/
Nick Gray
@nicholasnbg
May 30 2017 00:23

@Lengzki yeah the instructions can be a bit confusing, but see the line in the example above result =="Hello "+fName...

just use that template with your function

Lenarey S. Torririt
@Lengzki
May 30 2017 00:23

@revisualize I get it but the instruction like this is not clear. I know its used but this task:

should contain all of the passed in words separated by non-word characters

Daniel Zeff
@Diesirae9
May 30 2017 00:23
function mutation(arr) {
  var lowerCase1 = arr[0].toLowerCase;
  var lowerCase2 = arr[1].toLowerCase;
  //lower case array inputs
  for (i=0; i < lowerCase2.length; i++){
    var value = lowerCase1.indexOf(lowerCase2[i]);
    if (value === -1){
      return false;
    }
  }
  return true;
}

mutation(["hello", "hey"]);
Nick Gray
@nicholasnbg
May 30 2017 00:23
i think non word characters might be +
Joseph
@revisualize
May 30 2017 00:24
@Lengzki How do you separate a word by a non-word character? ... (I showed you in my example function of hello.)
Lenarey S. Torririt
@Lengzki
May 30 2017 00:24
+

There:

result = "My " + myAdjective + myNoun + myVerb + myAdverb;

Joseph
@revisualize
May 30 2017 00:24
@nicholasnbg Non-word characters are spaces, commas, semicolons
@Lengzki Dopeoplewritelikethis?
Daniel Zeff
@Diesirae9
May 30 2017 00:25
It is working for most issues, but When they are partially there it is returning true
Joseph
@revisualize
May 30 2017 00:25
@Lengzki You have
Mybigdogranquickly
Lenarey S. Torririt
@Lengzki
May 30 2017 00:25
@revisualize No
It has spaces
Joseph
@revisualize
May 30 2017 00:25
@Lengzki You need to add spaces between the words
Daniel Zeff
@Diesirae9
May 30 2017 00:25
@revisualize myBigDogRanQuickly :P
Joseph
@revisualize
May 30 2017 00:25
@Lengzki No it doesn't.
Lenarey S. Torririt
@Lengzki
May 30 2017 00:25
I changed the value of my word blanks
How's that?
Joseph
@revisualize
May 30 2017 00:26
@Lengzki Well, there's your problem.
Lenarey S. Torririt
@Lengzki
May 30 2017 00:26

function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
var result = "";
// Your code below this line

result = "My " + myAdjective + myNoun + myVerb + myAdverb;
// Your code above this line
return result;
}

// Change the words here to test your function
wordBlanks("dog ", "big ", "ran ", "quickly ");

Nick Gray
@nicholasnbg
May 30 2017 00:26
@Lengzki makes sense. p.s @Lengzki this is referred to in programming as concatenation (combining things in simple terms)
Joseph
@revisualize
May 30 2017 00:26
@Lengzki Free code camp doesn't run your tests. FreeCodeCamp runs ITS tests.
@Lengzki You need to use the freeCodeCamp tests if you want to make the challenge pass.
Lenarey S. Torririt
@Lengzki
May 30 2017 00:27
What's that ?
Joseph
@revisualize
May 30 2017 00:27
@Lengzki freeCodeCamp's tests don't have spaces at the end of the words.
Lenarey S. Torririt
@Lengzki
May 30 2017 00:27
Oh
Joseph
@revisualize
May 30 2017 00:27
@Lengzki wordBlanks("dog", "big", "ran", "quickly");
MJ
@mjcello
May 30 2017 00:27

halp.

"The " + myAdjective + myNoun + myVerb + myAdverb + ".";

error it gives me is "expected an assignment or function call and instead saw an expression."
any ideas?

Lenarey S. Torririt
@Lengzki
May 30 2017 00:27
Ok, I'll try again
Nick Gray
@nicholasnbg
May 30 2017 00:27
@Lengzki you don't have any spaces arg1+ " " +arg2
Joseph
@revisualize
May 30 2017 00:28
@mjcello Show more code.
Lenarey S. Torririt
@Lengzki
May 30 2017 00:28
Yeah, I'll do that way
Proconsul
@proconsu1
May 30 2017 00:28
@revisualize I am not certain I am using the .switch instruction correctly. that is the crux of my difficulty on this challenge.
Joseph
@revisualize
May 30 2017 00:28
@proconsu1 There is no .switch() method in JavaScript
MJ
@mjcello
May 30 2017 00:28

ah! ok.

function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
var result = "";
// Your code below this line
"The " + myAdjective + myNoun + myVerb + myAdverb + ".";

// Your code above this line
return result;
}

// Change the words here to test your function
wordBlanks("dog", "big", "ran", "quickly");

Joseph
@revisualize
May 30 2017 00:28
@proconsu1 So, I have no idea what you're doing.
@mjcello You need to modify the results variable.
@mjcello You have this
// Your code below this line
"The " + myAdjective + myNoun + myVerb + myAdverb + ".";
// Your code above this line
@mjcello That string on a line by itself like that doesn't do anything.
Proconsul
@proconsu1
May 30 2017 00:29
@revisualize i just learned that one about 10 lessons ago. it is supposed to be the front end analog to .pop, i.e. it removes the first item in an array instead of the last and can return the value it removed
Joseph
@revisualize
May 30 2017 00:30
@proconsu1 You din't learn about .switch()
MJ
@mjcello
May 30 2017 00:30
oh!
Nick Gray
@nicholasnbg
May 30 2017 00:30
@mjcello your function returns the variable result at the end, but you aren't actually setting result to anything in your code
Joseph
@revisualize
May 30 2017 00:30

@proconsu1
The push() method adds one or more elements to the end of an array and returns the new length of the array.

The pop() method removes the last element from an array and returns that element.

The unshift() method adds one or more elements to the beginning of an array and returns the new length of the array.

The shift() method removes the first element from an array and returns that element.

MJ
@mjcello
May 30 2017 00:30
got it.
Thank you!
Proconsul
@proconsu1
May 30 2017 00:31
@revisualize aha! faulty memory gets the better of me again. thanks! thought it was syntax but it was just a memory derp in my brainpan
CamperBot
@camperbot
May 30 2017 00:31
proconsu1 sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 4043 | @revisualize |http://www.freecodecamp.com/revisualize
Daniel Zeff
@Diesirae9
May 30 2017 00:37
Ideas on what to do here guys?
function mutation(arr) {
 var word1 = arr[0].toLowerCase;
 var word2 = arr[1].toLowerCase;

  for( i=0;i<word2;i++){
    var value = word1.indexOf(word2[i]);
    if (value === -1){
      return false;
    }
  }
  return true;
}

mutation(["hello", "hey"]);
Steve Fuller
@wsfuller
May 30 2017 00:38

Have a question handing OR operator in an IF Conditional. I have a form with 3 fields name, tagline, image. When I upload these I check for the mime type of the image if it is image/jpeg or image/png. If I only check for one of the types the code works as expected. However, if I put in an OR operator the code does not work as expected.

Checking Single mime type:

var drink = req.body;
    var drinkImage = req.file;
    if(typeof drinkImage !== "undefined"){
      console.log('image was uploaded', drinkImage.mimetype);
      if(drinkImage.mimetype != "image/jpeg"){
        console.log('Image was not a JPEG or PNG', drinkImage.mimetype);
      } else {
        console.log('image correct mimetype');
      }
    } else {
      drinkImage = {};
    }

Server Response:

Server running on port 1337
image was uploaded image/jpeg
image correct mimetype
POST /api/v1/drinks 200 75.486 ms - 175

OR operator

var drink = req.body;
    var drinkImage = req.file;
    if(typeof drinkImage !== "undefined"){
      console.log('image was uploaded', drinkImage.mimetype);
      if(drinkImage.mimetype != "image/jpeg" || drinkImage.mimetype != "image/png"){ //Why is this not working?
        console.log('Image was not a JPEG or PNG', drinkImage.mimetype);
      } else {
        console.log('image correct mimetype');
      }
    } else {
      drinkImage = {};
    }

Server Response

Server running on port 1337
image was uploaded image/jpeg
Image was not a JPEG or PNG image/jpeg
POST /api/v1/drinks 200 70.415 ms - 175
Keon Samuel
@keonsam
May 30 2017 00:38
sublime vs atom
phly104
@phly104
May 30 2017 00:39
can someone help w this, I don't get it:
Steve Fuller
@wsfuller
May 30 2017 00:39
@keonsam Both are fine, I like Atom better was more approachable.
phly104
@phly104
May 30 2017 00:40

Instructions

Set remainder equal to the remainder of 11 divided by 3 using the remainder (%) operator.

The variable remainder should be initialized

The value of remainder should be 2

You should use the % operator

the remainder or those two numbers is roughly 3.6 but says it should be 2

im confused a little bit as to what im supposed to do in this assignment
Alexander W. Stevenson
@supernal-android
May 30 2017 00:42
Does anyone know if we need to add a <script> section in our HTML within CodePen.io in order to get our JavaScript to run?
Nick Gray
@nicholasnbg
May 30 2017 00:43
@supernal-android no you dont
Alexander W. Stevenson
@supernal-android
May 30 2017 00:44
thanks @nicholasnbg Thanks, I appreciate it
CamperBot
@camperbot
May 30 2017 00:44
supernal-android sends brownie points to @nicholasnbg :sparkles: :thumbsup: :sparkles:
:cookie: 325 | @nicholasnbg |http://www.freecodecamp.com/nicholasnbg
Proconsul
@proconsu1
May 30 2017 00:45
@phly104 the remainder of those two numbers actually is 2. the remainder is that leftover integer when you divide one integer by another. when you divide 11 by 3 but only allow integers you get 3, but that leaves a "remainder" of 2, the portion represented by that .6 in 3.6. 3*3=9, 11-9 yields the remainder of 2
phly104
@phly104
May 30 2017 00:46
ok thanks @proconsu1
CamperBot
@camperbot
May 30 2017 00:46
phly104 sends brownie points to @proconsu1 :sparkles: :thumbsup: :sparkles:
:cookie: 63 | @proconsu1 |http://www.freecodecamp.com/proconsu1
makista2
@makista2
May 30 2017 00:47
please help
Manipulate Arrays With pop
is this correct?
var removedFromMyArray = myArray.pop();
or
var removedFromMyArray = myArray.pop(["John", 23], ["cat", 2]);
Andrew
@anblave
May 30 2017 00:52
@makista2 the first one, remember, .pop() remove the last/final item in the array
Proconsul
@proconsu1
May 30 2017 00:52
@makista2 i'm a beginner myself, so grain of salt here, but the way I read that the first expression declares the variable removedFromMyArray and gives it an initial value equal to the last element in the array myArray, while also removing that element from the array. the second one looks just wrong to me
Joseph
@revisualize
May 30 2017 00:53
Remainder:
http://images.tutorvista.com/cms/images/38/remainder1.PNG
13 % 2 is 1 ... 26 % 5 is 1 ... 24 % 6 is 0
24 % 5 is 4 ... 219 % 20 is 19
Just like in my examples above you use the % operator just like any other math operator (+, -, *, /)
Andytran78
@Andytran78
May 30 2017 01:01

function caseInSwitch(val) {
var answer = "";
// Only change code below this line
switch (answer) {
caseInSwitch(1): "alpha";
break;
caseInSwitch(2): "beta";
break;
caseInSwitch(3): "gamma";
break;
caseInSwitch(4): "delta";
break;
}
// Only change code above this line
return answer;
}

// Change this value to test
caseInSwitch(1);

what is wrong with my code? please help
Csaba Balogh
@JasonCorp84
May 30 2017 01:03
Hello
Proconsul
@proconsu1
May 30 2017 01:04
Howdy
makista2
@makista2
May 30 2017 01:04
@proconsu1 thank you for enlighten me
CamperBot
@camperbot
May 30 2017 01:04
makista2 sends brownie points to @proconsu1 :sparkles: :thumbsup: :sparkles:
:cookie: 65 | @proconsu1 |http://www.freecodecamp.com/proconsu1
Csaba Balogh
@JasonCorp84
May 30 2017 01:04
what resources do you suggest to learn JSON and Ajax in order be able to do the intermediate projects ?
makista2
@makista2
May 30 2017 01:04
@anblave thank you for the answer
CamperBot
@camperbot
May 30 2017 01:04
makista2 sends brownie points to @anblave :sparkles: :thumbsup: :sparkles:
:cookie: 223 | @anblave |http://www.freecodecamp.com/anblave
Greg Duncan
@GregatGit
May 30 2017 01:05
@JasonCorp84 which project are you up to?
Csaba Balogh
@JasonCorp84
May 30 2017 01:05
random quote machine
Intermediate Front End Development Projects
Greg Duncan
@GregatGit
May 30 2017 01:06
@JasonCorp84 i woud build it and just use an interanl array - then once that is working use fetch to download a quote
Nick Gray
@nicholasnbg
May 30 2017 01:07
@Andytran78 you need to pass in val instead of answer in your switch, and then assign answer depending on val
Csaba Balogh
@JasonCorp84
May 30 2017 01:07
@GregatGit thank you
CamperBot
@camperbot
May 30 2017 01:07
jasoncorp84 sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:cookie: 853 | @gregatgit |http://www.freecodecamp.com/gregatgit
Greg Duncan
@GregatGit
May 30 2017 01:08
@JasonCorp84 but start building - you can read tutorials and resources forever - building apps really helps you to incorportate what you just leaned
Nick Gray
@nicholasnbg
May 30 2017 01:08

@Andytran78
`switch(val){
case val === 1:
answer = "alpha";
break;

}
return answer;`

Greg Duncan
@GregatGit
May 30 2017 01:09
@nicholasnbg you dont write switches like that
switch(expression) {
    case n:
        code block
        break;
    case n:
        code block
        break;
    default:
        code block
}
Nick Gray
@nicholasnbg
May 30 2017 01:10
sorry, wrong syntax my mistake, been a while since i used one
Greg Duncan
@GregatGit
May 30 2017 01:10
@nicholasnbg :+1:
Nick Gray
@nicholasnbg
May 30 2017 01:10
wait, where is mine wrong?
ah i seee
Csaba Balogh
@JasonCorp84
May 30 2017 01:10
@GregatGit make sense. I guess an internal array with id-s will do it. Than choose 1-n random where n is the number of available quotes.
Nick Gray
@nicholasnbg
May 30 2017 01:11
so case 1, instead of case val===1, correct @GregatGit ?
mrcmyk12
@mrcmyk12
May 30 2017 01:11
i need help with the card counting challenge.
Greg Duncan
@GregatGit
May 30 2017 01:11
case 1:
mrcmyk12
@mrcmyk12
May 30 2017 01:12
i can't get it to return for more than 1 value
it's almost like I need a way to store values
but i dont think i can use an index
Nick Gray
@nicholasnbg
May 30 2017 01:12
thanks @GregatGit
CamperBot
@camperbot
May 30 2017 01:12
nicholasnbg sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:cookie: 854 | @gregatgit |http://www.freecodecamp.com/gregatgit
Greg Duncan
@GregatGit
May 30 2017 01:13
@nicholasnbg
case 1: it will evaluate if val === 1 for you
Nick Gray
@nicholasnbg
May 30 2017 01:14
all good, I've almost completed all project for front end cert, and have found I never used switch once, maybe just me though
Andytran78
@Andytran78
May 30 2017 01:17
@nicholasnbg @GregatGit thanks guys
CamperBot
@camperbot
May 30 2017 01:17
:cookie: 326 | @nicholasnbg |http://www.freecodecamp.com/nicholasnbg
andytran78 sends brownie points to @nicholasnbg and @gregatgit :sparkles: :thumbsup: :sparkles:
:cookie: 855 | @gregatgit |http://www.freecodecamp.com/gregatgit
DistinctWolf
@DistinctWolf
May 30 2017 01:19
did anybody here get stuck on intermediate algorithms and how long did it take you to solve it
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:22

How do I do this?

Modify the existing declarations and assignments so their names use camelCase.
Do not create any new variables.

// Declarations
var StUdLyCapVaR;
var propercamelCase;
var TitleCaseOver;

// Assignments
STUDLYCAPVAR = 10;
PRoperCAmelCAse = "A String";
tITLEcASEoVER = 9000;
@camperbot
Stephen James
@sjames1958gm
May 30 2017 01:23
@Ace-Monkey-Ilium Look at the answers - the correct form is shown there. studlyCapVar for example
@Ace-Monkey-Ilium Edit these lines, don't add new ones
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:23
how do I look at the answer?
edit which lines?
Stephen James
@sjames1958gm
May 30 2017 01:24
@Ace-Monkey-Ilium All six lines with variables. Look below the run test button
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:24
done it
all wrong
DistinctWolf
@DistinctWolf
May 30 2017 01:25
@sjames1958gm is it common to get stuck on algorithms I fell so dumb right now
Stephen James
@sjames1958gm
May 30 2017 01:25
@FlashHero Yes. Which one?
Proconsul
@proconsu1
May 30 2017 01:25
@Ace-Monkey-Ilium camelCase means that every word in the combined expression is capitalized except the first one. so find which lines are NOT doing that with their combined expressions. myVariableName is camel case myvAriaBlenaMe is not
Nick Gray
@nicholasnbg
May 30 2017 01:25
@FlashHero yes, everyone gets stuck
thats the idea
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:26
OH ok thanks @proconsu1
CamperBot
@camperbot
May 30 2017 01:26
ace-monkey-ilium sends brownie points to @proconsu1 :sparkles: :thumbsup: :sparkles:
:cookie: 71 | @proconsu1 |http://www.freecodecamp.com/proconsu1
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:26
sorry @sjames1958gm
DistinctWolf
@DistinctWolf
May 30 2017 01:26
@sjames1958gm Sum All Primes algorithm
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:26
nvm didn't work XD
Nick Gray
@nicholasnbg
May 30 2017 01:26
that one was actually really hard for me
Liz Zernik
@elisazernik
May 30 2017 01:27
How did you do the Storing values with the assignment operator problem? I have
var a= 7;
var b=7;
and var a= var b;?
Nick Gray
@nicholasnbg
May 30 2017 01:27
@FlashHero I was so proud of cmpleteing that one I saved my code
Stephen James
@sjames1958gm
May 30 2017 01:27
@elisazernik Don't repeat the var keyword
and you are supposed to assign b from a
b = a;
DistinctWolf
@DistinctWolf
May 30 2017 01:28
@nicholasnbg how long did it take you
Stephen James
@sjames1958gm
May 30 2017 01:28
@elisazernik var never goes on the right of the =
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:28
@elisazernik do
var a = 7;
var b = b;
Liz Zernik
@elisazernik
May 30 2017 01:28
should the b be in orange?
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:28
yes
maybe
I am not 100% sure
Nick Gray
@nicholasnbg
May 30 2017 01:29
probably a few hours, do you want to show me where you are at? @flashHero
Stephen James
@sjames1958gm
May 30 2017 01:29
@Ace-Monkey-Ilium
a = 7;
b = a;
Don't repeat the var it should already be done in the code above.
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:29
sorry I got it mixed up
@sjames1958gm can you help me
I still can't figure it out
Stephen James
@sjames1958gm
May 30 2017 01:30
@Ace-Monkey-Ilium Show your code. Which ones are still not checked off?
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:30
ALL
DistinctWolf
@DistinctWolf
May 30 2017 01:30
@nicholasnbg I've been stuck for days on that algorithms and I have tried everyway I think i'll work but never works
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:30
studlyCapVar is defined and has a value of 10
properCamelCase is defined and has a value of "A String"
titleCaseOver is defined and has a value of 9000
studlyCapVar should use camelCase in both declaration and assignment sections.
properCamelCase should use camelCase in both declaration and assignment sections.
titleCaseOver should use camelCase in both declaration and assignment sections.
Stephen James
@sjames1958gm
May 30 2017 01:31
@Ace-Monkey-Ilium Change all the variable names to match these below
studlyCapVar should use camelCase in both declaration and assignment sections.
properCamelCase should use camelCase in both declaration and assignment sections.
titleCaseOver should use camelCase in both declaration and assignment sections.
Don't add any lines, or delete any, just change the existing variable names
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:31
how do I?
Stephen James
@sjames1958gm
May 30 2017 01:31
@Ace-Monkey-Ilium Just retype the variable names to have the matching case
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:31
I can't
it won't let me
Stephen James
@sjames1958gm
May 30 2017 01:32
@Ace-Monkey-Ilium Try reset
Or refresh
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:32
ok
ok refresh it
Stephen James
@sjames1958gm
May 30 2017 01:32
@Ace-Monkey-Ilium :+1:
Nick Gray
@nicholasnbg
May 30 2017 01:32
@FlashHero just refreshing myself on my answer quickly
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:32
it still doesn't work
DistinctWolf
@DistinctWolf
May 30 2017 01:33
@nicholasnbg I think there's more math involved in that algorithm, one question what digits do you have to divide by to check if its prime
Stephen James
@sjames1958gm
May 30 2017 01:33
@Ace-Monkey-Ilium Show what you have
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:33
The whole page?
Stephen James
@sjames1958gm
May 30 2017 01:34
@Ace-Monkey-Ilium Just the editor part
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:34
[title](https://www.freecodecamp.com/challenges/understanding-case-sensitivity-in-variables#?solution=%0A%2F%2F%20Declarations%0Avar%20StUdLyCapVaR%3B%0Avar%20properCamelCase%3B%0Avar%20TitleCaseOver%3B%0A%0A%2F%2F%20Assignments%0ASTUDLYCAPVAR%20%3D%2010%3B%0APRoperCAmelCAse%20%3D%20%22A%20String%22%3B%0AtITLEcASEoVER%20%3D%209000%3B%0A)
// Declarations
var StUdLyCapVaR;
var properCamelCase;
var TitleCaseOver;

// Assignments
STUDLYCAPVAR = 10;
PRoperCAmelCAse = "A String";
tITLEcASEoVER = 9000;
here
that is what I have right now
jat9674
@jat9674
May 30 2017 01:35

var myStr="This is the start."+"This is the end";

please guys suggest whats wrong going in this string concatenation.

Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:35
I didn't change anything yet
Stephen James
@sjames1958gm
May 30 2017 01:35
Change the first variable to studlyCapVar in both places.
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:35
ok
Stephen James
@sjames1958gm
May 30 2017 01:36
@jat9674 IS there a space between the. and This?
jat9674
@jat9674
May 30 2017 01:36
yes
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:36
Thanks @sjames1958gm your a genius
CamperBot
@camperbot
May 30 2017 01:36
ace-monkey-ilium sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 7543 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:37
it worked
Stephen James
@sjames1958gm
May 30 2017 01:37
@jat9674 Inside the string? There should be one after the . in the first string.
@Ace-Monkey-Ilium :+1:
Abhishek Tiwari
@fillopfy
May 30 2017 01:38
can anyone tell me, how to make twittr button shareable on quote generator
jat9674
@jat9674
May 30 2017 01:38
myStr should have a value of This is the start. This is the end.
Use the + operator to build myStr
myStr should be created using the var keyword.
Make sure to assign the result to the myStr variable.
Austin
@werewolfred
May 30 2017 01:41
hi I'm stuck on switch statements, I'm having trouble understanding how its supposed to print anything and i don't know why I'm not able to copy the coding into the chat to show what ive written
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:44

I am so confused here. What am I supposed to do?

The remainder operator % gives the remainder of the division of two numbers.

Example

5 % 2 = 1 because
Math.floor(5 / 2) = 2 (Quotient)
2 * 2 = 4
5 - 4 = 1 (Remainder)
Usage
In mathematics, a number can be checked even or odd by checking the remainder of the division of the number by 2.

17 % 2 = 1 (17 is Odd)
48 % 2 = 0 (48 is Even)
Note
The remainder operator is sometimes incorrectly referred to as the "modulus" operator. It is very similar to modulus, but does not work properly with negative numbers.

Instructions
Set remainder equal to the remainder of 11 divided by 3 using the remainder (%) operator.

// Only change code below this line

var remainder;
DistinctWolf
@DistinctWolf
May 30 2017 01:46
@Ace-Monkey-Ilium modulus operator is just like dividing numbers but it returns the remainder of a division so 10 % 5 will return zero because there's no remainder
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:46
OH
let me try first and if it works then I will thank you

doesn't work I did

// Only change code below this line

var remainder; 
11 % 3 = 2
DistinctWolf
@DistinctWolf
May 30 2017 01:49
@Ace-Monkey-Ilium they asked you to store the remainder of the expression in the variable name remainder
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:50
how do you store the remainder? I'm kind of a bigginer because I am 15
Can you give me an example
examples help me by a lot
DistinctWolf
@DistinctWolf
May 30 2017 01:51
var thisIsVariable=this is the expression
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:51
ok
I will try it
DistinctWolf
@DistinctWolf
May 30 2017 01:52
so thisIsVariable stores the answer of the expression
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:53
I am still confused on what to do
and it still doesn't work
DistinctWolf
@DistinctWolf
May 30 2017 01:53
let me see what you have
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:53
ok
Nick Gray
@nicholasnbg
May 30 2017 01:53
its aksing you to make var remainder= ***something***
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:54
// Only change code below this line

var thisisVariable; 11 % 3 = 2
DistinctWolf
@DistinctWolf
May 30 2017 01:54
remove the = 2
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:55
ok
didn't work
DistinctWolf
@DistinctWolf
May 30 2017 01:55
now put equal sign between the expression and the thisisVariable
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:55
oh ok
DistinctWolf
@DistinctWolf
May 30 2017 01:56
let me see what you have now
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:56
// Only change code below this line

var remainder= 11 % 3
still didn't work
DistinctWolf
@DistinctWolf
May 30 2017 01:56
yes now put semicolon
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:57
where?
DistinctWolf
@DistinctWolf
May 30 2017 01:57
at the end
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:57
ok
Thank You @FlashHero
CamperBot
@camperbot
May 30 2017 01:57
ace-monkey-ilium sends brownie points to @flashhero :sparkles: :thumbsup: :sparkles:
:cookie: 186 | @flashhero |http://www.freecodecamp.com/flashhero
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:57
Do you like Flash @FlashHero ?
DistinctWolf
@DistinctWolf
May 30 2017 01:57
yes
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:57
Did you watch the last episode of flash?
on CW
DistinctWolf
@DistinctWolf
May 30 2017 01:58
yes
you watch the flash
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:58
yes
Berry Alan had to go into the speed force
AKA Flash
DistinctWolf
@DistinctWolf
May 30 2017 01:59
yeah
do you understand what's going on in the code
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:59
Yes now I do
Thanks again @FlashHero
CamperBot
@camperbot
May 30 2017 01:59
ace-monkey-ilium sends brownie points to @flashhero :sparkles: :thumbsup: :sparkles:
:warning: ace-monkey-ilium already gave flashhero points
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 01:59
:(
DistinctWolf
@DistinctWolf
May 30 2017 01:59
no problem
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 02:00
its pretty cool how they programmed camperbot
its kind of like discord bots
in a way
I am on #136
lol its a link
I didn't mean to that though
YAY #140
Nick Gray
@nicholasnbg
May 30 2017 02:05
@FlashHero just sent you a link to my code for sumPrimes if you wanna see how i did it
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 02:07
I am stuck again lol
on #140
converting celsius to fahrenheit
I know it is 9/5 +32
jmariomejiap
@jmariomejiap
May 30 2017 02:09
@Ace-Monkey-Ilium what have you got so far. can you post your code
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 02:09
ok
function convertToF(celsius) {
  var fahrenheit;
  // Only change code below this line


  // Only change code above this line
  return fahrenheit;
}

// Change the inputs below to test your code
convertToF(30);
that is what I got so far
jmariomejiap
@jmariomejiap
May 30 2017 02:10
@Ace-Monkey-Ilium ok.
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 02:10
:)
jmariomejiap
@jmariomejiap
May 30 2017 02:10
the instructions say: "The algorithm to convert from Celsius to Fahrenheit is the temperature in Celsius times 9/5, plus 32."
Joseph Amoroso
@SoulSkrix
May 30 2017 02:11
var ourMusic = [
  {
    "artist": "Daft Punk",
    "title": "Homework",
    "release_year": 1997,
    "formats": [ 
      "CD", 
      "Cassette", 
      "LP" ],
    "gold": true
  }
];
If given a complex data structure as such, and I wish to append a new object into it. What syntax would I use to begin the "appending" of an object. I don't need help with contents, just syntax :)
Coy Sanders
@coymeetsworld
May 30 2017 02:12
@SoulSkrix each item in an array is separated by a comma
ie ourMusic = [ {}, {}, {} ];
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 02:13
@jmariomejiap I know how the conversions work but I don't know how to put it as a code
Stephen James
@sjames1958gm
May 30 2017 02:13
@Ace-Monkey-Ilium The value to convert will come in the parameter / variable celsius
Acemcshlaghg
@Acemcshlaghg
May 30 2017 02:14
Stuck on escaping sequences in strings
Joseph Amoroso
@SoulSkrix
May 30 2017 02:14
@coymeetsworld thank you, I guess I meant to ask what is the equivalent of Pythons .append()
CamperBot
@camperbot
May 30 2017 02:14
soulskrix sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:star2: 2656 | @coymeetsworld |http://www.freecodecamp.com/coymeetsworld
jmariomejiap
@jmariomejiap
May 30 2017 02:14
so, on tthe second line... var fahrenheit. ( the variable is created... at this point it is undefined, means no value yet)
then you should you your calculation....
fahrenheit = ( the formula to convert from celsius to fahreneith )
Joseph Amoroso
@SoulSkrix
May 30 2017 02:14
@coymeetsworld just a bit confused on what instruction to type that says "append the following data"
Coy Sanders
@coymeetsworld
May 30 2017 02:14
@SoulSkrix there's 2 functions for arrays, push (add to end of an array), shift (add to beginning, shift everything else up one)
its covered in FCC, although not sure if you would've seen it at this point yet. I think you mightve
@SoulSkrix just add another element to the array I believe, dont' need to use the array functions above
jmariomejiap
@jmariomejiap
May 30 2017 02:15
@Ace-Monkey-Ilium doest it help?
Coy Sanders
@coymeetsworld
May 30 2017 02:15
just actually add the object
Joseph Amoroso
@SoulSkrix
May 30 2017 02:16
@coymeetsworld aha! Thank you. Is adding an object simply array = object?
CamperBot
@camperbot
May 30 2017 02:16
soulskrix sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:warning: soulskrix already gave coymeetsworld points
jmariomejiap
@jmariomejiap
May 30 2017 02:16
@Ace-Monkey-Ilium basically you just have to write one line...
Coy Sanders
@coymeetsworld
May 30 2017 02:16
@SoulSkrix no, that will reassign array to object
to add elements in an array the primary way of doing that is using push/shift functions
Joseph Amoroso
@SoulSkrix
May 30 2017 02:17
@coymeetsworld so array.push(obj);
Coy Sanders
@coymeetsworld
May 30 2017 02:17
yes
Joseph Amoroso
@SoulSkrix
May 30 2017 02:17
@coymeetsworld I see, I was curious as to how you meant without the functions
@SoulSkrix you just literally add another object in the definition of the variable
like if they said add another number to the array var arr = [1];, I would do var arr = [1,2];
not arr.push(2), although that would accomplish the same thing
Joseph Amoroso
@SoulSkrix
May 30 2017 02:19
@coymeetsworld oh! I see. Sorry I must've misunderstood, you see the challenge I'm being given wouldn't allow me to edit the definition. They want me to add the object afterwards, so I guess the push() is my only method. Thank you, much appreciated
CamperBot
@camperbot
May 30 2017 02:19
soulskrix sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:warning: soulskrix already gave coymeetsworld points
Coy Sanders
@coymeetsworld
May 30 2017 02:20
what challenge is it @SoulSkrix ?
Joseph Amoroso
@SoulSkrix
May 30 2017 02:20
manipulating-complex-objects

var myMusic = [
  {
    "artist": "Billy Joel",
    "title": "Piano Man",
    "release_year": 1973,
    "formats": [ 
      "CS", 
      "8T", 
      "LP" ],
    "gold": true
  }
  // Add record here
];
At least that is what I believe the comment indicates, but I think I can do it now. :)
Coy Sanders
@coymeetsworld
May 30 2017 02:21
@SoulSkrix no you are supposed to edit the definition there
as per the comment
Joseph Amoroso
@SoulSkrix
May 30 2017 02:23
@coymeetsworld ah crap, I see what you mean now. It's 3:23am here so I'm not at my sharpest. Didn't notice the comment was IN the closing of the array until you said just now. Cheers ^^'
Coy Sanders
@coymeetsworld
May 30 2017 02:24
np and gl
jmariomejiap
@jmariomejiap
May 30 2017 02:25
@Ace-Monkey-Ilium hey... you got it?
Joseph Amoroso
@SoulSkrix
May 30 2017 02:26
@coymeetsworld thank you I passed it :) Have a pleasant day and cheers again :)
CamperBot
@camperbot
May 30 2017 02:26
soulskrix sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:warning: soulskrix already gave coymeetsworld points
zippy
@ShaimaTheBlueberry
May 30 2017 02:29
hey I am on Make Object Properties Private can anybody help with it
Claudio Restifo
@Marmiz
May 30 2017 02:29
@ShaimaTheBlueberry what have you tried so far
zippy
@ShaimaTheBlueberry
May 30 2017 02:30
I wrote this so far.

var Car = function() {
// this is a private variable
var speed = 10;

// these are public methods
this.accelerate = function(change) {
speed += change;
};

this.decelerate = function() {
speed -= 5;
};

this.getSpeed = function() {
return speed;
};
};

var Bike = function() {

// Only change code below this line.
var gear = 4;
};

var myCar = new Car();

var myBike = new Bike();

var Gear = 4;
myBike.Gear = function(change){

getGear += change;
};
myBike.setGear = function(change){
setGear -= 7;
};
myBike.getGear = function(change){
return Gear;
};

Claudio Restifo
@Marmiz
May 30 2017 02:34
@ShaimaTheBlueberry the bike functions should go inside the Bike method.
the same for the car. If you look this.getSpeed is declared inside var car = function() {}
Andrew
@anblave
May 30 2017 02:35
@ShaimaTheBlueberry Hi, I'm stuck in the same challenge, because I don't understand why my code passed the tests
Claudio Restifo
@Marmiz
May 30 2017 02:35
Also read the instuction and see what setGear and getGear should do
Andrew
@anblave
May 30 2017 02:36
I was going to put the code with the answer, but I wont until you pass the test, avoiding spoilers
Andrew
@anblave
May 30 2017 02:42
Can I put my doubt now?

Hi, my code worked, but I don't understand why, can someone help me explaining me what is happening?
Challenge: "Make Object Properties Private"
Instructions:
Now try it yourself! Modify the Bike constructor to have a private property called gear and two public methods called getGear and setGear to get and set that value.
Items that my code pass: (but I don't know why)
myBike.getGear() should return 4 after calling myBike.setGear(4).
myBike.getGear() should return 3 after calling myBike.setGear(3).
myBike.getGear() should return 1 after calling myBike.setGear(1).
my code:

var Bike = function() {

  // Only change code below this line.
  var gear;

  this.getGear = function () {
    return gear;
  };

  this.setGear = function (change) {
    gear = change;
    return gear;
  };

};

var myCar = new Car();

var myBike = new Bike();

I don't understand why myBike.getGear() is returning the correct value, like 4, 3 or 1

angleshero
@angleshero
May 30 2017 02:56
could someone help with escapr sequences challenge
Claudio Restifo
@Marmiz
May 30 2017 03:00

@anblave because that's what you've declared inside the Bike construct:

this.setGear = function (change) {
    gear = change;
    return gear;
  };

this is simply telling --> take the value that is passed in setGear and assign it to gear:

myBike.setGear(4) --> gear = 4
Then with this:

this.getGear = function () {
    return gear;
  };

You're simply telling " tell me which is the value of gear" so
myBike.getGear() will return 4 (the gear value you have set before)

@JoseeAlejandro read the instructions:

Combine the two if statements into one statement which will return "Yes" if val is less than or equal to 50 and greater than or equal to 25. Otherwise, will return "No".

Where did you take this values?

if (val >= 25 && val<= 50) {
if (val > 2 && val < 10) {
All you have to say is:
if (val between 25 and 50) {
  return "Yes"
} Otherwise
return "No"
@angleshero what have you tried so far?
Ryan Williams
@Ryanwfile
May 30 2017 03:07
When I run the code below it works but if I try to add another list item to the ul I get an error, can someone please explain why I can't add the second list item and/or how to add the 2nd list item, thank you for any help.
function displayInfo (list) {
  return (
    <ul className='userList' >
      {list.map(function(user) {
        return (
          <li>
            Username : {user.username}             
          </li>         
          /*if I put a list item below I get an error
           <li>
            Username : {user.username}             
          </li> */ 
        )
      })}
    </ul>
  )
}
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:12

How do I do this?

To test your learning, you will create a solution "from scratch". Place your code between the indicated lines and it will be tested against multiple test cases.

The algorithm to convert from Celsius to Fahrenheit is the temperature in Celsius times 9/5, plus 32.

You are given a variable celsius representing a temperature in Celsius. Use the variable fahrenheit already defined and apply the algorithm to assign it the corresponding temperature in Fahrenheit.

Note

Don't worry too much about the function and return statements as they will be covered in future challenges. For now, only use operators that you have already learned.

convertToF(0) should return a number convertToF(-30) should return a value of -22
convertToF(-10) should return a value of 14 convertToF(0) should return a value of 32
convertToF(20) should return a value of 68 convertToF(30) should return a value of 86


function convertToF(celsius) {
  var fahrenheit;
  // Only change code below this line


  // Only change code above this line
  return fahrenheit;
}

// Change the inputs below to test your code
convertToF(30);
syferak
@syferak
May 30 2017 03:12
Can someone help me with this please?
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:12
@syferak can you put that as a link form like this --> Link
@jmariomejiap
can you help me with this?
Ryan Williams
@Ryanwfile
May 30 2017 03:14
@Ace-Monkey-Ilium Something like this

function convertToF(celsius) {
  var fahrenheit;
  // Only change code below this line

 fahrenheit = celsius * (9/5) + 32;
  // Only change code above this line
  return fahrenheit;
}
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:14
thanks @Ryanwfile I will give it a try
CamperBot
@camperbot
May 30 2017 03:14
ace-monkey-ilium sends brownie points to @ryanwfile :sparkles: :thumbsup: :sparkles:
:cookie: 345 | @ryanwfile |http://www.freecodecamp.com/ryanwfile
jmariomejiap
@jmariomejiap
May 30 2017 03:14
@Ace-Monkey-Ilium you must assign to fahrenheit the formula.
fahrenheit = celsius * 9 / 5 + 32
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:14
thanks @jmariomejiap
CamperBot
@camperbot
May 30 2017 03:14
ace-monkey-ilium sends brownie points to @jmariomejiap :sparkles: :thumbsup: :sparkles:
:cookie: 290 | @jmariomejiap |http://www.freecodecamp.com/jmariomejiap
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:15
It worked
Thank You so much
jmariomejiap
@jmariomejiap
May 30 2017 03:16
@Ace-Monkey-Ilium the key thing is to get used to . creating a variable (empty) and later on assign a value to it.
syferak
@syferak
May 30 2017 03:16
@Ace-Monkey-Ilium should i put my link after that arrow -->
Claudio Restifo
@Marmiz
May 30 2017 03:17
@syferak to create a link in chat:
[text that the link display](the url)
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:18
@syferak do [title](http://)
Joseph
@revisualize
May 30 2017 03:21
@Ryanwfile You know, Giving away answers to challenges doesn't really help someone learn if there is not further explanation.
@Ace-Monkey-Ilium Do you understand why the solutions that people have given you is the solution?
Look, I don't gift away answers. Studies have shown that giving people answers to problems instills an illusionary sense of learning. Because, it only puts information into short-term memory. Of which people think they are learning. Only through a little struggle and repetition that the human brain puts things into long-term memory. I don't know what is the individual's end goal. I don't know if they want to do this as a personal project, hobby, or if they want to move into industry. Because of this, I strongly feel that working with people to allow them to solve problems on their own is a far better outcome than giving away answers. But, others clearly don't agree with my methods for helping people learn.
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:25
@revisualize I figured it out
Joseph
@revisualize
May 30 2017 03:25

There is the function declaration of function convertToF(celsius) { .. You have a function name of convertToF and a parameter of celsius
Parameters are used just like variables. So, inside of the function you can use celsius JUST like any other variable.
If I have this code:

function addThree (num) {
    var result;
    result = num + 3;
    return result;
}

So, when we make the function call of:

addThree(10);

You're calling the function addThree You're also passing a value 10 as an argument.
In the function declaration of function addThree (num) { You see that there is a parameter defined of num
When we do addThree(10) then the value of the parameter num is passed the argument value of ... 10
Then if you follow the code through.. result = num + 3; ... and we know the value of num is 10.
Therefore, if we follow through the function we end up with ... result = 10 + 3; then result = 13; then we return the result.
...
If you then make another function call..

addThree(39);

You can use the same function to follow the operation:
When we do addThree(39) then the value of the parameter num is passed the argument value of ... 39
Then if you follow the code through.. result = num + 3; ... and we know the value of num is now 39.
Therefore, if we follow through the function we end up with ... result = 39 + 3; then result = 42; then we return the result.

If you make the function call of addThree(21) the value of num inside the function is 21.
If you make the function call of addThree(1000) the value of num inside the function is 1000.
If you make the function call of addThree(123456) the value of num inside the function is 123456.
function declaration of function convertToF(celsius) { } making the function call convertToF(55) the parameter celsius inside of the function has a value of 55
function declaration of function convertToF(celsius) { } making the function call convertToF(23) the parameter celsius inside of the function has a value of 23

The algorithm to convert from Celsius to Fahrenheit is the temperature in Celsius times 9/5, plus 32
Fahrenheit is the temperature in Celsius times 9/5, plus 32
Fahrenheit is Celsius times 9/5, plus 32
Fahrenheit is Celsius times 9/5 + 32
Fahrenheit is Celsius * 9/5 + 32
....

Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:26
All I am asking for is how yo solve it
Now I understand
What am I supposed to do in Escape Sequences in Strings?
Joseph
@revisualize
May 30 2017 03:27
@Ace-Monkey-Ilium Read, Search, Ask.
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:27
This is what I got so far
var myStr = "dwad\ndwa\rdw\\wda"; // Change this line
Joseph
@revisualize
May 30 2017 03:27
@Ace-Monkey-Ilium That isn't correct.
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:27
I figured that part out
I wanna know what I did wrong
because of @jmariomejiap I now learned to put a "=" when you do the var thingy
Joseph
@revisualize
May 30 2017 03:28
image.png
Claudio Restifo
@Marmiz
May 30 2017 03:28

@Ace-Monkey-Ilium

I wanna know what I did wrong

explain to me how you escape a character into a string

Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:28
I do not understand what that means
I am not full grown adults like you guys
Joseph
@revisualize
May 30 2017 03:29
@Ace-Monkey-Ilium
You have to assign 'FirstLine newline backslash SecondLine backslash carriage-return ThirdLine' to the variable myStr.
But, You have to replace the escape words with the proper escape sequences. (And per the instructions: remove all spaces.)
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:29
in that order?
Joseph
@revisualize
May 30 2017 03:29
@Ace-Monkey-Ilium But, you're an intelligent individual that can read, learn and follow directions.
@Ace-Monkey-Ilium You need to follow the instructions of the challenge.
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:30
Thanks you for the compliment @revisualize
CamperBot
@camperbot
May 30 2017 03:30
ace-monkey-ilium sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 4044 | @revisualize |http://www.freecodecamp.com/revisualize
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:30
dang
that is a lot of points
Joseph
@revisualize
May 30 2017 03:30
@Ace-Monkey-Ilium I try to spend at least an hour a day helping people learn.
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:31
That is really kind
Joseph
@revisualize
May 30 2017 03:31
Some days, I can spend up to 6 hours just hanging out in chat trying to help people learn.
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:31
but I still don't understand how to assign FirstLine newline backslash SecondLine backslash carriage-return ThirdLine to the variable myStr
Joseph
@revisualize
May 30 2017 03:32
@syferak STOP. What are you doing?
Heath Morris
@HeathMorrisCode
May 30 2017 03:32
Hey @revisualize I totally stumped on the cash register algorithm, I'm wondering if you've ever messed with that one.
syferak
@syferak
May 30 2017 03:32
i cant post a link
i am new at this
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:32
I could tell
Claudio Restifo
@Marmiz
May 30 2017 03:32
@revisualize you hacked camperbot :P
Joseph
@revisualize
May 30 2017 03:32
@HeathMorrisCode I haven't gotten that far. I understand that people get hung up with floating point math.
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:32
I used to do that when I 1st started doing FreeCodeCamp
Joseph
@revisualize
May 30 2017 03:33
@Marmiz No, I didn't.
Christopher R Dale
@cdale88
May 30 2017 03:33
assignment operators, stumped with assigning one variable to another.
Heath Morris
@HeathMorrisCode
May 30 2017 03:33
I'm using a custom rountTo function to get away from the weird floating point addition problems
Claudio Restifo
@Marmiz
May 30 2017 03:33
@revisualize I was joking mate :)
I know :heart:
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:33
Lol
Claudio Restifo
@Marmiz
May 30 2017 03:33
I see you here all the time :D
Joseph
@revisualize
May 30 2017 03:33
@Ace-Monkey-Ilium How do you assign a string to a variable?
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:33
By...
let me think
give me a minute
Claudio Restifo
@Marmiz
May 30 2017 03:34
@HeathMorrisCode what's the error/issue you're having?
Christopher R Dale
@cdale88
May 30 2017 03:35
help please..assignment operators, stumped with assigning one variable to another.
Claudio Restifo
@Marmiz
May 30 2017 03:35
@cdale88 what have you tried so far?
Joseph
@revisualize
May 30 2017 03:35
@cdale88 How do you assign the value of 7 to a variable num? ... var num = 7;
Now if you want you can use a variable to store values.
Like in mathmatics. num + 3 = 10 What is the value of num?
var x = num + 3; ... That outputs 10
So, you can do several things with variables. But, you need to understand that variables hold values and variables can be used with other variables.
So, how do you assign the value of 5 to a variable x? ... x = 5; (Which is also overwriting the previous value of 10 from above.
How do you assign the value of x to a variable y?
Look at the way things are written. var y = x;
How do you assign the value of 42 to a variable answer? ... What is the answer?
Variables hold values. Just understand that.
Heath Morris
@HeathMorrisCode
May 30 2017 03:35
I basically have no idea where to start with the problem, I've killed the edge cases already (insufficient funds and closed) but in terms of breaking down what change should be given in what denominations, my brain starts to scream
Joseph
@revisualize
May 30 2017 03:36
@Ace-Monkey-Ilium I didn't ask you to send me a link.
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:36
ok
lol
Joseph
@revisualize
May 30 2017 03:36
@Ace-Monkey-Ilium How do you assign a string to a variable?
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:36
why are you so triggered?
Joseph
@revisualize
May 30 2017 03:36
@Ace-Monkey-Ilium I need to know where you actual understanding is at so that I know how to best help.
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:37
You seem unhappy compared to other people who helped me out
Christopher R Dale
@cdale88
May 30 2017 03:37
@revisualize thank you that helps.
CamperBot
@camperbot
May 30 2017 03:37
cdale88 sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 4045 | @revisualize |http://www.freecodecamp.com/revisualize
Joseph
@revisualize
May 30 2017 03:37
@Ace-Monkey-Ilium I'm in no way unhappy. If you are reading that.... That's all on you.
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:37
Ok sir
@revisualize like this?
<script>
    var quotes = "Empty"
        if(user.quotes)
           quotes = user.quotes;    // get the string to 'quotes' variable
</script>
Heath Morris
@HeathMorrisCode
May 30 2017 03:38
@Ace-Monkey-Ilium I think he is just wanting to see you giving as much as he is. Like he wants to see you doing your best to learn if he is doing his best to help out for free. In any case, don't be discouraged, not everyone's teaching style jives with everyone. Just keep on plowing ahead and don't give up! That is the most important thing with learning to code.
Joseph
@revisualize
May 30 2017 03:38
@Ace-Monkey-Ilium No.
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:38

I am doing my best of my abilities

Joseph
@revisualize
May 30 2017 03:38
@Ace-Monkey-Ilium That's far too much code.
@Ace-Monkey-Ilium To assign a string to a variable.
var str = "String";
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:39
@revisualize that was an example from a website that I found
Joseph
@revisualize
May 30 2017 03:39
@Ace-Monkey-Ilium No, the example that you found had too much information. I don't know where your level of understanding is at if you add in a bunch of extra stuff.
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:40
so How should I explain my level of understanding?
Joseph
@revisualize
May 30 2017 03:40
@Ace-Monkey-Ilium Keep things simple.
Respond with your own answers.
Heath Morris
@HeathMorrisCode
May 30 2017 03:40
@Ace-Monkey-Ilium If you start at the beginning of JS on FCC, you'll get some great explanations of these concepts, like declaring variables and working with strings. I can link you up if you want.
makista2
@makista2
May 30 2017 03:40
please help
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:40
Would you like to see my website that I built 6-7 months ago?
makista2
@makista2
May 30 2017 03:40
Passing Values to Functions with Arguments
is this correct?
unction functionWithArgs(a, b) {
console.log(a + b);
}
functionWithArgs(1, 2);
i mean
function functionWithArgs(a, b) {
console.log(a + b);
}
functionWithArgs(1, 2);
Joseph
@revisualize
May 30 2017 03:41
@Ace-Monkey-Ilium I don't care about a website that you made 3 days ago let alone 7 months ago. I'm trying to help you with the problem that you're having now.
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:42
By showing you my website you might understand my level
Claudio Restifo
@Marmiz
May 30 2017 03:42
@HeathMorrisCode Start by creating an object that stores the values eg:{ name: 'TWENTY', val: 20.00},
Then first check if you have enough money in the register to give change.
If so reduce is a preatty useful tool for this task.
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:42
I used html5
Joseph
@revisualize
May 30 2017 03:42
"I eat healthy, want to see the food I ate 3 weeks ago."
@Ace-Monkey-Ilium @Ace-Monkey-Ilium
You have to assign 'FirstLine newline backslash SecondLine backslash carriage-return ThirdLine' as a string to the variable myStr.
But, You have to replace the escape words with the proper escape sequences. (And per the instructions: remove all spaces.)
How do you escape a newline?
How do you escape a backslash?
How do you escape a carriage-return?
Heath Morris
@HeathMorrisCode
May 30 2017 03:43
@revisualize lol dude, life is too short, why are you trying to massively change a stranger on the internet.
@Marmiz Thanks man!
CamperBot
@camperbot
May 30 2017 03:43
heathmorriscode sends brownie points to @marmiz :sparkles: :thumbsup: :sparkles:
:cookie: 908 | @marmiz |http://www.freecodecamp.com/marmiz
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:44
I don't have a clear understanding of FirstLine newline backslash SecondLine backslash carriage-return ThirdLine
Joseph
@revisualize
May 30 2017 03:44
@Ace-Monkey-Ilium It's text.
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:44
I'm trying my best to understand
Joseph
@revisualize
May 30 2017 03:44
"FirstLine newline backslash SecondLine backslash carriage-return ThirdLine"
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:44
that part is obvious
That does not make sense to me
Joseph
@revisualize
May 30 2017 03:44
var myStr = "FirstLine newline backslash SecondLine backslash carriage-return ThirdLine";
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:44
?
Joseph
@revisualize
May 30 2017 03:44
How do you escape a newline? With: \n
How do you escape a backslash? With: \\
How do you escape a carriage-return? With \r
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:45
let me give it a try
Joseph
@revisualize
May 30 2017 03:45
var myStr = "FirstLine newline backslash SecondLine backslash carriage-return ThirdLine";
var myStr = "FirstLine \n backslash SecondLine backslash carriage-return ThirdLine";
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:45
I know what \n is because of Minecraft
Joseph
@revisualize
May 30 2017 03:45
var myStr = "FirstLine \n \\ SecondLine backslash carriage-return ThirdLine";
Claudio Restifo
@Marmiz
May 30 2017 03:46
@HeathMorrisCode FCC had a wiki on reduce.
This is what's left of it:
link
(in case you want a refresh or arr.reduce)
Joseph
@revisualize
May 30 2017 03:46

This lesson is not trying to teach you how to get some green check marks to pass onto the next lesson. It is trying to teach you a really valuable skill. If you have a string in JavaScript that is instantiated with double quotes (") (Example: var myStr = "Hello World";) you can also instantiate a string with single quotes (') (Example: var myStr = 'Hello World';)

How do you add a " to that string? Let's say you instantiated the string with double quotes and you want to put in a quote that someone said. You have to use an escape character.
Example: var myQuote = "Happy Feet said, \"I really like the rhythm.\"";
Or what happens if you want to add a tab to your string? You can't really add 3 spaces and expect it to show up as a tab. You have to use the escape character for a tab (\t).

OR let's say your trying to output a bunch of text and paragraphs within your JavaScript string. You can't really just make a bunch of variables.
var myParagraph1 = "a bunch of characters";
var myParagraph2 = "a bunch more characters";
I mean you could... but, why not just:
var myStr = "A bunch of characters/sentences.\nThe second paragraph of characters and sentences.";

@Ace-Monkey-Ilium You have to replace the escape words with the proper escape sequences. (And per the instructions: remove all spaces.)
Heath Morris
@HeathMorrisCode
May 30 2017 03:48
@Marmiz Thanks man. Reduce is the bane of my existence. I'm starting to understand it for some seriously simple use cases but I don't have a handle on using it when it is really needed, yet
CamperBot
@camperbot
May 30 2017 03:48
heathmorriscode sends brownie points to @marmiz :sparkles: :thumbsup: :sparkles:
:warning: heathmorriscode already gave marmiz points
Adam Kim
@resv
May 30 2017 03:50

I have been tackling this lab for over a day now. "using objects for look ups" I have finally made some progress just now getting 2 parts to pass , not using case/switch/if & phoneticLookup("charlie" = Chicago. this is my code:

// Setup
function phoneticLookup(val) {
  var result = "";

  // Only change code below this line
var val = {
    alpha : "Adams",
    bravo : "Boston",
  charlie : "Chicago",
    delta : "Denver",
     echo : "Easy",
  foxtrot : "Frank",};
{
var lookup = "charlie";
var result = val[lookup]
};  

  // Only change code above this line
  return result;
}

// Change this value to test
phoneticLookup("charlie");

should I just add a new "lookup" variable for other strings to get this to pass or am I missing the lesson here?

An-mode
@an-mode
May 30 2017 03:50
Hello Wold ! I am trying to do an exercise in JS on card counting. It expects that "The function will then return a string with the current count and the string "Bet" if the count is positive, or "Hold" if the count is zero or negative. The current count and the player's decision ("Bet" or "Hold") should be separated by a single space."
heroiczero
@heroiczero
May 30 2017 03:51
@resv you have to make an object with lookup and the val is the property of an object
An-mode
@an-mode
May 30 2017 03:51

var count = 0;

function cc(card) {
// Only change code below this line

if((card==2)|(card==3)|(card==5)|(card==4)|(card==6)){
count+=1;
}
if((card==10) | (card=='J') | (card=='Q') | (card=='K') | (card=='A'))
{
count-=1;
}

if (count>0){
return(count, " Bet");
}
else{
return(count, " Hold");
}
}

cc(2); cc(3); cc(4); cc(5); cc(6);

heroiczero
@heroiczero
May 30 2017 03:51
@resv because val is a parameter of the function phoneticLookup(val)
Joseph
@revisualize
May 30 2017 03:53
@resv You're overwriting your val parameter?
@resv With this code: function phoneticLookup(val) { } you have a function declaration with a function name of phoneticLookup and a parameter val.
When you make the function call: phoneticLookup("charlie");
You are calling the function by name and passing the argument of "charlie" to the function parameter of val as a value.
heroiczero
@heroiczero
May 30 2017 03:54

@resv

var val = {
    alpha : "Adams",
    bravo : "Boston",
  charlie : "Chicago",
    delta : "Denver",
     echo : "Easy",
  foxtrot : "Frank",};

this should be var lookup to make a lookup object variable.

Nick Gray
@nicholasnbg
May 30 2017 03:56
@an-mode need to use ||, not just | when using or
Adam Kim
@resv
May 30 2017 03:57
@revisualize hm, I thought I was getting the value of the objects by doing this @heroiczero hmm ok! let me see
Joseph
@revisualize
May 30 2017 03:57
@resv Wait, what? "the value of the objects" ?
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:58
@revisualize my dad helped me and I got this
var myStr = "FirstLine\n\\SecondLine\\\rThirdLine";
heroiczero
@heroiczero
May 30 2017 03:58
@resv you are making a function meaning you can call the function later on with the function name. In this case, it is phoneticLookup();
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 03:58
I got it correct @revisualize
Chris Cullen
@123xylem
May 30 2017 03:59
App.js:73 Uncaught Error: Module build failed: (SystemJS) ENOENT: no such file or directory, open 'C:\Users\Chris\Desktop\Projects\TravelSite\C:\Users\Chris\Desktop\Projects\TravelSite\node_modules\babel-loader\lib\index.js'
Error: ENOENT: no such file or directory, open 'C:\Users\Chris\Desktop\Projects\TravelSite\C:\Users\Chris\Desktop\Projects\TravelSite\node_modules\babel-loader\lib\index.js'
at Error (native)
Can someone help with this error im getting?
I installed and configged Babel in my webpack.config file.. Setting up webpack was also hard as it wouldnt recognise my "relative path" so i had to add path.resolve()
Now It cant find my babel files it appears and Im pretty confused on what to change
Below is my webpack config file
const path = require('path');
var p = path.resolve(__dirname,'app/temp');

module.exports= {    

        entry:  "./app/assets/scripts/App.js", 

        output: {
        path: p + "/scripts", 
        filename:"App.js"
        },
        module: {
    loaders: [
      {
        loader: 'babel',
        query: {
          presets: ['es2015']
        },
        test: /\.js$/,
        exclude: /node_modules/
      }
    ]
  }
}
Adam Kim
@resv
May 30 2017 03:59
@revisualize such as charlie has a value of "chicago
Joseph
@revisualize
May 30 2017 03:59
@resv You first need to understand what val is.
An-mode
@an-mode
May 30 2017 04:00
@nicholasnbg . Thanks. realize the silly miss. I have updated the code but is still not doing the job.
CamperBot
@camperbot
May 30 2017 04:00
an-mode sends brownie points to @nicholasnbg :sparkles: :thumbsup: :sparkles:
:cookie: 327 | @nicholasnbg |http://www.freecodecamp.com/nicholasnbg
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:01
Thank you @ace-monkey-ilium
CamperBot
@camperbot
May 30 2017 04:01
sorry ace-monkey-ilium, you can't send brownie points to yourself! :sparkles: :sparkles:
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:01
lol
Nick Gray
@nicholasnbg
May 30 2017 04:03
@an-mode I think your returns need changing, firstly they don't need to be in brackets, and you need to concatenate the count and string, so
return var + " string";
Ken Haduch
@khaduch
May 30 2017 04:05

Helpful notification about free e-books

Hello @all - this might be of interest to some of you looking for other learning resources. There is a website for Packt book publishers and they make a free e-book available to add to your library on their site every day. The website (which you have to set up a free account to access, and they do send emails with special book offers, etc.) is https://www.packtpub.com/packt/offers/free-learning - the reason I'm posting today is that for the next 19 hours, the book that is available is "Learning JavaScript Data Structures and Algorithms" - it might be of interest to people who are new at javascript, and there are a variety of books on different topics that are available for purchase, as well as the free title each day. Just FYI to my fellow students!
An-mode
@an-mode
May 30 2017 04:06
@nicholasnbg Thank you so much for your help. Had been trying to figure this out for a while now. :)
CamperBot
@camperbot
May 30 2017 04:06
an-mode sends brownie points to @nicholasnbg :sparkles: :thumbsup: :sparkles:
:warning: an-mode already gave nicholasnbg points
Matthew Greene
@mattkgreene
May 30 2017 04:06

Hi I was wondering if anyone could help me with my approach tot his problem: "Write a function nextInLine which takes an array (arr) and a number (item) as arguments. Add the number to the end of the array, then remove the first element of array. The nextInLine function should then return the element that was removed."
My thought was: function nextInLine(arr, item) {
var nextInLine = nextInLine.push(arr[0]);

return nextInLine;
}

ArcticForestMC
@ArcticForestMC
May 30 2017 04:07
hi
Lallo Vigil
@lalov1
May 30 2017 04:08

I'm working on the calculator, but have a couple questions: https://codepen.io/lalov1/pen/b630862d9af5ad1e684bdd9851e50ab5

How do I make the buttons have a press effect when you click on them? Should I be storing the numbers in arrays? My display keeps getting cut off. Any suggestions?

heroiczero
@heroiczero
May 30 2017 04:08
@mattkgreene you have two parameters the arr and item
ArcticForestMC
@ArcticForestMC
May 30 2017 04:08
I am new
how do I do this?

Welcome to Free Code Camp's first coding challenge.

You can edit code in your text editor, which we've embedded into this web page.

Do you see the code in your text editor that says <h1>Hello</h1>? That's an HTML element.

Most HTML elements have an opening tag and a closing tag.

Opening tags look like this:

<h1>

Closing tags look like this:

</h1>

Note that the only difference between opening tags and closing tags is that closing tags have a slash after their opening angle bracket.

Each challenge has tests that you can run at any time by clicking the "Run tests" button. Once you get all tests passing, you can advance to the next challenge.

To pass the test on this challenge, change your h1 element's text to say "Hello World" instead of "Hello". Then click the "Run tests" button.

Run tests (ctrl + enter)
Reset Help Bug
Your h1 element should have the text "Hello World".

heroiczero
@heroiczero
May 30 2017 04:09
@mattkgreene Hint: you have to push the item and shift the first element of the arr
Joseph
@revisualize
May 30 2017 04:09
@mattkgreene nextInLine is the function name
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:09
@ArcticForestMC do <h1>Hello World</h1>
Joseph
@revisualize
May 30 2017 04:10

@mattkgreene Stand In Line is a CheckPoint where you're supposed to:
Write a function nextInLine which has two parameters
an array (arr) and a number (item).
That part has been done for you here:

function nextInLine(arr, item) { }

With that function declaration you have a function name of nextInLine. You have two parameters arr which represents an array passed into the function and item that represents a number passed to the function.

ArcticForestMC
@ArcticForestMC
May 30 2017 04:10
It worked Thanks
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:10
@ArcticForestMC do Thanks @ace-monkey-Ilium
CamperBot
@camperbot
May 30 2017 04:10
ace-monkey-ilium sends brownie points to @arcticforestmc :sparkles: :thumbsup: :sparkles:
:cookie: 9 | @arcticforestmc |http://www.freecodecamp.com/arcticforestmc
ArcticForestMC
@ArcticForestMC
May 30 2017 04:10
thanks @Ace-Monkey-Ilium
CamperBot
@camperbot
May 30 2017 04:10
arcticforestmc sends brownie points to @ace-monkey-ilium :sparkles: :thumbsup: :sparkles:
:cookie: 147 | @ace-monkey-ilium |http://www.freecodecamp.com/ace-monkey-ilium
Joseph
@revisualize
May 30 2017 04:11

@mattkgreene A few example function calls:

nextInLine([4,3,2] , 1) the values passed to arr is [4,3,2] and the value passed to item is 1

nextInLine([2,4,6,8] , 10) ... arr is [2,4,6,8] & item is 10

nextInLine([2,3,5,7,11] , 13) ... arr is [2,3,5,7,11] & item is 13 (first 5 and 6th prime numbers)

nextInLine([] , 0) ... arr is [] & item is 0

  var myArr = [1,3,5,7];
   nextInLine(myArr , 9); // ... `arr` is `[1,3,5,7]` a copy of the value of the global variable `myArr` & `item` is `9`

Parameters are treated like variables that represent the values that get passed into your function from the function call (arguments).

ArcticForestMC
@ArcticForestMC
May 30 2017 04:11
Can anyone here make a website for me?
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:11
no
ArcticForestMC
@ArcticForestMC
May 30 2017 04:11
why not
Joseph
@revisualize
May 30 2017 04:11
@ArcticForestMC I can.
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:12
I wanna need my own
ArcticForestMC
@ArcticForestMC
May 30 2017 04:12
Joseph
do I have to pay or something?
Joseph
@revisualize
May 30 2017 04:12
@ArcticForestMC Of course.
ArcticForestMC
@ArcticForestMC
May 30 2017 04:12
:(
Joseph
@revisualize
May 30 2017 04:12
I don't work for free.
ArcticForestMC
@ArcticForestMC
May 30 2017 04:12
I am 10
Joseph
@revisualize
May 30 2017 04:13
@ArcticForestMC So.
ArcticForestMC
@ArcticForestMC
May 30 2017 04:13
I just want my own website
I already have a server
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:13
Me too
Joseph
@revisualize
May 30 2017 04:13
@ArcticForestMC That's cool.
ArcticForestMC
@ArcticForestMC
May 30 2017 04:13
nice
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:13
Amazon Linux AMI
ArcticForestMC
@ArcticForestMC
May 30 2017 04:13
yep
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:14
you play Minecraft?
ArcticForestMC
@ArcticForestMC
May 30 2017 04:14
Yeah
Joseph
@revisualize
May 30 2017 04:14
@ArcticForestMC Awesome. ... My going rate for web development is $250.00 USD an hour.
ArcticForestMC
@ArcticForestMC
May 30 2017 04:14
really
I don't have that kind of money
Chris Cullen
@123xylem
May 30 2017 04:14
@revisualize how fast can you make a website?
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:14
that's expensive
Joseph
@revisualize
May 30 2017 04:14
@123xylem Depends on the website scope.
ArcticForestMC
@ArcticForestMC
May 30 2017 04:14
I could play $10 for the whole website
Joseph
@revisualize
May 30 2017 04:14
@Ace-Monkey-Ilium No it isn't.
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:15
yes it is
Joseph
@revisualize
May 30 2017 04:15
@Ace-Monkey-Ilium No.. It is not.
Chris Cullen
@123xylem
May 30 2017 04:15
@revisualize say a simple personal blog
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:15
my dad works $195 USD an hour
he does front end
I think
Joseph
@revisualize
May 30 2017 04:15
@Ace-Monkey-Ilium I work for $250.00 an hour.
Matthew Greene
@mattkgreene
May 30 2017 04:15
@heroiczero @revisualize thanks!
CamperBot
@camperbot
May 30 2017 04:15
mattkgreene sends brownie points to @heroiczero and @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 4046 | @revisualize |http://www.freecodecamp.com/revisualize
:star2: 1323 | @heroiczero |http://www.freecodecamp.com/heroiczero
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:15
can I have some money?
ArcticForestMC
@ArcticForestMC
May 30 2017 04:16
Me too
Joseph
@revisualize
May 30 2017 04:16
I'm also a Senior Network Systems Administrator working in Heathcare IT Systems.
ArcticForestMC
@ArcticForestMC
May 30 2017 04:16
how old are you?
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:16
are you like in your 50's?
Baibhav Gautam
@baibhavx
May 30 2017 04:16
@revisualize where do you live?
Joseph
@revisualize
May 30 2017 04:16
@123xylem Still... Depends on the scope of the project.
ArcticForestMC
@ArcticForestMC
May 30 2017 04:16
China
is it?
Joseph
@revisualize
May 30 2017 04:16
I live in Seattle.
ArcticForestMC
@ArcticForestMC
May 30 2017 04:16
why
Baibhav Gautam
@baibhavx
May 30 2017 04:16
nice!
Chris Cullen
@123xylem
May 30 2017 04:16
@revisualize well a simple blog site is small scope
5 hours 20 hours ?
ArcticForestMC
@ArcticForestMC
May 30 2017 04:17
can anyone else build me a website?
I don't want @revisualize cause he is trying to steal money from me
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:17
lol
Joseph
@revisualize
May 30 2017 04:17
@123xylem Not really. How are blog posts created? Is there a login system? Are blogs editable?
Baibhav Gautam
@baibhavx
May 30 2017 04:17
@revisualize I am actively looking for junior web dev position. It'd be great if you can introduce me to startups/companies. I live in the SF bay.
Anker
@ankerpeet
May 30 2017 04:17
Does anyone know of a working example of the weather app? The example given doesnt run for me. It doesnt display any info.
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:17
I made this website and-server.tumblr.com
ArcticForestMC
@ArcticForestMC
May 30 2017 04:17
that's not a link
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:17
lol
heroiczero
@heroiczero
May 30 2017 04:17
@ArcticForestMC why dont you create it just make it a project
ArcticForestMC
@ArcticForestMC
May 30 2017 04:18
I am 10 years old
Joseph
@revisualize
May 30 2017 04:18
@baibhavx You and me both.
Chris Cullen
@123xylem
May 30 2017 04:18
@revisualize yea simple post login system. small scale editable blogs using Restful method
Baibhav Gautam
@baibhavx
May 30 2017 04:18
@revisualize are you switching careers?
ArcticForestMC
@ArcticForestMC
May 30 2017 04:18
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:18
sure
Joseph
@revisualize
May 30 2017 04:18
@123xylem I'm not really sure. I spent about 15 to 20 hours on a website that I made about 8 years ago. That did just that.
Chris Cullen
@123xylem
May 30 2017 04:19
@revisualize kk cool
ArcticForestMC
@ArcticForestMC
May 30 2017 04:19
@revisualize is a gold digger
Joseph
@revisualize
May 30 2017 04:19
@ArcticForestMC No I'm not.
Baibhav Gautam
@baibhavx
May 30 2017 04:19
lol
ArcticForestMC
@ArcticForestMC
May 30 2017 04:19
lol
get REKT
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:19
@revisualize is #triggered
Adam Kim
@resv
May 30 2017 04:20
@ArcticForestMC people come here to learn how to make a website, not beg people to make one
ArcticForestMC
@ArcticForestMC
May 30 2017 04:20
@revisualize wants 250dolar an hour
it will take me 50 years
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:20
lol
heroiczero
@heroiczero
May 30 2017 04:20
yeah this is a place to learn
ArcticForestMC
@ArcticForestMC
May 30 2017 04:20
I learned 9 lessons so far
can anyone help?
ArcticForestMC
@ArcticForestMC
May 30 2017 04:21
I can't help
I am too young
Adam Kim
@resv
May 30 2017 04:21
@ArcticForestMC you request someone to make a website, you will have to pay for their work and time. $250 an hour or any price they demand is what you pay for someone to make a website is less than 50 years.
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:21
kids these days :D
ArcticForestMC
@ArcticForestMC
May 30 2017 04:22
shut UP ace
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:22
why
ArcticForestMC
@ArcticForestMC
May 30 2017 04:22
cause I said so
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:22
lol
foxthor
@foxthor
May 30 2017 04:22
could anyone help me understand problem 175, Stand in Line?
Anker
@ankerpeet
May 30 2017 04:22
Hey guys, you're getting way off topic here
ArcticForestMC
@ArcticForestMC
May 30 2017 04:22
NO I"M NOT
Matthew Greene
@mattkgreene
May 30 2017 04:23
Still having trouble, my next try was:

function nextInLine(arr, item) {
arr.push(item);

return arr.shift;
}

Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:23
sorry
Anker
@ankerpeet
May 30 2017 04:23
@foxthor where are you at in it so far?
Joseph
@revisualize
May 30 2017 04:23
Do people understand what actually goes into running a business? And the costs associated?
You have to pay your own salary.
You have to pay for your own benefits. (Medical, Dental, Vision)
You have to cover your own retirement costs.
You even have to account for your own PTO / Vacation costs.
You have to pay your own taxes. And we're talking ALL of them
Self Employment Tax, Medicare, Medicade, Social Security.
Being self employed isn't the same as working for an employer that covers those costs for you.
If you work for someone else at 20.00 an hour (W2) and you become self employed you need to charge at least $35.00 an hour
I charge 250.00 an hour for my services ... Not just for web development ... I also charge the same rate for Network Systems Administration.
Chris Cullen
@123xylem
May 30 2017 04:23
const path = require('path');
var p = path.resolve(__dirname,'app/temp');

module.exports= {    

        entry:  "./app/assets/scripts/App.js", 

        output: {
        path: p + "/scripts", 
        filename:"App.js"
        },
          resolveLoader: {
    moduleExtensions: ['-loader']
  },

        module: {
    loaders: [
      {
        loader: 'babel',
        query: {
          presets: ['es2015']
        },
        test: /\.js$/,
        exclude: /node_modules/
      }
    ]
  }
}

Can someone tell me why the above code referring to webpack config locations leads my Babel to give the following error:

Uncaught Error: Module build failed: (SystemJS) ENOENT: no such file or directory, open 'C:\Users\Chris\Desktop\Projects\TravelSite\C:\Users\Chris\Desktop\Projects\TravelSite\node_modules\babel-loader\lib\index.js'

Joseph
@revisualize
May 30 2017 04:23
@mattkgreene arr.shift; should be arr.shift();
ArcticForestMC
@ArcticForestMC
May 30 2017 04:23
@revisualize is a poopy head
Matthew Greene
@mattkgreene
May 30 2017 04:23
@revisualize oh wow! cant believe I missed that haha, thanks!
CamperBot
@camperbot
May 30 2017 04:23
mattkgreene sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:warning: mattkgreene already gave revisualize points
foxthor
@foxthor
May 30 2017 04:24
at the start, struggling to understand the question
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:24
lol
ArcticForestMC
@ArcticForestMC
May 30 2017 04:24
@revisualize is a stupid head
Joseph
@revisualize
May 30 2017 04:24
@ArcticForestMC No. I'm a realist. And I know the costs associated to run my own business.
ArcticForestMC
@ArcticForestMC
May 30 2017 04:24
HE is a gold digger

he pretends to make a website and then not give it to you

Matthew Greene
@mattkgreene
May 30 2017 04:25
@revisualize don't let the troll get to you
CamperBot
@camperbot
May 30 2017 04:25
:trollface: troll problems? notify admins here
Joseph
@revisualize
May 30 2017 04:25

@foxthor Stand In Line is a CheckPoint where you're supposed to:
Write a function nextInLine which has two parameters
an array (arr) and a number (item).
That part has been done for you here:

function nextInLine(arr, item) { }

With that function declaration you have a function name of nextInLine. You have two parameters arr which represents an array passed into the function and item that represents a number passed to the function.

ArcticForestMC
@ArcticForestMC
May 30 2017 04:25
LOL
:trollface:
:trollface:
Mukul Agrawal
@mukul09
May 30 2017 04:26
@foxthor you just have to add a number to an array at its last and then remove the first element of the array
Joseph
@revisualize
May 30 2017 04:26

@foxthor A few example function calls:

nextInLine([4,3,2] , 1) the values passed to arr is [4,3,2] and the value passed to item is 1

nextInLine([2,4,6,8] , 10) ... arr is [2,4,6,8] & item is 10

nextInLine([2,3,5,7,11] , 13) ... arr is [2,3,5,7,11] & item is 13 (first 5 and 6th prime numbers)

nextInLine([] , 0) ... arr is [] & item is 0

var myArr = [1,3,5,7];
nextInLine(myArr , 9); // ... `arr` is `[1,3,5,7]` a copy of the value of the global variable `myArr` & `item` is `9`

Parameters are treated like variables that represent the values that get passed into your function from the function call (arguments).

Adam Kim
@resv
May 30 2017 04:26
@heroiczero
is this right now? Im getting the same results, charlie is passing. the rest are not.

// Setup
function phoneticLookup(val) {
  var result = "";

  // Only change code below this line
var lookup = {
    alpha : "Adams",
    bravo : "Boston",
  charlie : "Chicago",
    delta : "Denver",
     echo : "Easy",
  foxtrot : "Frank",};
{
var val = "charlie";
var result = lookup[val]
};  

  // Only change code above this line
  return result;
}

// Change this value to test
phoneticLookup("charlie");
Joseph
@revisualize
May 30 2017 04:26
@resv remove this line: var val = "charlie";
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:27
does anyone wanna donate me money
Joseph
@revisualize
May 30 2017 04:27
@resv What are the { }s for here:
{
var val = "charlie";
var result = lookup[val]
};
heroiczero
@heroiczero
May 30 2017 04:27

@resv

{
var val = "charlie";
var result = lookup[val];
};

remove the {}; around this and remove
var val = "charlie";

Adam Kim
@resv
May 30 2017 04:28
wow @heroiczero @revisualize thanks, they passed, I will analyze this now
CamperBot
@camperbot
May 30 2017 04:28
resv sends brownie points to @heroiczero and @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 1324 | @heroiczero |http://www.freecodecamp.com/heroiczero
:star2: 4047 | @revisualize |http://www.freecodecamp.com/revisualize
Joseph
@revisualize
May 30 2017 04:28
@ArcticForestMC Can you stop Private Messaging me insults?
foxthor
@foxthor
May 30 2017 04:28
thanks @revisualize
CamperBot
@camperbot
May 30 2017 04:28
foxthor sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 4048 | @revisualize |http://www.freecodecamp.com/revisualize
heroiczero
@heroiczero
May 30 2017 04:28
thats why you ignore them in the first place :)
foxthor
@foxthor
May 30 2017 04:29
this one has really stumped me tho, i guess its one of those ones where i need to go back to previous lessons.
Joseph
@revisualize
May 30 2017 04:29
@heroiczero No. What I do is report them to Gitter Administration and get them banned from not only freeCodeCamp chat.. But, from the system all together.

@foxthor Again the two parameters for the nextInLine function are arr & item.

Per the instructions: Add the number to the end of the array, then remove the first element of array. The nextInLine function should then return the element that was removed.

You need to add the number (item) to the end of an array (arr).
You also need to remove the first element from an array (arr).

Then you need to have your function return the removed element from the array arr.

Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:29
wow
Joseph
@revisualize
May 30 2017 04:30
I don't mess around with the trolls and the insults. I deal with them like a normal person does.
heroiczero
@heroiczero
May 30 2017 04:30
that works too, but I don't like feeding the troll
CamperBot
@camperbot
May 30 2017 04:30
:trollface: troll problems? notify admins here
heroiczero
@heroiczero
May 30 2017 04:31
Would of reported and not talk to him
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:31
Is @ArcticForestMC banned?
Joseph
@revisualize
May 30 2017 04:33
@foxthor How do you add a number (item) to the end of an array (arr)?
How do you remove the first element from an array (arr)?
foxthor
@foxthor
May 30 2017 04:33
add the number to the end of the array? what number? this ones got my mind frazzled
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:33
@revisualize are you an admin?
Joseph
@revisualize
May 30 2017 04:33
@foxthor Write a function nextInLine which has two parameters
an array (arr) and a number (item).
That part has been done for you here:
function nextInLine(arr, item) { }
foxthor
@foxthor
May 30 2017 04:33
push and whatever the other one is need to go refresh
Joseph
@revisualize
May 30 2017 04:33
@Ace-Monkey-Ilium No. I turned down the offer to become an admin.
@foxthor The parameter item is the number.
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:34
wait so you been offer to become an admin?
if you did you should of taken it
Joseph
@revisualize
May 30 2017 04:34
@Ace-Monkey-Ilium Yes.
@Ace-Monkey-Ilium I turned it down.
foxthor
@foxthor
May 30 2017 04:34
ok thanks for the hints, i might go back and re-run through the lessons
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:35
you made the wrong choice
Sam Soucie
@samdsou
May 30 2017 04:35
how can I check if an argument is an actual value of an object?
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:35
That was your chance
Joseph
@revisualize
May 30 2017 04:35
I'm far less tolerate to insults and rude commentary. I would have banned too many people.
I know my limitations. So, I made the choice.
@samdsou Depends.
@samdsou Are you looking for an object property key or the value?
mstellaluna
@mstellaluna
May 30 2017 04:36
Hey gang, everything ok?
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:36
@revisualize I am stuck on another one
Concatenating Strings with the Plus Equals Operator
Joseph
@revisualize
May 30 2017 04:37
@samdsou
var myObj = {
    "key": "Value"
 }
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:37
// Example
var ourStr = "I come first. ";
ourStr += "I come second.";

// Only change code below this line

var myStr = "This is the first sentence.";
ourStr = "I come second.";
Joseph
@revisualize
May 30 2017 04:37
@mstellaluna Just some 10 year olds being trolls.
Sam Soucie
@samdsou
May 30 2017 04:38
@revisualize value
Joseph
@revisualize
May 30 2017 04:38
@samdsou Hmmm.
mrstblogger
@mrstblogger
May 30 2017 04:38
I am on the factorialize challenge, and not sure why I keep getting RangeError: Maximum call stack size exceeded. (I have the function rerunning itself within a for loop, which is supposed to go down from the number, as long as i is more than i, so I don't know how it can be exceeding a maximum. (ps i am newbie so may be lots of other errors too) function factorialize(num) {
if (num === 0) {
return 1;
}
for (var i=num; i > 1; i--){
num *= (num -1);
if (i === 1){ return num;}
else {factorialize(num);}}
}
factorialize(5);
mstellaluna
@mstellaluna
May 30 2017 04:38
@revisualize yea i saw. I'm going to take care of it on our end but if he is IMing you, i can report him to gitterHQ
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:39
is he gone?
Joseph
@revisualize
May 30 2017 04:39
@mstellaluna Just IM'd me a bunch of lame :trollface: Emoji's.
Ravi Kishore Thella
@ravikishorethella
May 30 2017 04:39
@mrstblogger num = (num -1); ??
if you want to do in recursive way then num = num
factorialize(num-1)
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:39
really
Joseph
@revisualize
May 30 2017 04:39
@samdsou Do you know the key?
Sam Soucie
@samdsou
May 30 2017 04:39
yes
Joseph
@revisualize
May 30 2017 04:40
@samdsou They why not just do a comparison?
@samdsou if (obj["key"] === "someValue") { }
foxthor
@foxthor
May 30 2017 04:40
tried this function nextInLine(arr, item) {
// Your code here
nextInLine.push(item);
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:41
can anyone help me with what I am stuck on?
foxthor
@foxthor
May 30 2017 04:41
response is: function nextInLine(arr, item) {
// Your code here
nextInLine.push(item);
Joseph
@revisualize
May 30 2017 04:41
@foxthor nextInLine is a function ... Not an array.
mstellaluna
@mstellaluna
May 30 2017 04:41
@revisualize if he continues let me know, i'll report him to gitter
Joseph
@revisualize
May 30 2017 04:41
@mstellaluna Will do.
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:41
haven't seen him for like 10 minutes
foxthor
@foxthor
May 30 2017 04:41
it says nextInLine.push is not a function.
Joseph
@revisualize
May 30 2017 04:41
@foxthor Because, nextInLine is a FUNCTION not an array.
@foxthor .push() is an Array method.
Sam Soucie
@samdsou
May 30 2017 04:42
@revisualize so that's basically what I've been trying to do but it's not working. (caveat: I'm a noob)
Joseph
@revisualize
May 30 2017 04:42
@samdsou What exactly are you trying to do?
Sam Soucie
@samdsou
May 30 2017 04:42
@revisualize I'm on the lookup profile challenge of JS
foxthor
@foxthor
May 30 2017 04:42
so nextInLine(arr, item) the arr part is an array? how is that defined,
Joseph
@revisualize
May 30 2017 04:43
@foxthor arr is an array. ... item represents a number
foxthor
@foxthor
May 30 2017 04:43
so using the word arr anywhere represents an array
Sam Soucie
@samdsou
May 30 2017 04:43
@revisualize I'm trying to check and see if a name (argument) matches a name in the object and then go on from there
Joseph
@revisualize
May 30 2017 04:43
@foxthor No.
Sam Soucie
@samdsou
May 30 2017 04:44
function lookUpProfile(firstName, prop){
if (contacts.firstName === firstName){
if (contacts.hasOwnProperty(prop)){
return contacts.prop;
}else{
return "No such property";
}
}else{
return "No such contact";
}
Joseph
@revisualize
May 30 2017 04:44
@samdsou OKAY!
@samdsou First off.
@samdsou contacts is not an object.
@samdsou It's an array with 4 elements.
@samdsou Each of those elements is an object.
Sam Soucie
@samdsou
May 30 2017 04:44
okay
Joseph
@revisualize
May 30 2017 04:45
@foxthor Look.
mstellaluna
@mstellaluna
May 30 2017 04:45
@revisualize @Ace-Monkey-Ilium it's been taken care of :)
Ravi Kishore Thella
@ravikishorethella
May 30 2017 04:45
@samdsou if (contacts[i].firstName === firstName){
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:46
Thanks @mstellaluna
CamperBot
@camperbot
May 30 2017 04:46
ace-monkey-ilium sends brownie points to @mstellaluna :sparkles: :thumbsup: :sparkles:
:star2: 1580 | @mstellaluna |http://www.freecodecamp.com/mstellaluna
Joseph
@revisualize
May 30 2017 04:46

@foxthor example:

function addThree (num) { }

When we make the function call of:

addThree(10);

You're calling the function addThree You're also passing a value 10 as an argument.
In the function declaration of function addThree (num) { You see that there is a parameter defined of num
When we do addThree(10) then the value of the parameter num is passed the argument value of ... 10

Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:46
poor child
Joseph
@revisualize
May 30 2017 04:47
@foxthor If I use num in any function anywhere.. It doesn't represent a number.
@foxthor
If you make the function call of addThree(21) the value of num inside the function is 21.
If you make the function call of addThree(1000) the value of num inside the function is 1000.
If you make the function call of addThree(123456) the value of num inside the function is 123456.
Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:48
yes @Bhargavi23 ?
Joseph
@revisualize
May 30 2017 04:48

@foxthor With nextInLine... If you make these function calls:

nextInLine([4,3,2] , 1) the values passed to arr is [4,3,2] and the value passed to item is 1

nextInLine([2,4,6,8] , 10) ... arr is [2,4,6,8] & item is 10

nextInLine([2,3,5,7,11] , 13) ... arr is [2,3,5,7,11] & item is 13 (first 5 and 6th prime numbers)

nextInLine([] , 0) ... arr is [] & item is 0

Ace-Monkey-Ilium
@Ace-Monkey-Ilium
May 30 2017 04:48
how can I help you?
foxthor
@foxthor
May 30 2017 04:48
sure i understand that
ive gone back through the past 10 lessons and cant see how they help in stand in line. are we meant to look through other resources? or should the answers lie in the previous lessons
Joseph
@revisualize
May 30 2017 04:49
@foxthor The answer is in 2 of 4 lessons.
foxthor
@foxthor
May 30 2017 04:49
ok must have missed something. thanks @revisualize
CamperBot
@camperbot
May 30 2017 04:49
foxthor sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:warning: foxthor already gave revisualize points
Joseph
@revisualize
May 30 2017 04:50
@foxthor
Manipulate Arrays With push()
Manipulate Arrays With pop()
Manipulate Arrays With shift()
Manipulate Arrays With unshift()
foxthor
@foxthor
May 30 2017 04:50
yeah looked through them all
i understand how they work,
its more the whole section so many parts are confusing me.

function nextInLine(arr, item) {
// Your code here
arr.push(item);
return item; // Change this line
}

// Test Setup
var testArr = [1,2,3,4,5];

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));

Joseph
@revisualize
May 30 2017 04:51
@foxthor Great.
@foxthor How do you remove the first element from an array?
Dave Reichert
@davidreichert
May 30 2017 04:51
Testing Objects for Properties. I'm stuck
// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  // Your Code Here

  myObj.hasOwnProperty(checkProp);
}

// Test your code by modifying these values
checkObj("gift");
foxthor
@foxthor
May 30 2017 04:51
shift
Joseph
@revisualize
May 30 2017 04:52
@davidreichert .hasOwnProperty() returns a boolean value (true/false) back to the function caller.
@foxthor What does .shift() return back to the function caller?
foxthor
@foxthor
May 30 2017 04:52
what has the console.log before and after have to do with naything
um, im not sure
Joseph
@revisualize
May 30 2017 04:52
@foxthor Not part of the challenge. You just need to focus on the function.
foxthor
@foxthor
May 30 2017 04:53
it doesnt return, right, it removes and element?
Sam Soucie
@samdsou
May 30 2017 04:53
@ravikishorethella I put that once @revisualize told me it was an array, but it's still not working
Joseph
@revisualize
May 30 2017 04:53
@foxthor All functions return something.
Dave Reichert
@davidreichert
May 30 2017 04:53
Joseph
@revisualize
May 30 2017 04:53
@foxthor All methods are functions.
Ravi Kishore Thella
@ravikishorethella
May 30 2017 04:53
@samdsou please send the code
Joseph
@revisualize
May 30 2017 04:53
@davidreichert They're looking for you to write an if statement.
Benny Thomas
@bentom03
May 30 2017 04:53
Hi, can anyone please help me with Convert Celsius to Fahrenheit.
Dave Reichert
@davidreichert
May 30 2017 04:54
i was just going to ask that. ok.
Joseph
@revisualize
May 30 2017 04:54
@bentom03 What have you written?
Benny Thomas
@bentom03
May 30 2017 04:54
function convertToF(celsius) {
var fahrenheit;
// Only change code below this line
var celcius;
fahrenheit = (celcius * (9/5)) + 32;
// Only change code above this line
return fahrenheit;
}
Sam Soucie
@samdsou
May 30 2017 04:54
@ravikishorethella for (var i = 0; i < 4; i++){
if (contacts[i].firstName === firstName){
if (contacts[i].hasOwnProperty(prop)){
return contacts[i].prop;
}else{
return "No such property";
}
}else{
return "No such contact";
}
}
Andrew
@anblave
May 30 2017 04:54
@Marmiz thank you =)
CamperBot
@camperbot
May 30 2017 04:54
anblave sends brownie points to @marmiz :sparkles: :thumbsup: :sparkles:
:cookie: 909 | @marmiz |http://www.freecodecamp.com/marmiz
Joseph
@revisualize
May 30 2017 04:54
@bentom03 celcius ... isn't spelled correctly.
@bentom03 celsius
@bentom03 Remove this: var celcius;
foxthor
@foxthor
May 30 2017 04:56
sorry, in the questions, add number to the end of the array, ok so push item? then remove the first element from the array shift (X element) where is the array in the question? the testArr?
struggling to understand the correlation between the (arr,) in the nextInLine and testArr
Joseph
@revisualize
May 30 2017 04:56
@samdsou regarding: return contacts[i].prop;
Dot Notation is converting the value to a string (string literal). Example: myObj.name; is the same as myObj["name"]; and as we all know quotes define strings. If you want to use a variable for accessing the value of object properties you cannot use Dot Notation. You have to use Bracket Notation. Example: var num = 42; myObj[num];
Benny Thomas
@bentom03
May 30 2017 04:56
@revisualize Thanks Pal! It was only a spelling error.
CamperBot
@camperbot
May 30 2017 04:56
bentom03 sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 4049 | @revisualize |http://www.freecodecamp.com/revisualize
Joseph
@revisualize
May 30 2017 04:56
@foxthor Look.
@foxthor testArr is a global variable.
foxthor
@foxthor
May 30 2017 04:57
sure
Joseph
@revisualize
May 30 2017 04:58
@foxthor If I have this code:
function addThree (num) {
    var result;
    result = num + 3;
    return result;
}
var someNumber = 2000;
foxthor
@foxthor
May 30 2017 04:58
yeah?
Dave Reichert
@davidreichert
May 30 2017 04:58
i feel like i'm close
// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  // Your Code Here

  if (myObj.hasOwnProperty(checkProp) = true) 
  {return myObj;
} else {return "Not Found"}
}
// Test your code by modifying these values
checkObj("gift");
Joseph
@revisualize
May 30 2017 04:58
@foxthor What is the value of the function parameter of num if I make the function call:
addThree(someNumber);
@davidreichert first off.. Your if condition. = is assignment not comparison.
@davidreichert How do you return an object property value using a variable?
foxthor
@foxthor
May 30 2017 05:00
num is not defined
Joseph
@revisualize
May 30 2017 05:00
@foxthor Incorrect.
foxthor
@foxthor
May 30 2017 05:01
num is just like X in algebra right?
Joseph
@revisualize
May 30 2017 05:01

@foxthor If I have this code:

function addThree (num) {
    var result;
    result = num + 3;
    return result;
}
var someNumber = 2000;

@foxthor What is the value of the function parameter of num if I make the function call:
addThree(someNumber);

foxthor
@foxthor
May 30 2017 05:02
does it just become someNumber? so 2000?
Joseph
@revisualize
May 30 2017 05:02
@foxthor Yes.
foxthor
@foxthor
May 30 2017 05:03
so num is just a variable waiting to be defined by calling the function?
Joseph
@revisualize
May 30 2017 05:03

@foxthor Yes. Except it is called a parameter.
By doing this:

var myArr = [1,3,5,7];
nextInLine(myArr , 9);

arr is [1,3,5,7] a copy of the value of the global variable myArr
&
item is 9

Anker
@ankerpeet
May 30 2017 05:04
@foxthor its a parameter of the function
foxthor
@foxthor
May 30 2017 05:04
ok why is arr the same as myArr?
Joseph
@revisualize
May 30 2017 05:04
@foxthor Because the parameter gets assign the same value as the thing passed.
@foxthor If I have a basket that holds 10 apples. And I hand you the basket. How many apples do you have?
foxthor
@foxthor
May 30 2017 05:05
yeah sure 10
but how is arr holding myArr
Joseph
@revisualize
May 30 2017 05:06
@foxthor myArr is just like the basket. It is a variable that holds a value.
foxthor
@foxthor
May 30 2017 05:06
its not even define din your code
Joseph
@revisualize
May 30 2017 05:06
@foxthor Look.
foxthor
@foxthor
May 30 2017 05:06
sure i understand var
just dont get how arr somehow correlates to a global variable
Joseph
@revisualize
May 30 2017 05:06

@foxthor If I have this code:

function addThree (num) {
    var result;
    result = num + 3;
    return result;
}

So, when we make the function call of:

addThree(10);

You're calling the function addThree You're also passing a value 10 as an argument.
In the function declaration of function addThree (num) { You see that there is a parameter defined of num
When we do addThree(10) then the value of the parameter num is passed the argument value of ... 10
Then if you follow the code through.. result = num + 3; ... and we know the value of num is 10.
Therefore, if we follow through the function we end up with ... result = 10 + 3; then result = 13; then we return the result.
...
If you then make another function call..

addThree(39);

You can use the same function to follow the operation:
When we do addThree(39) then the value of the parameter num is passed the argument value of ... 39
Then if you follow the code through.. result = num + 3; ... and we know the value of num is now 39.
Therefore, if we follow through the function we end up with ... result = 39 + 3; then result = 42; then we return the result.

If you make the function call of addThree(21) the value of num inside the function is 21.
If you make the function call of addThree(1000) the value of num inside the function is 1000.
If you make the function call of addThree(123456) the value of num inside the function is 123456.

foxthor
@foxthor
May 30 2017 05:08
that all makes sense
Markus Kiili
@Masd925
May 30 2017 05:08
@foxthor More theoretically speaking, when you call a function, an execution context is formed (a place where the function code is run and variables live) and there those parameters become variables that hold the passed arguments. That is why you can use them inside the function code just like variables.
foxthor
@foxthor
May 30 2017 05:08
but this for example
Joseph
@revisualize
May 30 2017 05:08
If you have a global variable:
var someNumber = 2000;
And you make the function call of:
addThree(someNumber);
the value of someNumber ... 2000 gets passed through to the function.
and the value of the parameter num in the function is 2000
foxthor
@foxthor
May 30 2017 05:08

function nextInLine(arr, item) {
// Your code here

return item; // Change this line
}

// Test Setup
var testArr = [1,2,3,4,5];

how is variable testArr got a relation to arr in the function above it
Joseph
@revisualize
May 30 2017 05:09
@foxthor if you make the function call
nextInLine(testArr, 20);
The value of arr is an array [1,2,3,4,5]
And the value of item is 20
foxthor
@foxthor
May 30 2017 05:10
yep
Joseph
@revisualize
May 30 2017 05:10
@foxthor Variables hold values.
foxthor
@foxthor
May 30 2017 05:10
sure i get that
Dave Reichert
@davidreichert
May 30 2017 05:10
ok. i got it. but i don't understand why i got it. can you explain?
// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  // Your Code Here

  if (myObj.hasOwnProperty(checkProp)) 
  {return myObj[checkProp];
} else {return "Not Found"};
}
// Test your code by modifying these values
checkObj("house");
Joseph
@revisualize
May 30 2017 05:10
@foxthor Function arguments are passed by value.

@davidreichert So you have a function declaration of function checkObj(checkProp) { } .. With that function declaration you have a function name of checkObj and you have a parameter of checkProp.
Parameters are treated like variables that represent the values that get passed into your function from the function call (arguments).
So, when you make a function call:
checkObj("pet") ... the parameter checkProp gets the value of the arguement "pet".
checkObj("horse") ... the parameter checkProp gets the value of the arguement "horse".
As mentioned above, you can then use the parameter inside of the function just like you'd use any other variable that holds a value.
Now, the lesson is trying to teach you about the object method .hasOwnProperty()

The hasOwnProperty() method returns a boolean (true/false) indicating whether the object has the specified property as own (not inherited) property.

foxthor
@foxthor
May 30 2017 05:12
i think i understand.. will try and solve it now.
thanks @revisualize
CamperBot
@camperbot
May 30 2017 05:13
foxthor sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:warning: foxthor already gave revisualize points
Joseph
@revisualize
May 30 2017 05:13
@foxthor Didn't you already solve it?!
foxthor
@foxthor
May 30 2017 05:13
no not yet
Joseph
@revisualize
May 30 2017 05:14

@foxthor You had this:
:point_up: May 29, 2017 9:50 PM
Then I asked:

@foxthor How do you remove the first element from an array?

you responded with

shift

Then I asked

@foxthor What does .shift() return back to the function caller?

@davidreichert Does that help?
revisualize @revisualize goes AFK.
Joseph
@revisualize
May 30 2017 05:18
I'm back.
Jean-Paul Sauve
@jp-sauve
May 30 2017 05:22
I need some help. I'm trying to use navigator object, but none of my browsers (FF&Chrome) ask for permission to share location, and FF, which actually gave me a navigator object, only has:
Navigator { permissions: Permissions, mimeTypes: MimeTypeArray, plugins: PluginArray, doNotTrack: "unspecified", oscpu: "Linux x86_64", vendor: "", vendorSub: "", productSub: "20100101", cookieEnabled: true, buildID: "20170523163538" }
foxthor
@foxthor
May 30 2017 05:22
why when i change return item; to return arr,item; console.log(nextInline(testArr, 6)); results in the same thing as the original return method. still results in 6. the testArr does not show
Joseph
@revisualize
May 30 2017 05:23
@foxthor Show me.
Dave Reichert
@davidreichert
May 30 2017 05:24
@revisualize I really want to say it as if ...hasOwnProp... is true or something like that. But I feel like I just threw it out there and it's not saying anything, it's just there, but it works
Joseph
@revisualize
May 30 2017 05:24
@foxthor You're supposed to be removing the first element from the array and returning that element.

@foxthor If I asked you..

var myArr = [8,6,4,2];

How do you remove the first element from the array?

foxthor
@foxthor
May 30 2017 05:25
sprry my FCC is gone and im in fullscreen gitter
how do i return.. haha
Joseph
@revisualize
May 30 2017 05:26
@davidreichert .hasOwnProperty() is a method that returns a boolean value.
@davidreichert if conditions work on boolean values.
foxthor
@foxthor
May 30 2017 05:26
from that array, myArr.shift();
Joseph
@revisualize
May 30 2017 05:26
@foxthor What does .shift() return back to the function caller?
foxthor
@foxthor
May 30 2017 05:26
no idea
@foxthor The shift() method removes the first element from an array and returns that element.
@foxthor If you use the push() method it adds one or more elements to the end of an array and returns the new length of the array.
foxthor
@foxthor
May 30 2017 05:29
ok
Joseph
@revisualize
May 30 2017 05:29

So, If you do something like

var myArr = [2,4,6];
var len = myArr.push(8);

the value of the variable len is 4

foxthor
@foxthor
May 30 2017 05:30
hmm,
Joseph
@revisualize
May 30 2017 05:30
and the value of myArr is [2,4,6,8]
Then if you do
foxthor
@foxthor
May 30 2017 05:30
ok yeah
Joseph
@revisualize
May 30 2017 05:30
var removed = myArr.shift();
the value of removed is 2.
And the value of myArr is [4,6,8]
Jean-Paul Sauve
@jp-sauve
May 30 2017 05:31
does this work for anyone? http://html5demos.com/geo
foxthor
@foxthor
May 30 2017 05:31
sure
Joseph
@revisualize
May 30 2017 05:31

@jp-sauve geolocation

Finding your location: failed

@foxthor So.
foxthor
@foxthor
May 30 2017 05:31
@jp-sauve same for me, geolocation
Finding your location: failed
Joseph
@revisualize
May 30 2017 05:32
@foxthor How do you remove and return the first element from the array and return the element that was removed?
foxthor
@foxthor
May 30 2017 05:33
array.shift(); then return (shift);
Joseph
@revisualize
May 30 2017 05:33
@foxthor Show me.
foxthor
@foxthor
May 30 2017 05:34
how?
Dave Reichert
@davidreichert
May 30 2017 05:34
@revisualize so that then a boolean "false" automatically kicks it down to the else?
Joseph
@revisualize
May 30 2017 05:34
@foxthor Write code into your nextInLine function ... copy and paste into chat?
Jean-Paul Sauve
@jp-sauve
May 30 2017 05:34
it fails on chrome android too. I don't understand why it fails everywhere, but the documentation makes it sound like it works just fine.
Joseph
@revisualize
May 30 2017 05:34
@davidreichert That's how if statements work.
Dave Reichert
@davidreichert
May 30 2017 05:35
i guess this...
Joseph
@revisualize
May 30 2017 05:35
@davidreichert
if (false) {
    return "true Stuff";
} else {
    return "false Stuff";
}
Dave Reichert
@davidreichert
May 30 2017 05:35
is the first lesson...
combining Boolean with if statements
foxthor
@foxthor
May 30 2017 05:36
it failed
shift not defined

function nextInLine(arr, item) {
// Your code here
testArr.shift();

return (shift,item); // Change this line
}

Joseph
@revisualize
May 30 2017 05:36
@foxthor Where did your other code go?
@foxthor Why are you now using testArr inside of your function?
Aizaz Shahid
@aizazshahid
May 30 2017 05:36
@foxthor you should to use the parameters instead of global ones.
foxthor
@foxthor
May 30 2017 05:36

function nextInLine(arr, item) {
// Your code here
testArr.shift();

return (shift,item); // Change this line
}

// Test Setup
var testArr = [1,2,3,4,5];

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));

Joseph
@revisualize
May 30 2017 05:36
@foxthor What happened to arr.push(item);?
@forwebtech Good luck.
I got to jet.
I have to fold laundry.
Aizaz Shahid
@aizazshahid
May 30 2017 05:37
:+1:
foxthor
@foxthor
May 30 2017 05:37
item is already here console.log(nextInLine(testArr, 6))
6 is item right?
Aizaz Shahid
@aizazshahid
May 30 2017 05:37
@foxthor first you need to add the item to the arr and then the first element should be remove from the element and also return it
Joseph
@revisualize
May 30 2017 05:38
@forwebtech I've been working with him on that challenge for like 50 minutes.
foxthor
@foxthor
May 30 2017 05:38
sorry man
Aizaz Shahid
@aizazshahid
May 30 2017 05:38
hahaha
foxthor
@foxthor
May 30 2017 05:38
forget it, il just have to keep trying
Aizaz Shahid
@aizazshahid
May 30 2017 05:38
well let me try then :D
Joseph
@revisualize
May 30 2017 05:39
Correction. 1 hour 15 minutes.
Aizaz Shahid
@aizazshahid
May 30 2017 05:39
@foxthor did you understand the instructions ?
got it !
Joseph
@revisualize
May 30 2017 05:39

Stand In Line is a CheckPoint where you're supposed to:
Write a function nextInLine which has two parameters
an array (arr) and a number (item).
That part has been done for you here:

function nextInLine(arr, item) { }

With that function declaration you have a function name of nextInLine. You have two parameters arr which represents an array passed into the function and item that represents a number passed to the function.
A few example function calls:

nextInLine([4,3,2] , 1) the values passed to arr is [4,3,2] and the value passed to item is 1

nextInLine([2,4,6,8] , 10) ... arr is [2,4,6,8] & item is 10

nextInLine([2,3,5,7,11] , 13) ... arr is [2,3,5,7,11] & item is 13 (first 5 and 6th prime numbers)

nextInLine([] , 0) ... arr is [] & item is 0

var myArr = [1,3,5,7]; nextInLine(myArr , 9) ... arr is [1,3,5,7] a copy of the value of the global variable myArr & item is 9

Parameters are treated like variables that represent the values that get passed into your function from the function call (arguments).

Again the two parameters for the nextInLine function are arr & item.

Per the instructions: Add the number to the end of the array, then remove the first element of array. The nextInLine function should then return the element that was removed.

You need to add the number (item) to the end of an array (arr).
You also need to remove the first element from an array (arr).

Then you need to have your function return the removed element from the array arr.

Aizaz Shahid
@aizazshahid
May 30 2017 05:39
@revisualize well some folks just started from FCC so it will take time to grip on concepts. :+1:
Joseph
@revisualize
May 30 2017 05:40

The push() method adds one or more elements to the end of an array and returns the new length of the array.

The pop() method removes the last element from an array and returns that element.

The unshift() method adds one or more elements to the beginning of an array and returns the new length of the array.

The shift() method removes the first element from an array and returns that element.

@forwebtech I know.
Dave Reichert
@davidreichert
May 30 2017 05:40
what is console.log() ?
foxthor
@foxthor
May 30 2017 05:41
been getting through it all pretty quick, then this one kills me
Aizaz Shahid
@aizazshahid
May 30 2017 05:41
@davidreichert it prints the arguments to the browser console.
foxthor
@foxthor
May 30 2017 05:41
maybe need to take a break and come back or something.
Aizaz Shahid
@aizazshahid
May 30 2017 05:41
@foxthor sure ! and also copy that instruction which @revisualize told, so read it after you will come back.
Dave Reichert
@davidreichert
May 30 2017 05:41
thanks @revisualize thanks @forwebtech
CamperBot
@camperbot
May 30 2017 05:41
davidreichert sends brownie points to @revisualize and @forwebtech :sparkles: :thumbsup: :sparkles:
:cookie: 622 | @forwebtech |http://www.freecodecamp.com/forwebtech
:star2: 4050 | @revisualize |http://www.freecodecamp.com/revisualize
Joseph
@revisualize
May 30 2017 05:42
@forwebtech I just find it frustrating when I tell people things or I show them things and they say that they get it. But, then when I ask them a question about what I just showed them. They don't have an answer. Or if I ask them a question ... they respond with a non-answer answer.
Like if I was to ask someone. "What are you drinking?" and they responded with ... "A liquid".
I'd most likely retort with some smartass remark like... "I'd love to see you drink a solid. Just to watch you choke."
I just think I'm getting snarky and frustrated.
I wonder if I need to rewrite some of my pre-written text.
Aizaz Shahid
@aizazshahid
May 30 2017 05:45
hmm well i think they wants to test the patience :D
Joseph
@revisualize
May 30 2017 05:45
Like the problem is me.
Markus Kiili
@Masd925
May 30 2017 05:46
@revisualize Remember that learning the basics of programming is hard for many people. Helping is hard too sometimes.
Joseph
@revisualize
May 30 2017 05:47
@Masd925 I know.
eyesore-
@eyesore-
May 30 2017 05:47
You definitely need to test your patience.
Ashish Patel
@ashishpatelcs
May 30 2017 05:47
Hello everyone!
foxthor
@foxthor
May 30 2017 05:47
hey @revisualize not trying to mess with u, i genuinely am confused.
Ashish Patel
@ashishpatelcs
May 30 2017 05:47
Patience is the key!
Joseph
@revisualize
May 30 2017 05:47
I think I need to sit down and listen to the Art of War and the Book of Five Rings audiobooks again.
foxthor
@foxthor
May 30 2017 05:48
my brain isnt working with this one atm
Joseph
@revisualize
May 30 2017 05:48
@foxthor Look.
@foxthor Let's just walk though this.
Aizaz Shahid
@aizazshahid
May 30 2017 05:48
@foxthor well aren't you going to walk ?
Joseph
@revisualize
May 30 2017 05:48

@foxthor Stand In Line is a CheckPoint where you're supposed to:
Write a function nextInLine which has two parameters
an array (arr) and a number (item).
That part has been done for you here:

function nextInLine(arr, item) { }

With that function declaration you have a function name of nextInLine. You have two parameters arr which represents an array passed into the function and item that represents a number passed to the function.

@foxthor How do you add a number (item) to the end of an array (arr)? ... (Show me)
foxthor
@foxthor
May 30 2017 05:50
thinking...
Aizaz Shahid
@aizazshahid
May 30 2017 05:50
@foxthor see that mdn.io/push and try to learn that method
@foxthor then comeback and give answer to @revisualize
Joseph
@revisualize
May 30 2017 05:51
@forwebtech I know that he knows the answer. He's written into chat 3 times now.
@forwebtech He may not know that he knows the answer.
Aizaz Shahid
@aizazshahid
May 30 2017 05:51
@revisualize then that is a real mess !
:laughing:
foxthor
@foxthor
May 30 2017 05:52
maybe i have spent too long on this. i know .push() adds an element to the end of an array
Joseph
@revisualize
May 30 2017 05:52
@foxthor Great.
@foxthor That is correct.
But,
@foxthor How do you add a number (item) to the end of an array (arr)? ... (Show me)
Aizaz Shahid
@aizazshahid
May 30 2017 05:53
@revisualize he needs to do some practice with those methods i think.
Joseph
@revisualize
May 30 2017 05:53
@forwebtech We've done that.
@forwebtech :point_up: May 29, 2017 10:29 PM
Aakriti
@Aakriti94
May 30 2017 05:55
@revisualize through .push()
Joseph
@revisualize
May 30 2017 05:55
@forwebtech He even wrote it in here: :point_up: May 29, 2017 9:50 PM
Aizaz Shahid
@aizazshahid
May 30 2017 05:55
@revisualize in that case he should try himself !
foxthor
@foxthor
May 30 2017 05:56
so yeah, .push(X)
x = an arbitrary number
Joseph
@revisualize
May 30 2017 05:56
@foxthor That isn't the answer that I'm looking for.
@foxthor How do you add a number (item) to the end of an array (arr)? ... (Show me)
Aakriti
@Aakriti94
May 30 2017 05:56
@revisualize
var arr = [1, 2, 3]; arr.push(4); //arr = [1,2,3,4];
@revisualize is it helpful?
Joseph
@revisualize
May 30 2017 05:57
@Aakriti94 I know the answer. I'm trying to get @foxthor to answer the question.
foxthor
@foxthor
May 30 2017 05:57
so yeah as above
Aakriti
@Aakriti94
May 30 2017 05:58
@revisualize but why? thats so stupid
Joseph
@revisualize
May 30 2017 05:58
@foxthor What @Aakriti94 isn't how you add a number (item) to the end of an array (arr).
Aizaz Shahid
@aizazshahid
May 30 2017 05:58
@foxthor well where do you stuck then ?
Joseph
@revisualize
May 30 2017 05:58
@Aakriti94 No it isn't.
Aakriti
@Aakriti94
May 30 2017 05:58
@revisualize alright!! then u might have a purpose
Joseph
@revisualize
May 30 2017 05:59
@Aakriti94 They're working on Stand in Line. I'm trying to help them to solve it.
Aizaz Shahid
@aizazshahid
May 30 2017 05:59
@foxthor and do you know about parameters ?
Aakriti
@Aakriti94
May 30 2017 05:59
sure :) sorry!
foxthor
@foxthor
May 30 2017 05:59
ok so that was not how you do it>
Ashish Patel
@ashishpatelcs
May 30 2017 05:59
@Aakriti94 he might be tutoring him. A good cause, that is.
foxthor
@foxthor
May 30 2017 06:00
ok maybe i need to ask this, cause maybe this is where my confusion lies. is a number (item) the same as a particular number inside an array. for eg. arr = [1,2,3,4]
the item or number is not one of those numbers?
Aakriti
@Aakriti94
May 30 2017 06:00
@ashishpatelcs yeah, i understood it later :p
Joseph
@revisualize
May 30 2017 06:01

@foxthor
function calls:

nextInLine([4,3,2] , 1) the values passed to arr is [4,3,2] and the value passed to item is 1

nextInLine([2,4,6,8] , 10) ... arr is [2,4,6,8] & item is 10

nextInLine([2,3,5,7,11] , 13) ... arr is [2,3,5,7,11] & item is 13

nextInLine([] , 0) ... arr is [] & item is 0

Aizaz Shahid
@aizazshahid
May 30 2017 06:01
@foxthor no item is an other argument which passed when calling that function, it actually a new value which needs to enter in arr.
foxthor
@foxthor
May 30 2017 06:01
ok
Markus Kiili
@Masd925
May 30 2017 06:02
@foxthor When the function is called and executed, those parameters arr and item hold the passed array and number whatever they are. By using the parameters in the function code, you make the function work with any passed arguments.
Aakriti
@Aakriti94
May 30 2017 06:02
@revisualize i like the way u help!! :clap:
Joseph
@revisualize
May 30 2017 06:02
@Aakriti94 But, you said it was stupid.
Aakriti
@Aakriti94
May 30 2017 06:03
@revisualize too quick to judge!!
foxthor
@foxthor
May 30 2017 06:03
thanks @revisualize @forwebtech @Masd925
CamperBot
@camperbot
May 30 2017 06:03
foxthor sends brownie points to @revisualize and @forwebtech and @masd925 :sparkles: :thumbsup: :sparkles:
:cookie: 623 | @forwebtech |http://www.freecodecamp.com/forwebtech
:star2: 4051 | @revisualize |http://www.freecodecamp.com/revisualize
:star2: 4162 | @masd925 |http://www.freecodecamp.com/masd925
Jean-Paul Sauve
@jp-sauve
May 30 2017 06:03
It could be that I'm too dumb to figure it out, but even google's example of their geolocation api fails after asking me for permission
Aizaz Shahid
@aizazshahid
May 30 2017 06:04
@jp-sauve their geolocation api is free !
foxthor
@foxthor
May 30 2017 06:04
i dont believe there was a lesson on how to push a (item) to and array
Ashish Patel
@ashishpatelcs
May 30 2017 06:04
@jp-sauve tried different browser?
foxthor
@foxthor
May 30 2017 06:04
im going to gogle
Joseph
@revisualize
May 30 2017 06:04
@foxthor There was a lesson about how to .push() a value to the end of an array.
@foxthor item is just a parameter for the function.
You treat it just like a variable.
Aizaz Shahid
@aizazshahid
May 30 2017 06:05
@jp-sauve Geolocation
Joseph
@revisualize
May 30 2017 06:06
@foxthor How do you .push() a variable to the end of an array if that array is arr? What if that variable is item?
foxthor
@foxthor
May 30 2017 06:07
so.. var myArr = [1,2,3,4]
var item = 1
myArr.push(item);
Joseph
@revisualize
May 30 2017 06:07
@foxthor What if the array is arr?
Manish Giri
@Manish-Giri
May 30 2017 06:08
@Aakriti94 :wave:
Aakriti
@Aakriti94
May 30 2017 06:08
@Manish-Giri hey
Jean-Paul Sauve
@jp-sauve
May 30 2017 06:09
it works in chrome. I've read that on the desktop, firefox uses google's location lookup, and they keep hitting their api key's rate limit. but why does google's example fail in FF after me saying it's allowed
Aizaz Shahid
@aizazshahid
May 30 2017 06:09
@jp-sauve what is your code ?
@jp-sauve did you set the API key in :
<script async defer
    src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap">
    </script>
foxthor
@foxthor
May 30 2017 06:09
var arr = [1,2,3,4]
var item = 1
arr.push(item);
Joseph
@revisualize
May 30 2017 06:09
@foxthor GREAT!
Jean-Paul Sauve