These are chat archives for FreeCodeCamp/HelpJavaScript

8th
Nov 2016
Diego Mayer
@Chrono79
Nov 08 2016 00:02
@awb715 remove [i]and [a] from your loop conditions
     for(i=0;i<info[1].length; i++){
           var tdata= info[1][i]
          $("<p></p>").text("Text.");

        }

          for(a=0;a<info[2].length; a++){
          var test =[];
          test.push(info[2][a]);
            console.log(test);

        }
Adolfo Saenz
@AdoSae1
Nov 08 2016 00:02

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

return arr.push(item);// Change this line
}
nextInLine([0],1);

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

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

this is what i got
still wrong
Salomon
@zarruk
Nov 08 2016 00:03
Hello. Can somebody help me with the Exact Change challenge?
I don't find how it is expected for me to use objects in the challenge
tvithaya
@tvithaya
Nov 08 2016 00:05
@AdoSae1 what's the name of that tutorial?
Adolfo Saenz
@AdoSae1
Nov 08 2016 00:05
@tvithaya Stand in Line
eastuger
@eastuger
Nov 08 2016 00:06
@AdoSae1 you are not removing the first item from the array and returning
Adolfo Saenz
@AdoSae1
Nov 08 2016 00:07
its .shift() right
Aaron Bell
@awb715
Nov 08 2016 00:07
@Chrono79 thanks!
CamperBot
@camperbot
Nov 08 2016 00:07
awb715 sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:star2: 2447 | @chrono79 |http://www.freecodecamp.com/chrono79
tvithaya
@tvithaya
Nov 08 2016 00:07
@AdoSae1 set testArr to arr
Adolfo Saenz
@AdoSae1
Nov 08 2016 00:08
@tvithaya nothing
Johnny
@JohnnyBizzel
Nov 08 2016 00:09
@AdoSae1 use .shift() yes.
Note that .shift() will return the value removed!
Adolfo Saenz
@AdoSae1
Nov 08 2016 00:10
where would i add .shift() though
eastuger
@eastuger
Nov 08 2016 00:10
@AdoSae1
F it to tired to be cryptic XD
arr.push(item)
var first = arr.shift()
return first
Johnny
@JohnnyBizzel
Nov 08 2016 00:11
OR better:
arr.push(item);
return arr.shift();
eastuger
@eastuger
Nov 08 2016 00:11
yeah i wasted some memory there thanks :smile:
Adolfo Saenz
@AdoSae1
Nov 08 2016 00:13
god thats confusing as hell to me
tvithaya
@tvithaya
Nov 08 2016 00:15
@AdoSae1
does this break it down better?
testArr = arr;
testArr.push(item);
return testArr.shift();
idk how to display it as an image lie @eastuger & @JohnnyBizzel did
Owa Aquino
@owaaquino
Nov 08 2016 00:15
question: when should you and when shouldn't use a function on your javascript?
Adolfo Saenz
@AdoSae1
Nov 08 2016 00:16
i kind of get it now because they posted the answer
Johnny
@JohnnyBizzel
Nov 08 2016 00:16
'''
CamperBot
@camperbot
Nov 08 2016 00:16
:bulb: to format code use backticks! ``` more info
Adolfo Saenz
@AdoSae1
Nov 08 2016 00:16
but still meh about it
Johnny
@JohnnyBizzel
Nov 08 2016 00:16
@AdoSae1 Why?
eastuger
@eastuger
Nov 08 2016 00:16
@owaaquino
google seperation of concerns
Johnny
@JohnnyBizzel
Nov 08 2016 00:16
@owaaquino functions are re-usable code
Adolfo Saenz
@AdoSae1
Nov 08 2016 00:17
@JohnnyBizzel
tvithaya
@tvithaya
Nov 08 2016 00:17
'''
CamperBot
@camperbot
Nov 08 2016 00:17
:bulb: to format code use backticks! ``` more info
Adolfo Saenz
@AdoSae1
Nov 08 2016 00:17
dont know everything stuck until this
Johnny
@JohnnyBizzel
Nov 08 2016 00:17
@AdoSae1 :confused:
Adolfo Saenz
@AdoSae1
Nov 08 2016 00:17
i look at it and i can see why it makes sense
but pissed at myself for not getting it
;/
Johnny
@JohnnyBizzel
Nov 08 2016 00:18
@AdoSae1 Then you are learning.
@AdoSae1 It is not clear from the MDN docs that shift() returns the value. (From what I remember)
tvithaya
@tvithaya
Nov 08 2016 00:19
the wording had me confused at first, until i relized value stored in testArr has to change
@tvithaya you shouldn't use testArr at all, you should use arr (your function parameter)
tvithaya
@tvithaya
Nov 08 2016 00:21
'''
testArr = arr;
testArr.push(item);
return testArr.shift();
'''
CamperBot
@camperbot
Nov 08 2016 00:21
:bulb: to format code use backticks! ``` more info
eastuger
@eastuger
Nov 08 2016 00:21
@Chrono79 testArr and arr are essenstialy the same
Joseph
@revisualize
Nov 08 2016 00:21
La la la
@eastuger No they aren't.
tvithaya
@tvithaya
Nov 08 2016 00:21
lol tried pasting the code, didn't work
but that's how I did it, i assigned the testArr to the value of arr
Johnny
@JohnnyBizzel
Nov 08 2016 00:22
@Chrono79 Sorry I don't know what @AdoSae1 did so maybe he did not read this?
Diego Mayer
@Chrono79
Nov 08 2016 00:22
@JohnnyBizzel maybe not ;)
Joseph
@revisualize
Nov 08 2016 00:22
@tvithaya Why are you overwriting arr?
Diego Mayer
@Chrono79
Nov 08 2016 00:22
@revisualize he's overwriting testArr
Joseph
@revisualize
Nov 08 2016 00:23
Oh!
eastuger
@eastuger
Nov 08 2016 00:23
@revisualize yes they are just change the numbers in testArr. testArr is just a simple unit test
Joseph
@revisualize
Nov 08 2016 00:24
I disagree.
nextInLine([], 1); // should return 1
nextInLine([2], 1); // should return 2
nextInLine([5,6,7,8,9], 1); // should return 5
After nextInLine(testArr, 10); // testArr[4] should be 10
Only one of the tests uses testArr.
eastuger
@eastuger
Nov 08 2016 00:26
you don't need to change the parameters within the function for this to work...
Diego Mayer
@Chrono79
Nov 08 2016 00:26
@eastuger you overwrite the global var testArr the way @tvithaya wrote
https://repl.it/ERbB/0
It goes against encapsulation
eastuger
@eastuger
Nov 08 2016 00:26
@no you don't need to overwrite anything

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

  arr.push(item)
  return arr.shift()

}

// Test Setup
var testArr = [2,2,3,89,54444];
Joseph
@revisualize
Nov 08 2016 00:27
@eastuger That is correct.
Do you know how many people come in here and do this:
Diego Mayer
@Chrono79
Nov 08 2016 00:27
@eastuger that's why we told not to use testArr inside the function
Joseph
@revisualize
Nov 08 2016 00:27
function nextInLine(arr, item) {
  // Your code here
  testArr.push(item); // NOTE THIS IS WRONG.
  return testArr.shift(); // NOTE THIS IS WRONG.
}
tvithaya
@tvithaya
Nov 08 2016 00:27
@eastuger yea, i tested this and realized it works, but at the time of reading the section, that's what I assumed it was asking for
Joseph
@revisualize
Nov 08 2016 00:28
@eastuger By saying that testArr and arr are the same thing. You're saying incorrect information.
tvithaya
@tvithaya
Nov 08 2016 00:28
that being, the way I wrote, changing the global var value
Joseph
@revisualize
Nov 08 2016 00:28
Because one is correct and one is NOT.
Diego Mayer
@Chrono79
Nov 08 2016 00:29
@tvithaya :+1: if you get now why they're not the same thing
eastuger
@eastuger
Nov 08 2016 00:31
@revisualize i said it was a unit test. behind the scenes the values of testArr gets written to arr. anyway spending way to much time on this was fun talking to you guys till next time good night
Stephanie
@spennypacker
Nov 08 2016 00:31

I am trying to set the remainder equal to the remainder of 11 divided by 3 using the remainder operator but I am just stumped on where to actually put %

var remainder =
var remainder = 2;
var remainder =

Lucas
@lucas032689
Nov 08 2016 00:31
I'm having some issue with camel case in javascript, can anyone help?
Ryan McMahon
@Radio-Mac
Nov 08 2016 00:32
@spennypacker Use % in lieu of the /
Kenneth Malicay
@kennethlumalicay
Nov 08 2016 00:32
peeps
Ryan McMahon
@Radio-Mac
Nov 08 2016 00:32
Speaking of which, anyone know of a good Javascript debugger?
Joseph
@revisualize
Nov 08 2016 00:32
@spennypacker What is the value of num in:
num = 27 + 3;???
Kenneth Malicay
@kennethlumalicay
Nov 08 2016 00:32
I hit a wall on permutations. I don't freakin get it.
permAlone("aab") should return 2.
but...
permAlone("aaab") should return 0.
WHYYYYY?
Stephen James
@sjames1958gm
Nov 08 2016 00:32
@spennypacker % goes betwen the two operands
Joseph
@revisualize
Nov 08 2016 00:32
@Radio-Mac pythontutor.com
Ryan McMahon
@Radio-Mac
Nov 08 2016 00:32
@revisualize Thanks
CamperBot
@camperbot
Nov 08 2016 00:32
:star2: 2265 | @revisualize |http://www.freecodecamp.com/revisualize
gabriel poissant
@gabpoiss
Nov 08 2016 00:32

`function orderMyLogic(val) {
if (val < 10 && val > 5) {
return "Less than 10";
} else if (val < 5 && val >= 10) {
return "Less than 5";
} else {
return "Greater than or equal to 10";
}
}

// Change this value to test
orderMyLogic(4);
` Whats the problem here? Why is 4 not giving back "Less then 5?"

CamperBot
@camperbot
Nov 08 2016 00:32
radio-mac sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
Stephen James
@sjames1958gm
Nov 08 2016 00:33
@kennethlumalicay aaab returns zero because there is no permutation where there is no adjacent as
Diego Mayer
@Chrono79
Nov 08 2016 00:33
@gabpoiss you don't need to add conditions, you should reorder them
and there is no number that can satisfy these 2: val < 5 && val >= 10
Kenneth Malicay
@kennethlumalicay
Nov 08 2016 00:33
@sjames1958gm shouldn't the permutation be baaa, abaa, aaba?
Stephanie
@spennypacker
Nov 08 2016 00:34
@sjames1958gm like this? var remainder = (11 % 3) = 2
because its not accepting that
Stephen James
@sjames1958gm
Nov 08 2016 00:34
@kennethlumalicay Return the number of total permutations of the provided string that don't have repeated consecutive letters.
@spennypacker Because 11 % 3 is already 2 you don't need the extra = 2
Joseph
@revisualize
Nov 08 2016 00:35
@spennypacker What is the value of num in this code?
num = 27 + 3;?
does anyone see why the title is coming 2nd?
Stephanie
@spennypacker
Nov 08 2016 00:35
@sjames1958gm that was it! thanks
CamperBot
@camperbot
Nov 08 2016 00:35
spennypacker sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 4235 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Nov 08 2016 00:36
@spennypacker Also you cannot have 11 % 3 to the left of =
var remainder = (11 % 3) = 2
VM138382:1 Uncaught ReferenceError: Invalid left-hand side in assignment
Kenneth Malicay
@kennethlumalicay
Nov 08 2016 00:36
@sjames1958gm ok that makes more sense now. thanks. Hope I can unstuck myself in this challenge.
CamperBot
@camperbot
Nov 08 2016 00:36
kennethlumalicay sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 4236 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Joseph
@revisualize
Nov 08 2016 00:36
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
gabriel poissant
@gabpoiss
Nov 08 2016 00:36
@Chrono79 Thanks
CamperBot
@camperbot
Nov 08 2016 00:36
gabpoiss sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:star2: 2448 | @chrono79 |http://www.freecodecamp.com/chrono79
Diego Mayer
@Chrono79
Nov 08 2016 00:37
no problem
Adam
@adamakers
Nov 08 2016 00:37
anyone know what => is?
Diego Mayer
@Chrono79
Nov 08 2016 00:37
@adamakers arrow notation
silver537
@silver537
Nov 08 2016 00:38
for functions
Adam
@adamakers
Nov 08 2016 00:38
awesome thank you. Google wasn't registering it when I was typing it in
@Chrono79 @silver537 thanks
CamperBot
@camperbot
Nov 08 2016 00:38
adamakers sends brownie points to @chrono79 and @silver537 :sparkles: :thumbsup: :sparkles:
:cookie: 692 | @silver537 |http://www.freecodecamp.com/silver537
:star2: 2449 | @chrono79 |http://www.freecodecamp.com/chrono79
Lucas
@lucas032689
Nov 08 2016 00:42
I have two elements that aren't clearing as defined with javascript, what do I need to do to change that?
Diego Mayer
@Chrono79
Nov 08 2016 00:43
@lucas032689 Mmmm, show some code, the question is not clear enough
Lucas
@lucas032689
Nov 08 2016 00:43
How can I send it through here, it's my first time using chat
Diego Mayer
@Chrono79
Nov 08 2016 00:43
```js
your code
```
Lucas
@lucas032689
Nov 08 2016 00:44

// Declarations
var studlyCapVarCamelCase;
var properCamelCase;
var titleCaseOverCamelCase;

// Assignments
studlyCapVarCamelCase = 10;
properCamelCase = "A String";
titleCaseOverCamelCase = 9000;

It's showing that properCamelCase is correct
but not the other two
Diego Mayer
@Chrono79
Nov 08 2016 00:45
@lucas032689 you renamed your vars, remove the CamelCase you added to them
Lucas
@lucas032689
Nov 08 2016 00:47
hmmm :/ that worked. I thought it said to add camel case to all three
thanks! @Chrono79
CamperBot
@camperbot
Nov 08 2016 00:47
lucas032689 sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:star2: 2450 | @chrono79 |http://www.freecodecamp.com/chrono79
Diego Mayer
@Chrono79
Nov 08 2016 00:48
yw
sivkoslava
@sivkoslava
Nov 08 2016 00:48
How did you make 'Word Blanks' , can you see a photo?
Trevor Pyle
@pyleotrevor
Nov 08 2016 00:50
'''
CamperBot
@camperbot
Nov 08 2016 00:50
:bulb: to format code use backticks! ``` more info
Trevor Pyle
@pyleotrevor
Nov 08 2016 00:50

function largestOfFour(arr) {
  // You can do this!

  var counter = 0;
  for (i = 0; i < arr.length; i++) {
    for (j = 0; j < arr[i].length; j++){
    if (arr[i][j] > counter){
      counter = arr[i];
    }
  }
 }

  return counter;
}

largestOfFour([[6, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Can anyone help me out here? It is only returning the first array?
It makes logical sense to me, but I am obviously missing something.
WhiteLeaf1103
@WhiteLeaf1103
Nov 08 2016 00:51
holy smokes java script is freaking hard...
Diego Mayer
@Chrono79
Nov 08 2016 00:51
@pyleotrevor counter = arr[i]; this is wrong
and you should return an array
Alexander Huynh
@caesarsalad93
Nov 08 2016 00:52
@WhiteLeaf1103 do you have experience in other coding languages?
Trevor Pyle
@pyleotrevor
Nov 08 2016 00:52
It is returning an array
@Chrono79
As it is nested and that only assesses the first level (i think)
Diego Mayer
@Chrono79
Nov 08 2016 00:52
@pyleotrevor not the one you're returning, the array should consist on the max of each subarray
[6, 27, 39, 1001]
Nate Jackson
@NateJackDev
Nov 08 2016 00:52
This Escape Sequences in Strings isn't letting me submit. I do not know what is wrong
Trevor Pyle
@pyleotrevor
Nov 08 2016 00:53
@Chrono79 ahh okay.
Let me take a look
jahnellybean
@jahnellybean
Nov 08 2016 00:53
function chunkArrayInGroups(arr, size) {
while (arr.length > 0) {
finalArray = [];
subArray = arr.slice(0, size);
finalArray.push(subArray);
arr.splice(0, size);
}
return finalArray;
}
Diego Mayer
@Chrono79
Nov 08 2016 00:54
@jahnellybean you're overwriting finalArray with every loop
Nate Jackson
@NateJackDev
Nov 08 2016 00:54
'var myStr = "FirstLine \n \SecondLine\ \r ThirdLine"; // Change this line'
jahnellybean
@jahnellybean
Nov 08 2016 00:55
but i thought i was pushing (adding to the end)
ohhhh
i get it
got it thank you!!
Nate Jackson
@NateJackDev
Nov 08 2016 00:55
var myStr = "FirstLine \n \\SecondLine\\ \r ThirdLine"; // Change this line
Diego Mayer
@Chrono79
Nov 08 2016 00:55
@NateJackDev no spacing (means you have to delete all the spaces you have there)
jahnellybean
@jahnellybean
Nov 08 2016 00:55
took it out of the loop. thanks @Chrono79 !
CamperBot
@camperbot
Nov 08 2016 00:55
jahnellybean sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:star2: 2451 | @chrono79 |http://www.freecodecamp.com/chrono79
Diego Mayer
@Chrono79
Nov 08 2016 00:55
:+1:
jahnellybean
@jahnellybean
Nov 08 2016 00:56
answered before i even asked the question! ha you're awesome
Diego Mayer
@Chrono79
Nov 08 2016 00:57

@jahnellybean ;) I think you could crunch the code some more, look at what splice returns
Return value

An array containing the deleted elements. If only one element is removed, an array of one element is returned. If no elements are removed, an empty array is returned.

WhiteLeaf1103
@WhiteLeaf1103
Nov 08 2016 01:00
@caesarsalad93 I just started HTML/CSS 3weeks ago? ;D
gabriel poissant
@gabpoiss
Nov 08 2016 01:04

````function golfScore(par, strokes) {
// Only change code below this line
if (strokes == 1){
return "Hole-in-one";
} else if (strokes <= par-2){
return "Eagle";
} else if (strokes == par-1){
return "Birdie";
} else if (strokes == par){
return "Par";
} else if (strokes == par+1){
return "Bogey";
} else if (strokes == par+2){
return "Double Bogey";
} else if (strokes >= par+3){
return "Go Home!";
} else {
return "Change Me";
}

// Only change code above this line
}

// Change these values to test
golfScore(1, 1);
````

Why golfScore (1,1) doesn't give me "Hole-in-one"?
Joseph
@revisualize
Nov 08 2016 01:06
@gabpoiss Hole-in-one!
Stephen James
@sjames1958gm
Nov 08 2016 01:06
@gabpoiss Missing the ! at the end of the string
Joseph
@revisualize
Nov 08 2016 01:06
*yawn*
gabriel poissant
@gabpoiss
Nov 08 2016 01:07
@revisualize @sjames1958gm OMG so stupid mistake!
Thanks guys
Stephen James
@sjames1958gm
Nov 08 2016 01:07
@gabpoiss Using copy/paste for strings saves some headaches
gabriel poissant
@gabpoiss
Nov 08 2016 01:08
@sjames1958gm Yea thats a good idea haha
Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 08 2016 01:09
@WhiteLeaf1103 from the looks of it javascript is relatively the easiest language for a beginner to learn other than python
Gabe
@gabecastelli
Nov 08 2016 01:13
var refined = str.toLowerCase().replace("*", "").replace("_", "").replace(" ", "").replace("#", "");
This is obviously terrible code. How do I take out all non-alphanumeric characters with one replace()? I don't know regex
Diego Mayer
@Chrono79
Nov 08 2016 01:14
@gabecastelli learn at least the basic of regex
https://regex101.com you can test your regexes there
Stephen James
@sjames1958gm
Nov 08 2016 01:14
@gabecastelli Look up character classes on MDN regex page
Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 08 2016 01:15
ofcourse there is logo if you are very young :) I have been trying to implement the easiest language to learn for quite a while with oCaml capabilities .. (I have to look into various languages for references and examples :/ )
WhiteLeaf1103
@WhiteLeaf1103
Nov 08 2016 01:15
@Mr-Kumar-Abhishek omg... that makes me feel really horrible as I cant seem to get it. I'll have to use additional resources. Thanks for the advice tho. It will make me work harder cause it's suppose to be easy!
CamperBot
@camperbot
Nov 08 2016 01:15
whiteleaf1103 sends brownie points to @mr-kumar-abhishek :sparkles: :thumbsup: :sparkles:
:cookie: 394 | @mr-kumar-abhishek |http://www.freecodecamp.com/mr-kumar-abhishek
Alexander Huynh
@caesarsalad93
Nov 08 2016 01:20
@WhiteLeaf1103 If it's hard right now, it can only get easier! Stick with it!
yourpalsneakers
@yourpalsneakers
Nov 08 2016 01:28
"Add the number to the end of the array, then remove the first element of the array."
how do I do this???
I know how to .push and .shift, but both??
Jasper Zion
@JasperZion
Nov 08 2016 01:31
string.replace(/[^A-Za-z0-9]/g, ''); for non-alphanumeric characters @gabecastelli
@yourpalsneakers try pushing , then slicing the array....that should work
Stephen James
@sjames1958gm
Nov 08 2016 01:35
@yourpalsneakers One after the other - (not slice)
yourpalsneakers
@yourpalsneakers
Nov 08 2016 01:36
@sjames1958gm on the same line?
Stephen James
@sjames1958gm
Nov 08 2016 01:38
@yourpalsneakers No, seperate
@yourpalsneakers return the result of removing the first item.
gabriel poissant
@gabpoiss
Nov 08 2016 01:39
@yourpalsneakers Yea i did it earlier today. .push the item, then .shift the arr
yourpalsneakers
@yourpalsneakers
Nov 08 2016 01:39
arr.push(item);
return arr.shift();
Git it THANKS!
*got
Jasper Zion
@JasperZion
Nov 08 2016 01:41

var indexToRemove = 0;
var numberToRemove = 1;

arr.splice(indexToRemove, numberToRemove);

thats is to remove the first element of the array , the push () to add an element.......note, this method is faster
yourpalsneakers
@yourpalsneakers
Nov 08 2016 01:43
@JasperZion why don't they teach this way??
Jasper Zion
@JasperZion
Nov 08 2016 01:45
@yourpalsneakers I simply don't know.....mind you, not everyone who teaches a tutorial really knows whats up....
__mifflin__
@cdrainxv
Nov 08 2016 01:46
Not the point of the challenge… also shift is more readable.
Jasper Zion
@JasperZion
Nov 08 2016 01:48
That's right....but speed is priority in my coding style, so i don't really aim at readability....that's just me
Masaomi Pikachu
@MasaomiPikachu
Nov 08 2016 01:48

Can anyone let me know why this :
function largestOfFour(arr) {

var largestNum = Math.max.apply(arr[0]);
return largestNum;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);

is returning null? I'm trying to find the largest number in the given array. I know it's not complete yet but I'm missing why it's returning null.

Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 08 2016 01:50
@MasaomiPikachu cuz arr[0] is an array object , what you are getting is really array of arrays
Aaron Bell
@awb715
Nov 08 2016 01:50

            $.each(info[1],function(title){

              $.each(info[2],function(title){
                var add=info[1]
             var ok=info[2]
             $(".tester").html(add+ok);

            });
im trying to compile different pieces of correlating data from an api to show up together
cant figure it out
__mifflin__
@cdrainxv
Nov 08 2016 01:51
@MasaomiPikachu:
Math.max.apply(null, arr[0]);// returns 5
Jasper Zion
@JasperZion
Nov 08 2016 01:51
@MasaomiPikachu try using .....function MaxArray(numArray) {
return Math.max.apply(null, numArray);
}
ok...how about var maxNumb = Math.max(...arr);
HelloImDavid
@HelloImDavid
Nov 08 2016 01:52
So I'm having trouble with an exercise , can somebody help me?
Masaomi Pikachu
@MasaomiPikachu
Nov 08 2016 01:52
@cdrainxv why do i need to add null to what im applying the math.max function to? (sorry i didnt word that great)
HelloImDavid
@HelloImDavid
Nov 08 2016 01:53

'''
function bouncer(arr) {
// Don't show a false ID to this bouncer.
function removeValues(x) {
if (x === false || x === null || x === 0 || x === undefined || x === "" ) {
return false;
}
return true;
}
return arr.filter(removeValues);
}

bouncer([false, null, 0, NaN, undefined, 1, 2, "ate", ""]);
'''

CamperBot
@camperbot
Nov 08 2016 01:53
:bulb: to format code use backticks! ``` more info
Masaomi Pikachu
@MasaomiPikachu
Nov 08 2016 01:53
sorry @JasperZion can yo uexplain?
HelloImDavid
@HelloImDavid
Nov 08 2016 01:53
Oh it's backticks
function bouncer(arr) {
  // Don't show a false ID to this bouncer.
  function removeValues(x) {
  if (x === false || x === null || x === 0 || x === undefined || x === "" ) {
    return false;
    }
  return true;
  }
  return arr.filter(removeValues);
}

bouncer([false, null, 0, NaN, undefined, 1, 2, "ate", ""]);
This still returns null
Antoine Stimphil
@AntoineDS
Nov 08 2016 01:53
What is some good literature to read to understand Algorithms better?
HelloImDavid
@HelloImDavid
Nov 08 2016 01:53
I don't understand why.
Johnny
@JohnnyBizzel
Nov 08 2016 01:54
@HelloImDavid if (val != false && val != "" && val != 0 && val != NaN && val != null && val != undefined) <- falsy
Caden Damiano
@cdomiano
Nov 08 2016 01:54
function largestOfFour(arr) {
  var result = arr([]);

  for (result[i]; [] === false; i++) {
     result[i];
  }


  return arr;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
any suggestings on making this loop return the largest numbers in the arrays
HelloImDavid
@HelloImDavid
Nov 08 2016 01:55
@JohnnyBizzel I don't quite follow.
Caden Damiano
@cdomiano
Nov 08 2016 01:55
this what I have come up with already
Johnny
@JohnnyBizzel
Nov 08 2016 01:55
@HelloImDavid Well you don't have a test for NaN
Masaomi Pikachu
@MasaomiPikachu
Nov 08 2016 01:55
@cdrainxv because adding null worked, i just dont get why it did lol
HelloImDavid
@HelloImDavid
Nov 08 2016 01:56
@JohnnyBizzel You're right I don't. How would I get a test for it?
Joseph
@revisualize
Nov 08 2016 01:56
@cdomiano Well, I highly recommend that you make your for loop correctly first.
Johnny
@JohnnyBizzel
Nov 08 2016 01:56
@HelloImDavid if (val != false && val != "" && val != 0 && val != NaN && val != null && val != undefined) <- then truthy!
Jasper Zion
@JasperZion
Nov 08 2016 01:57
the first parameter to be passed when using the apply method is that which defines the "THIS" variable....but in your case , you have no "THIS" variable , so you have to declare it "NULL" for it to be ignored.... @MasaomiPikachu
Johnny
@JohnnyBizzel
Nov 08 2016 01:58
@cdomiano I did that with a loop within a loop
HelloImDavid
@HelloImDavid
Nov 08 2016 01:59
@cdomiano What I did was create a new array and push the highest value in each array to that new array and then return it.
Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 08 2016 01:59
@MasaomiPikachu while using .apply method the function math.max is in non strict mode so null will be replaced by global object presumably .
@MasaomiPikachu while using .apply method with the function math.max is in non strict mode so null will be replaced by global object presumably .
__mifflin__
@cdrainxv
Nov 08 2016 02:00
@MasaomiPikachu: Great examples shown on stackoverflow
Gabe
@gabecastelli
Nov 08 2016 02:01
@JasperZion what about /^[:alpha:]/g ?
Jasper Zion
@JasperZion
Nov 08 2016 02:01
lol.....well, i'm going off to finish my A.I ....have a nice morning y'all ....back to C++
Salomon
@zarruk
Nov 08 2016 02:01
can somebody help me with the Exact Change challenge?
it is expected for me to use objects but i don't really find how to.
and I'm sure there's a shorter way of doing the challenge than how I'm doing it
Conor Murphy
@cmurphy580
Nov 08 2016 02:02

@JohnnyBizzel var date = new Date(Date.now());
var today = date.toDateString()
//+"<br>"+"<br>"+ date.toLocaleTimeString();
var time = date.toLocaleTimeString();

/To assign appropriate icon to weather description, see also html setting for icon source /
var icon = data.weather[0].id;
//icon = data.sys[1].id;
$("#icon").html("<i class=\"wi wi-owm-"+icon+"\"></i>").css({
"font-size": "900%",
"padding": "10px",
});

Caden Damiano
@cdomiano
Nov 08 2016 02:02

function largestOfFour(arr) {
  var result = arr([]);

  for (i === [1]; [i] < 4 ; i++) {
     result === xx;
  }


  return arr;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Right direction @revisualize
?
Conor Murphy
@cmurphy580
Nov 08 2016 02:03
'm trying to add another piece of data from an api to my weather icon the data.sys[1].id is the data im' trying to connect. any way to make it work? @JohnnyBizzel
Caden Damiano
@cdomiano
Nov 08 2016 02:03
@JohnnyBizzel I'll try it
Masaomi Pikachu
@MasaomiPikachu
Nov 08 2016 02:03
Thank you @JasperZion , @Mr-Kumar-Abhishek , @cdrainxv. That makes sense and I will look at those links
CamperBot
@camperbot
Nov 08 2016 02:03
masaomipikachu sends brownie points to @jasperzion and @mr-kumar-abhishek and @cdrainxv :sparkles: :thumbsup: :sparkles:
:cookie: 8 | @jasperzion |http://www.freecodecamp.com/jasperzion
:cookie: 786 | @cdrainxv |http://www.freecodecamp.com/cdrainxv
:cookie: 395 | @mr-kumar-abhishek |http://www.freecodecamp.com/mr-kumar-abhishek
Johnny
@JohnnyBizzel
Nov 08 2016 02:03
@cmurphy580 Codepen might be easier. Do you have it here?
HelloImDavid
@HelloImDavid
Nov 08 2016 02:04
@JohnnyBizzel I tried your solution but the array still returns a null.

function bouncer(arr) {
  // Don't show a false ID to this bouncer.
  function removeValues(val) {
  if (val != false && val != "" && val != 0 && val != NaN && val != null && val != undefined) {
    return true;
    }
  return false;
  }
  return arr.filter(removeValues);
}

bouncer([false, null, 0, NaN, undefined, 1, 2, "ate", ""]);
Johnny
@JohnnyBizzel
Nov 08 2016 02:04
HelloImDavid
@HelloImDavid
Nov 08 2016 02:06
Oh wow that is a great solution
IS there a reason my solution doesn't work?
I don't understand why it wouldn't.
Amin
@hanamin
Nov 08 2016 02:07
Hey guys, I'm doing the "Return Largest Numbers in Arrays" challenge. My code is putting out [5,27,39,1001] but the test case is expected [27,5,39,1001]. Why isn't it accepting it? The challenge says nothing about the order of the items in the array
Stephen James
@sjames1958gm
Nov 08 2016 02:08
@LoudSilence The order has to match the order of the original values
Gabe
@gabecastelli
Nov 08 2016 02:08

First time using regex:

function palindrome(str) {
  var refined = str.replace(/^[a-z]/gi, "").toLowerCase();
  console.log(refined);
  return refined === refined.split().reverse().join();
}



palindrome("eye");

Why does this always return true?

Stephen James
@sjames1958gm
Nov 08 2016 02:09
@LoudSilence It doesn't explicitly say that, but the tests certainly require it
Ashish verma
@ashish1500616
Nov 08 2016 02:09

function mutation(arr,str) {
arr.toLowerCase();
str.toLowerCase();
var c=0;
var arrN=arr.split('');
var strN=str.split('');
for(var i=0;i<str.length;i++) { if(arrN.indexOf(strN,0)>0)
c++;
}
if(c==str.length)
return true;
else
return false;

}

mutation(["hello", "hey"]);

function mutation(arr,str) {
arr.toLowerCase();
str.toLowerCase();
var c=0;
var arrN=arr.split('');
var strN=str.split('');
for(var i=0;i<str.length;i++) { if(arrN.indexOf(strN,0)>0)
c++;
}
if(c==str.length)
return true;
else
return false;

}

mutation(["hello", "hey"]);

Amin
@hanamin
Nov 08 2016 02:09
@sjames1958gm hmm alright, I guess I'll play around with it to get that to work...not sure why they're even going out of order since I passed the other two test cases
Thanks
Ashish verma
@ashish1500616
Nov 08 2016 02:09
error arr.toLowerCase is not a function
Johnny
@JohnnyBizzel
Nov 08 2016 02:10
@HelloImDavid Did you run your code through pythontutor.com ?
Stephen James
@sjames1958gm
Nov 08 2016 02:10
@LoudSilence Yeah, you'd think you would have to do something special to get them out of order :)
@bitian1506 string functions do not modify the string they return a new string.
HelloImDavid
@HelloImDavid
Nov 08 2016 02:11
@gabecastelli You have to split it by something
Johnny
@JohnnyBizzel
Nov 08 2016 02:11
@HelloImDavid
0    1    2    3
NaN    1    2    "ate"
Salomon
@zarruk
Nov 08 2016 02:11
https://www.freecodecamp.com/challenges/exact-change#?solution=%0Afunction%20checkCashRegister(price%2C%20cash%2C%20cid)%20%7B%0A%20%20var%20change%20%3D%20cash%20-%20price%3B%0A%20%20var%20result%20%3D%20%5B%5D%3B%0A%20%20var%20currentValue%20%3D%20change%3B%0A%20%20var%20closed%20%3D%20true%3B%0A%20%20%0A%20%20if%20(Math.floor(currentValue%20%2F%20100)%20%3E%3D%201)%7B%0A%20%20%20%20if%20(currentValue%20%3E%20cid%5B8%5D%5B1%5D)%7B%0A%20%20%20%20%20%20result.push(%5B%22ONE%20HUNDRED%22%2C%20cid%5B8%5D%5B1%5D%5D)%3B%0A%20%20%20%20%20%20currentValue%20-%3D%20cid%5B8%5D%5B1%5D%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%20%7B%0A%20%20%20%20%20%20result.push(%5B%22ONE%20HUNDRED%22%2C%20Math.floor(change%20%2F%20100)%5D)%3B%0A%20%20%20%20%20%20currentValue%20%3D%20currentValue%20%25%20100%3B%0A%20%20%20%20%7D%0A%20%20%7D%0A%20%20%20%20%0A%20%20if%20(Math.floor(currentValue%20%2F%2020)%20%3E%3D%201)%7B%0A%20%20%20%20if%20(currentValue%20%3E%20cid%5B7%5D%5B1%5D)%7B%0A%20%20%20%20%20%20result.push(%5B%22TWENTY%22%2C%20cid%5B7%5D%5B1%5D%5D)%3B%0A%20%20%20%20%20%20currentValue%20-%3D%20cid%5B7%5D%5B1%5D%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%20%7B%0A%20%20%20%20%20%20result.push(%5B%22TWENTY%22%2C%20Math.floor(change%20%2F%2020)%5D)%3B%0A%20%20%20%20%20%20currentValue%20%3D%20currentValue%20%25%20100%3B%0A%20%20%20%20%7D%0A%20%20%7D%0A%20%20%0A%20%20if%20(Math.floor(currentValue%20%2F%2010)%20%3E%3D%201)%7B%0A%20%20%20%20if%20(currentValue%20%3E%20cid%5B6%5D%5B1%5D)%7B%0A%20%20%20%20%20%20result.push(%5B%22TEN%22%2C%20cid%5B6%5D%5B1%5D%5D)%3B%0A%20%20%20%20%20%20currentValue%20-%3D%20cid%5B6%5D%5B1%5D%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%20%7B%0A%20%20%20%20%20%20result.push(%5B%22TEN%22%2C%20Math.floor(currentValue%20%2F%2010)%5D)%3B%0A%20%20%20%20%20%20currentValue%20%3D%20change%20%25%2010%3B%0A%20%20%20%20%7D%0A%20%20%7D%0A%20%20%0A%20%20if%20(Math.floor(currentValue%20%2F%205)%20%3E%3D%201)%7B%0A%20%20%20%20if%20(currentValue%20%3E%20cid%5B5%5D%5B1%5D)%7B%0A%20%20%20%20%20%20result.push(%5B%22FIVE%22%2C%20cid%5B5%5D%5B1%5D%5D)%3B%0A%20%20%20%20%20%20currentValue%20-%3D%20cid%5B5%5D%5B1%5D%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%20%7B%0A%20%20%20%20%20%20result.push(%5B%22FIVE%22%2C%20Math.floor(currentValue%20%2F%205)%20*%205%5D)%3B%0A%20%20%20%20%20%20currentValue%20%3D%20change%20%25%205%3B%0A%20%20%20%20%7D%0A%20%20%7D%0A%20%20%20%20%0A%20%20if%20(Math.floor(currentValue%20%2F%201)%20%3E%3D%201)%7B%0A%20%20%20%20if%20(currentValue%20%3E%20cid%5B4%5D%5B1%5D)%7B%0A%20%20%20%20%20%20result.push(%5B%22ONE%22%2C%20cid%5B4%5D%5B1%5D%5D)%3B%0A%20%20%20%20%20%20currentValue%20-%3D%20cid%5B4%5D%5B1%5D%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%20%7B%0A%20%20%20%20%20%20result.push(%5B%22ONE%22%2C%20Math.floor(currentValue%20%2F%201)%20*%201%5D)%3B%0A%20%20%20%20%20%20currentValue%20%3D%20change%20%25%201%3B%0A%20%20%20%20%7D%0A%20%20%7D%0A%20%20%0A%20%20if%20(Math.floor(currentValue%20%2F%200.25)%20%3E%3D%201)%7B%0A%20%20%20%20if%20(currentValue%20%3E%20cid%5B3%5D%5B1%5D)%7B%0A%20%20%20%20%20%20result.push(%5B%22QUARTER%22%2C%20cid%5B3%5D%5B1%5D%5D)%3B%0A%20%20%20%20%20%20currentValue%20-%3D%20cid%5B3%5D%5B1%5D%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%20%7B%0A%20%20%20%20%20%20result.push(%5B%22QUARTER%22%2C%20Math.floor(currentValue%20%2F%200.25)%20*%200.25%5D)%3B%0A%20%20%20%20%20%20currentValue%20%3D%20change%20%25%200.25%3B%0A%20%20%20%20%7D%0A%20%20%7D%0A%20%20%0A%20%20if%20(Math.floor(currentValue%20%2F%200.1)%20%3E%3D%201)%7B%0A%20%20%20%20if%20(currentValue%20%3E%20cid%5B2%5D%5B1%5D)%7B%0A%20%20%20%20%20%20result.push(%5B%22DIME%22%2C%20cid%5B2%5D%5B1%5D%5D)%3B%0A%20%20%20%20%20%20currentValue%20-%3D%20cid%5B2%5D%5B1%5D%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%20%7B%0A%20%20%20%20%20%20result.push(%5B%22DIME%22%2C%20Math.floor(currentValue%20%2F%200.1)%20*%200.1%5D)%3B%0A%20%20%20%20%20%20currentValue%20%3D%20change%20%25%200.1%3B%0A%20%20%20%20%7D%0A%20%20%7D%0A%20%20%0A%20%20if%20(Math.floor(currentValue%20%2F%200.05)%20%3E%3D%201)%7B%0A%20%20%20%20if%20(currentValue%20%3E%20cid%5B1%5D%5B1%5D)%7B%0A%20%20%20%20%20%20result.pu
HelloImDavid
@HelloImDavid
Nov 08 2016 02:12
@gabecastelli return refined === refined.split('').reverse().join('');
Johnny
@JohnnyBizzel
Nov 08 2016 02:12
I cant see!!
HelloImDavid
@HelloImDavid
Nov 08 2016 02:12
Do that instead
Salomon
@zarruk
Nov 08 2016 02:12
Help please. I'm sure there must be a shorter way to do this challenge. Right?
CamperBot
@camperbot
Nov 08 2016 02:12
no wiki entry for: please im sure there must be a shorter way to do this challenge right
HelloImDavid
@HelloImDavid
Nov 08 2016 02:12
@JohnnyBizzel No I haven't, Thanks for that resource!
CamperBot
@camperbot
Nov 08 2016 02:12
helloimdavid sends brownie points to @johnnybizzel :sparkles: :thumbsup: :sparkles:
:cookie: 769 | @johnnybizzel |http://www.freecodecamp.com/johnnybizzel
Johnny
@JohnnyBizzel
Nov 08 2016 02:12
@HelloImDavid This is what your code returns in the array:
0    1    2    3
NaN    1    2    "ate"
Ian
@toianw
Nov 08 2016 02:13
@JohnnyBizzel Your solution to will also work if you remove the entire if statement. :smile:
Johnny
@JohnnyBizzel
Nov 08 2016 02:13
@toianw I never said it was the best but it works :P
Gabe
@gabecastelli
Nov 08 2016 02:13
@HelloImDavid that just made it worse
Johnny
@JohnnyBizzel
Nov 08 2016 02:14
@zarruk There must be a better way to display your code too
Nirmal Patel
@patelnk4
Nov 08 2016 02:14
hello I need some help I made buttons on my portfolio page ; but how do i make it so that when a button is clicked the screen will automatically direct to that page of the portfolio
Salomon
@zarruk
Nov 08 2016 02:14
@JohnnyBizzel i'm sorry about that
Ian
@toianw
Nov 08 2016 02:14
@JohnnyBizzel Yes, it works because of the return val. That's all you need.
Salomon
@zarruk
Nov 08 2016 02:15
@patelnk4 point an href to the id of that section
@JohnnyBizzel would you help me please?
Amin
@hanamin
Nov 08 2016 02:15
@sjames1958gm Ok I got it to work. Initially I was just pushing the values via push() instead of directly assigning the values to specific indexes. Somehow that went wonky with that one test case. Thanks for your help!
CamperBot
@camperbot
Nov 08 2016 02:15
loudsilence sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 4237 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
HelloImDavid
@HelloImDavid
Nov 08 2016 02:15
@Ian oh so that's why it works huh? Because it would remove all falsy values?
Johnny
@JohnnyBizzel
Nov 08 2016 02:16
@zarruk Copy and paste your code is the 1st challenge!
'''
CamperBot
@camperbot
Nov 08 2016 02:16
:bulb: to format code use backticks! ``` more info
Johnny
@JohnnyBizzel
Nov 08 2016 02:16
^^ formatted
Salomon
@zarruk
Nov 08 2016 02:17
@JohnnyBizzel
@JohnnyBizzel it is too long but here it goes
@JohnnyBizzel

function checkCashRegister(price, cash, cid) {
  var change = cash - price;
  var result = [];
  var currentValue = change;
  var closed = true;

  if (Math.floor(currentValue / 100) >= 1){
    if (currentValue > cid[8][1]){
      result.push(["ONE HUNDRED", cid[8][1]]);
      currentValue -= cid[8][1];
    }
    else {
      result.push(["ONE HUNDRED", Math.floor(change / 100)]);
      currentValue = currentValue % 100;
    }
  }

  if (Math.floor(currentValue / 20) >= 1){
    if (currentValue > cid[7][1]){
      result.push(["TWENTY", cid[7][1]]);
      currentValue -= cid[7][1];
    }
    else {
      result.push(["TWENTY", Math.floor(change / 20)]);
      currentValue = currentValue % 100;
    }
  }

  if (Math.floor(currentValue / 10) >= 1){
    if (currentValue > cid[6][1]){
      result.push(["TEN", cid[6][1]]);
      currentValue -= cid[6][1];
    }
    else {
      result.push(["TEN", Math.floor(currentValue / 10)]);
      currentValue = change % 10;
    }
  }

  if (Math.floor(currentValue / 5) >= 1){
    if (currentValue > cid[5][1]){
      result.push(["FIVE", cid[5][1]]);
      currentValue -= cid[5][1];
    }
    else {
      result.push(["FIVE", Math.floor(currentValue / 5) * 5]);
      currentValue = change % 5;
    }
  }

  if (Math.floor(currentValue / 1) >= 1){
    if (currentValue > cid[4][1]){
      result.push(["ONE", cid[4][1]]);
      currentValue -= cid[4][1];
    }
    else {
      result.push(["ONE", Math.floor(currentValue / 1) * 1]);
      currentValue = change % 1;
    }
  }

  if (Math.floor(currentValue / 0.25) >= 1){
    if (currentValue > cid[3][1]){
      result.push(["QUARTER", cid[3][1]]);
      currentValue -= cid[3][1];
    }
    else {
      result.push(["QUARTER", Math.floor(currentValue / 0.25) * 0.25]);
      currentValue = change % 0.25;
    }
  }

  if (Math.floor(currentValue / 0.1) >= 1){
    if (currentValue > cid[2][1]){
      result.push(["DIME", cid[2][1]]);
      currentValue -= cid[2][1];
    }
    else {
      result.push(["DIME", Math.floor(currentValue / 0.1) * 0.1]);
      currentValue = change % 0.1;
    }
  }

  if (Math.floor(currentValue / 0.05) >= 1){
    if (currentValue > cid[1][1]){
      result.push(["NICKEL", cid[1][1]]);
      currentValue -= cid[1][1];
    }
    else {
      result.push(["NICKEL", Math.floor(currentValue / 0.05) * 0.05]);
      currentValue = change % 0.05;
    }
  }

  if (Math.floor(currentValue.toFixed(2) / 0.01) >= 1){
    if (currentValue > cid[0][1]){
      return "Insufficient Funds";
    }
    else {
      result.push(["PENNY", Math.floor(currentValue.toFixed(2) / 0.01) * 0.01]);
      currentValue = change % 0.01;
    }


  }
  return result;
}  

checkCashRegister(19.50, 20.00, [["PENNY", 0.50], ["NICKEL", 0], ["DIME", 0], ["QUARTER", 0], ["ONE", 0], ["FIVE", 0], ["TEN", 0], ["TWENTY", 0], ["ONE HUNDRED", 0]]);
Ian
@toianw
Nov 08 2016 02:17
@HelloImDavid yes, it's that easy. All truthy values will be coerced to true in the filter, and falsey values to false
Gabe
@gabecastelli
Nov 08 2016 02:17
actually never mind @HelloImDavid it makes no difference
HelloImDavid
@HelloImDavid
Nov 08 2016 02:18
@gabecastelli Oh I got it, it's because of your regex, my bad.
Gabe
@gabecastelli
Nov 08 2016 02:18
ah
Do you know what is wrong about it
Salomon
@zarruk
Nov 08 2016 02:18
@JohnnyBizzel I think it would be easier to read if you follow the link :smile:
Trevor Pyle
@pyleotrevor
Nov 08 2016 02:19
Hi all. I am having some trouble with this challenge. Anyone have any pointers?
HelloImDavid
@HelloImDavid
Nov 08 2016 02:19
It's removing some characters that shouldn't be removed
Trevor Pyle
@pyleotrevor
Nov 08 2016 02:19

function largestOfFour(arr) {
  // You can do this!
  var maxNumber = 0;
  var maxArray = [];
  for (i = 0; i < arr.length; i++) {
     maxNumber = Math.max(arr[i]);
     maxArray = maxArray.push(maxNumber);
    }
 return maxArray;
}

largestOfFour([[6, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Emily Chadwick
@emilychadwick
Nov 08 2016 02:19
Can anyone offer input? I'm working to build out my Mad Libs challenge and am unsure of my first steps. Any thoughts on how to get started?
HelloImDavid
@HelloImDavid
Nov 08 2016 02:20
@gabecastelli Hold on let me refresh on regex real quick I forgot it already
Johnny
@JohnnyBizzel
Nov 08 2016 02:20
@zarruk For long code snippets use: https://gist.github.com/
Juan Angelogianopulos
@angelogianopulos
Nov 08 2016 02:20
Hello I am stuck in this exercise
var myStr = '\"FirstLine n \ n SecondLine \ r n Thirdline\"';
can somebody help?
thanks
Joseph
@revisualize
Nov 08 2016 02:21
cbot
CamperBot
@camperbot
Nov 08 2016 02:21
you called?
HelloImDavid
@HelloImDavid
Nov 08 2016 02:21
@gabecastelli Okay yeah I got it. All your regex is doing is removing the first letter or any string.
Trevor Pyle
@pyleotrevor
Nov 08 2016 02:21
@emilychadwick do you have some code to show where you are right now?
CamperBot
@camperbot
Nov 08 2016 02:21
zarruk sends brownie points to @johnnybizzel :sparkles: :thumbsup: :sparkles:
:cookie: 770 | @johnnybizzel |http://www.freecodecamp.com/johnnybizzel
Gabe
@gabecastelli
Nov 08 2016 02:21
hmm
Emily Chadwick
@emilychadwick
Nov 08 2016 02:22

@pyleotrevor I've written and deleted a few things, but here is what the starter code looks like: 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");

Joseph
@revisualize
Nov 08 2016 02:22
@angelogianopulos You're escaping a " you're not escaping the \ correctly. I don't know why you have the random n's in there. Also, you're not spelling ThirdLine correctly.
HelloImDavid
@HelloImDavid
Nov 08 2016 02:22
@gabecastelli ^ means if it matches the beginning of any input. So you put if it matches the beginning of any letter from a - z, you replace it.
Which is definitely not what you want
Johnny
@JohnnyBizzel
Nov 08 2016 02:22
@zarruk I can't see a problem with your code. However you may consider X 100 everything and then divide by 100 at the last part.
Nirmal Patel
@patelnk4
Nov 08 2016 02:23
@zarruk http://codepen.io/patelnk4/pen/RGXqJg?editors=1100 hey I tried to make an id but when i run it gave me an error. I made classes for the different pages but it does not seem to move it when i click on the stuff.
Joseph
@revisualize
Nov 08 2016 02:23
/collapse-all
Gabe
@gabecastelli
Nov 08 2016 02:23
@HelloImDavid ohh i thought it meant "not" for some reason
because it seems to do what it's supposed to on regex101.com
Emily Chadwick
@emilychadwick
Nov 08 2016 02:23
Thanks @revisualize !
CamperBot
@camperbot
Nov 08 2016 02:23
emilychadwick sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 2266 | @revisualize |http://www.freecodecamp.com/revisualize
Juan Angelogianopulos
@angelogianopulos
Nov 08 2016 02:23
@revisualize thanks for your response, I am not sure what I am doing wrong I have been stuck in this part for hours
CamperBot
@camperbot
Nov 08 2016 02:23
angelogianopulos sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 2267 | @revisualize |http://www.freecodecamp.com/revisualize
Joseph
@revisualize
Nov 08 2016 02:24
@emilychadwick Hello from Seattle!
@emilychadwick I'm currently on the bus at 3rd & Bell.
Gabe
@gabecastelli
Nov 08 2016 02:25
@HelloImDavid i think what you're talking about would be /^[a-z]/gi
HelloImDavid
@HelloImDavid
Nov 08 2016 02:25
@gabecastelli Oh then it's [^a-z] not ^[a-z]
Gabe
@gabecastelli
Nov 08 2016 02:25
oh lmao that's what i put
silly me
thanks
Emily Chadwick
@emilychadwick
Nov 08 2016 02:25
@revisualize Small world! I'm coding during commercial breaks for the Seahawks game!
Salomon
@zarruk
Nov 08 2016 02:25
@JohnnyBizzel I'm actually aware of that but my problem is not the code itself. The problem is I don't really know how I would use an object here (as suggested in the challenge)
Gabe
@gabecastelli
Nov 08 2016 02:25
alas it still doesn't freakin work
Joseph
@revisualize
Nov 08 2016 02:26
@angelogianopulos You really need to look at what the lesson wants.
HelloImDavid
@HelloImDavid
Nov 08 2016 02:26
@gabecastelli It should now. You're just missing one thing.
Johnny
@JohnnyBizzel
Nov 08 2016 02:26
@zarruk You can create a lookup object like a dictionary holding the Denominations and values.
Just a different way of doing it.
HelloImDavid
@HelloImDavid
Nov 08 2016 02:27
@gabecastelli You need to add in numbers also.
Salomon
@zarruk
Nov 08 2016 02:27
@JohnnyBizzel could you please give me an example?
Joseph
@revisualize
Nov 08 2016 02:27

Get help on our basic JavaScript and Algorithms Challenges. If you are posting code that is large use Gist - https://gist.github.com/ paste the link here.

Johnny
@JohnnyBizzel
Nov 08 2016 02:27
@zarruk You can find an answer on the forum!
Salomon
@zarruk
Nov 08 2016 02:27
@JohnnyBizzel I'm sure that could make my code shorter, right?
Gabe
@gabecastelli
Nov 08 2016 02:27
@HelloImDavid ah i assumed it targeted all alphanumericals
Salomon
@zarruk
Nov 08 2016 02:28
@JohnnyBizzel haha if I look for the answer in forum, I'd feel like cheating
yourpalsneakers
@yourpalsneakers
Nov 08 2016 02:28
I did the JavaScript course on codecademy, now I'm doing this one... why do they teach different things? Is there really this many different ways to use JavaScript? For example: codecademy teaches to write 'if { else { ' whereas FCC teaches 'if{ (no else)' / codecademy equality is '===' FCC equality is '=='. What's up with this?
HelloImDavid
@HelloImDavid
Nov 08 2016 02:28
@gabecastelli Nope. a-z only gets the letters from a to z.
Joseph
@revisualize
Nov 08 2016 02:28
@yourpalsneakers It breaks the lesson apart.
Johnny
@JohnnyBizzel
Nov 08 2016 02:29
@zarruk I looked in the Wiki before starting. Have a look there. No such thing as cheating. Would you see it as cheating if someone was paying you $40k a year?
HelloImDavid
@HelloImDavid
Nov 08 2016 02:29
@gabecastelli Did it pass? Your code passed after I added in numbers.
Chase
@Belax8
Nov 08 2016 02:30
@yourpalsneakers They teach different things because the teachers are different. Everyone understands Javascript in their own way. And yes, there are many ways to use javascript.
Eric Leung
@erictleung
Nov 08 2016 02:30
@yourpalsneakers there are different ways to code, for better or worse. On the equality thing, there is a difference between == and ===.
Joseph
@revisualize
Nov 08 2016 02:31
But, FCC teaches those.
It just breaks the lessons apart.
Salomon
@zarruk
Nov 08 2016 02:31
@JohnnyBizzel what is the Wiki?
Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 08 2016 02:31
@JohnnyBizzel say ... could I use DL4J with low processors ? I have enough GPU though
Gabe
@gabecastelli
Nov 08 2016 02:32
@HelloImDavid i tried /[^a-z]\d/gi hmmmmmm
Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 08 2016 02:32
Eric Leung
@erictleung
Nov 08 2016 02:32
@yourpalsneakers as @revisualize mentions, the == versus === is split up into different lessons.
HelloImDavid
@HelloImDavid
Nov 08 2016 02:32
You need to add it into your brackets
@gabecastelli You need to add it into your brackets
Eric Leung
@erictleung
Nov 08 2016 02:32
@yourpalsneakers the dangling else statement is up for debate for some http://stackoverflow.com/questions/1780384/should-if-statement-always-have-an-else-clause
yourpalsneakers
@yourpalsneakers
Nov 08 2016 02:32
And for HTML, FCC never teaches to write <!DOCTYPE html>, CC teaches that it is very important... who's right?? who's wrong??
Johnny
@JohnnyBizzel
Nov 08 2016 02:33
@Mr-Kumar-Abhishek No idea to be honest :/
HelloImDavid
@HelloImDavid
Nov 08 2016 02:33
@gabecastelli The purpose is to keep the numbers, not remove it.
Johnny
@JohnnyBizzel
Nov 08 2016 02:33
@zarruk it's the wiki, now found in the forum
Gabe
@gabecastelli
Nov 08 2016 02:34
@HelloImDavid oh i thought i was supposed to replace all non letter chars with nothing
HelloImDavid
@HelloImDavid
Nov 08 2016 02:34
@gabecastelli /[^a-z0-9]/gi passes for me. Which is the same as [^a-z\d]/gi
Eric Leung
@erictleung
Nov 08 2016 02:34
@yourpalsneakers it is in terms of how or what you want to teach. Here's a response from Quincy on why there isn't anything taught on the head https://github.com/FreeCodeCamp/FreeCodeCamp/issues/8849#issuecomment-222604610
Johnny
@JohnnyBizzel
Nov 08 2016 02:34
I'm off to bed. Peace and happy voting America!
Salomon
@zarruk
Nov 08 2016 02:34
@JohnnyBizzel what's the wiki??
HelloImDavid
@HelloImDavid
Nov 08 2016 02:34
@gabecastelli Nah, it calls to remove all punctuation, spaces, and symbols.
@gabecastelli You want to keep the numbers
Johnny
@JohnnyBizzel
Nov 08 2016 02:34
It's like Wikipedia!
Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 08 2016 02:34
thanks I will try and check it out once then.. @JohnnyBizzel
CamperBot
@camperbot
Nov 08 2016 02:34
mr-kumar-abhishek sends brownie points to @johnnybizzel :sparkles: :thumbsup: :sparkles:
:cookie: 771 | @johnnybizzel |http://www.freecodecamp.com/johnnybizzel
Gabe
@gabecastelli
Nov 08 2016 02:34
@HelloImDavid ahh
im so slowwww
Johnny
@JohnnyBizzel
Nov 08 2016 02:35
Google free code camp wiki and see what happens
Gone!
HelloImDavid
@HelloImDavid
Nov 08 2016 02:35
@gabecastelli The regex I personally used is /[\W_]/gi ; Just offering an alternate solution to think about.
Eric Leung
@erictleung
Nov 08 2016 02:35
@zarruk here you go, a link to the Wiki, which is now in the forums.
Gabe
@gabecastelli
Nov 08 2016 02:35
although /[^a-z\d]/gi doesn't work
Nirmal Patel
@patelnk4
Nov 08 2016 02:36
hello could someone please help me figure out how to make my portfolio page go to about me when they click the about menu. please http://codepen.io/patelnk4/pen/RGXqJg?editors=1100
HelloImDavid
@HelloImDavid
Nov 08 2016 02:36
@gabecastelli It works for me, I'll paste your code.
function palindrome(str) {
  var refined = str.replace(/[^a-z0-9]/gi, "").toLowerCase();
  return refined== refined.split('').reverse().join('');
}




palindrome("1 eye for of 1 eye.");
Gabe
@gabecastelli
Nov 08 2016 02:39
@HelloImDavid i guess the '' in split and join does make a difference, it works now, thanks!
CamperBot
@camperbot
Nov 08 2016 02:39
gabecastelli sends brownie points to @helloimdavid :sparkles: :thumbsup: :sparkles:
:cookie: 2 | @helloimdavid |http://www.freecodecamp.com/helloimdavid
Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 08 2016 02:39
meh... anything on java is uses too much hardware :/ I should try something else
HelloImDavid
@HelloImDavid
Nov 08 2016 02:39
@gabecastelli No problem, yeah you have to split or join by something.
In this case it means by anything.
Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 08 2016 02:41
on jvm uses *
Aaron Bell
@awb715
Nov 08 2016 02:41
 $("h3").html(title);  
             document.getElementById("source").href = link;
             $("p").html(desc);
im having a lot of trouble recreating this in a for loop
Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 08 2016 02:43
python is worse ... any pure c/c++ implementation would do..
Aaron Bell
@awb715
Nov 08 2016 02:45
can anyone help me out
Gabe
@gabecastelli
Nov 08 2016 02:49
Is there any alternative to be able to modify a parameter passed through a lambda?
Somia ♡
@somiajagadish
Nov 08 2016 02:52
need help
Jenky W. Nolasco
@jenkynolasco11
Nov 08 2016 02:52
What's the problem?
Somia ♡
@somiajagadish
Nov 08 2016 02:52
myVar = myVar + 1;
and they want i++
idk how to inout it
*input
Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 08 2016 02:54
got it https://github.com/torch/torch7 ^_^ best fit for this hardware
Somia ♡
@somiajagadish
Nov 08 2016 02:54
Okay never mind got it <3
tvithaya
@tvithaya
Nov 08 2016 02:54
@somiajagadish 'i' is a place value, look at your myVar, it's adding one to itself, therefore all you need is myVar++
Somia ♡
@somiajagadish
Nov 08 2016 02:54
ty <3
Gabe
@gabecastelli
Nov 08 2016 02:57
str.substring(1) = str.substring(1).toLowerCase();
Says bad assignment?
never mind got it
annnnd never mind again didn't fix it
Dennis Kim
@dvk458
Nov 08 2016 03:00
hey
can somebody please help me with my js programming hw?thanks in advance
Jenky W. Nolasco
@jenkynolasco11
Nov 08 2016 03:00
@gabecastelli you can only assign variables you declare... unless you're comparing there, then the = sign is wrong
Gabe
@gabecastelli
Nov 08 2016 03:01
str is a parameter
Jenky W. Nolasco
@jenkynolasco11
Nov 08 2016 03:02
Strings are not mutable
Gabe
@gabecastelli
Nov 08 2016 03:03
i see @jenkynolasco11
Joseph
@revisualize
Nov 08 2016 03:05
@gabecastelli Strings are Immutable.
Gabe
@gabecastelli
Nov 08 2016 03:06
var words = str.split(" ");
  var capitalized = [];
  for (var i = 0; i < str[i].length; i++) {
    capitalized.push(str[i].substring(0, 1).toUpperCase() + str[i].substring(1).toLowerCase());
  }

  return capitalized.join(" ");
There's probably a silly mistake as always
Joseph
@revisualize
Nov 08 2016 03:06

@somiajagadish

var num = 5;
num = num + 1; // 6
num += 1; // 7
num++; // 8

Do you see when I did the one for 8. There was no assignment?
Also, there is no i++ (Note: they do NOT want i++. They want you to learn how to use ++.)

Gabe
@gabecastelli
Nov 08 2016 03:06
i < str[i].length should be i < str.length
tvithaya
@tvithaya
Nov 08 2016 03:09
can anyone help me with the Record Collection exercise, just can't seem to figure out what it's asking
function updateRecords(id, prop, value) {
//   var name = collection[id];
//   var name1 = collection[name][prop];
//   var name2 = collection[name][prop][value];

  if(prop !== "tracks" && value !== "") {
    collection[id][prop] = value;
  } else if (prop == "tracks" && name.hasOwnProperty(tracks) === false) {
    collection[id][prop] = [];
  } else if (prop == "tracks" && name.hasOwnProperty(tracks) && value !== "") {
    collection[id][prop].push(value);
  } else if (value === "") {
    delete collection[id][prop];
  }  
  return collection;
}
all my "artist" arguments pass, but the "tracks" arguments don't
Gabe
@gabecastelli
Nov 08 2016 03:09
@tvithaya yeah that one was a nightmare
for me
tvithaya
@tvithaya
Nov 08 2016 03:10
@gabecastelli glad I'm not the only one
were you able to complete it at all?
Gabe
@gabecastelli
Nov 08 2016 03:12
yes, im trying to figure out how to explain it @tvithaya
Joseph
@revisualize
Nov 08 2016 03:12
@tvithaya What is name?
@tvithaya is tracks a variable?
tvithaya
@tvithaya
Nov 08 2016 03:13
@revisualize I commented out the names variable when I relized it wasn't necessary. i didn't delete it from the exercise
Gabe
@gabecastelli
Nov 08 2016 03:13
btw name.hasOwnProperty(tracks) === false can be written as !name.hasOwnProperty(tracks)
tvithaya
@tvithaya
Nov 08 2016 03:14
wasn't sure if I could write it with the ! in front, good to know it is
Joseph
@revisualize
Nov 08 2016 03:14
But, tracks is NOT a variable.
tvithaya
@tvithaya
Nov 08 2016 03:14
tracks is a property
Gabe
@gabecastelli
Nov 08 2016 03:14
in the first if there's no need to check for the value
'if'*
for some reason
because if you check whether value is empty before anything there's no need to re-check after
tvithaya
@tvithaya
Nov 08 2016 03:16

this is the instructions for the exercise:

Write a function which takes an album's id (like 2548), a property prop (like "artist" or "tracks"), and a value (like "Addicted to Love") to modify the data in this collection.

If prop isn't "tracks" and value isn't empty (""), update or set the value for that record album's property.

Your function must always return the entire collection object.

There are several rules for handling incomplete data:

If prop is "tracks" but the album doesn't have a "tracks" property, create an empty array before adding the new value to the album's corresponding property.

If prop is "tracks" and value isn't empty (""), push the value onto the end of the album's existing tracks array.

If value is empty (""), delete the given prop property from the album.

Gabe
@gabecastelli
Nov 08 2016 03:16
they put it in a confusing order
try testing for value firstly
and
Joseph
@revisualize
Nov 08 2016 03:18
@tvithaya In your code. You're using tracks but, that is like a variable.
If you want "tracks" you need to use quotes.
Gabe
@gabecastelli
Nov 08 2016 03:18
collection[id][prop] = []
should be
collection[id][prop] = [value];
tvithaya
@tvithaya
Nov 08 2016 03:19
@revisualize thanks, updated the tracks to "tracks" can't believe I missed that
CamperBot
@camperbot
Nov 08 2016 03:19
tvithaya sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 2268 | @revisualize |http://www.freecodecamp.com/revisualize
Cole Maly
@malycole
Nov 08 2016 03:20
With the Chunky Monkey exercise. I'm struggling a little with how to move through the array and continue take different sections of the array on each iteration. My hunch is that it utilizes the loops value at some point but I can't for the life of me figure out how.

function chunkArrayInGroups(arr, size) {
  // Break it up.
  var sliced1;
  var array = [];

 for (var i =0; i<size; i++){
   sliced1 = arr.slice(i);
   array.push(sliced1);
 }

  return array;
}

chunkArrayInGroups(["a", "b", "c", "d"], 2);
tvithaya
@tvithaya
Nov 08 2016 03:20
@gabecastelli the instructions required a creation of an empty array if tracks is used, but there's no tracks property in the object
Cole Maly
@malycole
Nov 08 2016 03:21
also @revisualize thank you so much for the link to python tutor. It has been infinitely helpful in visualizing my code and how I implement/write it.
CamperBot
@camperbot
Nov 08 2016 03:21
malycole sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 2269 | @revisualize |http://www.freecodecamp.com/revisualize
tvithaya
@tvithaya
Nov 08 2016 03:22
@malycole shouldn't it be sliced1 = arr.slice[i]; ? since it's an array
Cole Maly
@malycole
Nov 08 2016 03:24
@tvithaya to the best of my understanding the slice method uses .slice(beginning, end) so my code is just unfinished. my more convoluted method uses it like this
 for (var i =0; i<size; i++){
   sliced1 = arr.slice(i*size, (i*size)+size);
   array.push(sliced1);
 }
tvithaya
@tvithaya
Nov 08 2016 03:25
oh wow, sorry @malycole , def read that whole thing wrong
haven't gotten to the .slice yet, so can't help, so disregard what I said...lol sorry
Cole Maly
@malycole
Nov 08 2016 03:31

So my final code (solves the challenge) looks like so:


function chunkArrayInGroups(arr, size) {
  // Break it up.
  var sliced1;
  var array = [];

 for (var i =0; i<arr.length/size; i++){
   sliced1 = arr.slice(i*size, (i*size)+size);
   array.push(sliced1);
 }

  return array;
}

chunkArrayInGroups([0, 1, 2, 3, 4, 5], 3);

Would this be considered rather convoluted or error prone in it's writing? And if so, how could I potentially make it more elegant?

Jordan Jones
@jordanjones98
Nov 08 2016 03:33
@malycole I am not a big fan of putting nubmers in variables, not a huge deal, but just a standards thing for me.
and space after i = 0; but really just standards things.
Nirmal Patel
@patelnk4
Nov 08 2016 03:36
@zarruk thank you
CamperBot
@camperbot
Nov 08 2016 03:36
patelnk4 sends brownie points to @zarruk :sparkles: :thumbsup: :sparkles:
:cookie: 291 | @zarruk |http://www.freecodecamp.com/zarruk
James E Scruggs III
@jamesscruggs
Nov 08 2016 04:04

Hello lovely people! Can anyone explain the function of these symbols together?

%=

Much appreciated

Jordan Jones
@jordanjones98
Nov 08 2016 04:06
Modulo of two numbers
modulo is like remainder
James E Scruggs III
@jamesscruggs
Nov 08 2016 04:09
@jordanjones98 I know the % is a mudolo. I'm think that with the equal sign it means something different. I noticed it in some code I was reading that read:
acc.num %= rom[ch];
Jordan Jones
@jordanjones98
Nov 08 2016 04:10
I will explain with += to make easier
James E Scruggs III
@jamesscruggs
Nov 08 2016 04:11
@jordanjones98 Does it work that same as +=?
Jordan Jones
@jordanjones98
Nov 08 2016 04:12
var numberOne;

numberOne = 2;

numberOne += 3;

document.write(numberOne);
Here numberOne would be given the variable 5 because 2+3=5
just a quicker way of doing things
James E Scruggs III
@jamesscruggs
Nov 08 2016 04:13
Ah i see thank @jordanjones98
CamperBot
@camperbot
Nov 08 2016 04:13
jamesscruggs sends brownie points to @jordanjones98 :sparkles: :thumbsup: :sparkles:
:cookie: 26 | @jordanjones98 |http://www.freecodecamp.com/jordanjones98
Jeff Shapiro
@Jeff-Shapiro
Nov 08 2016 04:14
@jordanjones98 thats not true
the numberOne variable is assigned a value of 2 but has a total calulated value of 5
Jordan Jones
@jordanjones98
Nov 08 2016 04:17
True, but right concept.
Minh Phan
@minhphan2506
Nov 08 2016 04:32
@minhphan2506
Hi, I am trying to get data from openweathermap, but my code doesn't seem to work. Could someone help?
$.getJSON("http://api.openweathermap.org/data/2.5/weather?q=London&APPID=529a1528488af330f1019049324319ec",
function(data){
console.log(data);
});
Jax
@jax11000
Nov 08 2016 04:33
this incrementation challenge makes no sense to me. i get the correct answer but it says myVar=myVar should be changed. maybe im missing something obvious but i dont get it.
can someone point out my stupidity? lol
Jeff Shapiro
@Jeff-Shapiro
Nov 08 2016 04:41
@jax11000 Show us some of your cool code
__mifflin__
@cdrainxv
Nov 08 2016 04:41
@jax11000:
var x = 1;
    x = x + 1; // x is now 2 
    x++; // x is now 3
Jeff Shapiro
@Jeff-Shapiro
Nov 08 2016 04:41
thats not very 1337 of you @cdrainxv
Jax
@jax11000
Nov 08 2016 04:42

@Jeff-Shapiro
var myVar = 87;

// Only change code below this line
myVar = myVar++ +1 ;

Jeff Shapiro
@Jeff-Shapiro
Nov 08 2016 04:42
what have you got to do @jax11000
__mifflin__
@cdrainxv
Nov 08 2016 04:42
@Jeff-Shapiro: I don’t understand?
Jax
@jax11000
Nov 08 2016 04:43
the only thing it doesnt pass is change myVar=myVar its the incrementation challenge
Jeff Shapiro
@Jeff-Shapiro
Nov 08 2016 04:43
Hmm strange @cdrainxv your message notification picture is different to your one on here
so @jax11000 myVar = myVar++ +1 ; is not correct
__mifflin__
@cdrainxv
Nov 08 2016 04:44
@Jeff-Shapiro: I usually use l33t.
Yeah… I change it about every two weeks. It takes time before github reflects the changes fully on Gitter.
Jeff Shapiro
@Jeff-Shapiro
Nov 08 2016 04:45
nah its all numbers '1337'
Patrick Walters
@patwalt
Nov 08 2016 04:45
Hey, there, everyone
__mifflin__
@cdrainxv
Nov 08 2016 04:45
For leet.. no?
Jeff Shapiro
@Jeff-Shapiro
Nov 08 2016 04:45
Hey @patwalt
Patrick Walters
@patwalt
Nov 08 2016 04:45
I need a little help from a Javascript expert. Thanks, @Jeff-Shapiro!
CamperBot
@camperbot
Nov 08 2016 04:45
patwalt sends brownie points to @jeff-shapiro :sparkles: :thumbsup: :sparkles:
:cookie: 315 | @jeff-shapiro |http://www.freecodecamp.com/jeff-shapiro
Jeff Shapiro
@Jeff-Shapiro
Nov 08 2016 04:46
@Manish-Giri is the king. He writes the bible of Javascript
Manish Giri
@Manish-Giri
Nov 08 2016 04:46
lol, yeah right
Jeff Shapiro
@Jeff-Shapiro
Nov 08 2016 04:46
nah kidding @patwalt whats up?
Patrick Walters
@patwalt
Nov 08 2016 04:47
I had a question about writing automated tests for javascript components of a web app.
__mifflin__
@cdrainxv
Nov 08 2016 04:47
@Jeff-Shapiro: Come on… I know that… :smile:
Patrick Walters
@patwalt
Nov 08 2016 04:48
Do any of you like/recommend or possibly hate Selenium for this task?
I've been involved in using HP UFT for the last 5 years, but it has it's own very expensive problems...
Jeff Shapiro
@Jeff-Shapiro
Nov 08 2016 04:48
Isn't selenium a chemical element
Patrick Walters
@patwalt
Nov 08 2016 04:48
It is as well, yes
But it's also an open source Testing framework
But building tests for it is very much like writing code
Jeff Shapiro
@Jeff-Shapiro
Nov 08 2016 04:49
Have you got a mac?
Patrick Walters
@patwalt
Nov 08 2016 04:52
I do, but I have my daughter using it as her notebook. I replaced mine with a Dell Inspiron 7000 series (i7 with 17" screen, 4 processors, and 16GB)
Jeff Shapiro
@Jeff-Shapiro
Nov 08 2016 04:52
4 processors?! in one laptop?!
Patrick Walters
@patwalt
Nov 08 2016 04:52
:)
It's a big, heavy laptop (Thankfully, I'm 6'2"/250lbs)
I believe it would work very well for a single-use blugeoning tool
Anyway, I would be very interested to talk to anyone that has a test framework they either love or are fighting with that is testing HTML5/Angular2/TypeScript/D3/SASS
Jeff Shapiro
@Jeff-Shapiro
Nov 08 2016 04:55
I use Automation
And I just code so well I get no errors too
Patrick Walters
@patwalt
Nov 08 2016 04:55
LOL
Jeff Shapiro
@Jeff-Shapiro
Nov 08 2016 04:55
the last point is intermitent
Patrick Walters
@patwalt
Nov 08 2016 04:56
Good one, @Jeff-Shapiro !
Alan Mathew
@alanmathew6711251
Nov 08 2016 05:13
I am working on the problem from FCC. Return Largest Numbers in @alanmathew6711251
Hi. Can someone help me in understand this code.
function largestOfFour(arr) {
return arr.map(function(group){
return group.reduce(function(prev, current) {
return (current > prev) ? current : prev;
}, 0);
});
}
to*
Brig
@briglewis
Nov 08 2016 05:16
hey all - who has logical operators down?
nevermind - sorted! Ya know when ask for help and sudennly you get it! #thatmoment ;-)
*suddenly
Ace
@acekalama
Nov 08 2016 05:22
can anyone help me with switch?
Luke Winkelmann
@LGWinkelmann
Nov 08 2016 05:26
so i need help wit Nesting For Loops

function multiplyAll(arr) {
  var product = 1;
  // Only change code below this line
  for (var i = 0; i < arr.length; i++) {
    for (var j = 0; j <arr[i].lenght; j++){
      console.log(product[i][j]);
    }
  }
  // Only change code above this line
  return product;
}

// Modify values below to test your code
multiplyAll([[1,2],[3,4],[5,6,7]]);
and show me what u have @acekalama i will do my best to help
Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 08 2016 05:28
@LGWinkelmann what is the problem ?
Luke Winkelmann
@LGWinkelmann
Nov 08 2016 05:28

well i have my code there and its not right. nstructions

Modify function multiplyAll so that it multiplies the product variable by each number in the sub-arrays of arr

Instructions*
heroiczero
@heroiczero
Nov 08 2016 05:29
@LGWinkelmann try using the *=
Manish Giri
@Manish-Giri
Nov 08 2016 05:29
@LGWinkelmann for (var j = 0; j <arr[i].lenght; j++)
Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 08 2016 05:29
first of my eye see bugs such as typo in length
@LGWinkelmann
Luke Winkelmann
@LGWinkelmann
Nov 08 2016 05:30
@heroiczero ... wow yea i really should lol. thanks
CamperBot
@camperbot
Nov 08 2016 05:30
lgwinkelmann sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:cookie: 360 | @heroiczero |http://www.freecodecamp.com/heroiczero
Luke Winkelmann
@LGWinkelmann
Nov 08 2016 05:32
what typo? i am missing it
Emil Aasa
@emilaasa
Nov 08 2016 05:32
length != lenght
Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 08 2016 05:32
^
@LGWinkelmann
Luke Winkelmann
@LGWinkelmann
Nov 08 2016 05:34
This outputs each sub-element in arr one at a time. Note that for the inner loop, we are checking the .length of arr[i], since arr[i] is itself an array. lol i was just copied out if instructions lol should have known better
its cool i just found out yesterday you use ```
Ace
@acekalama
Nov 08 2016 05:37
@LGWinkelmann how do we send the code?
Luke Winkelmann
@LGWinkelmann
Nov 08 2016 05:37

```js
then hit enter and then copy your code
the instructor had a link idk how to send you that
Ace
@acekalama
Nov 08 2016 05:40
function caseInSwitch(val) {
  var answer = "";
  // Only change code below this line
  switch (val) {
    case val:
      answer = "alpha";
      break;
    case val 2:
      answer = "beta";
      break;
  }


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

// Change this value to test
caseInSwitch(1);
@LGWinkelmann i cant seem to get the case 2 right.
heroiczero
@heroiczero
Nov 08 2016 05:41
@acekalama i dont think you have to state val
@acekalama u can do case 1: and case 2:
Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 08 2016 05:42
@acekalama nope you don't have to state val after case
Luke Winkelmann
@LGWinkelmann
Nov 08 2016 05:42
what they said :)
Ace
@acekalama
Nov 08 2016 05:43
@Mr-Kumar-Abhishek @heroiczero @LGWinkelmann thanks guys.
CamperBot
@camperbot
Nov 08 2016 05:43
acekalama sends brownie points to @mr-kumar-abhishek and @heroiczero and @lgwinkelmann :sparkles: :thumbsup: :sparkles:
:cookie: 134 | @lgwinkelmann |http://www.freecodecamp.com/lgwinkelmann
:cookie: 362 | @heroiczero |http://www.freecodecamp.com/heroiczero
:cookie: 398 | @mr-kumar-abhishek |http://www.freecodecamp.com/mr-kumar-abhishek
Luke Winkelmann
@LGWinkelmann
Nov 08 2016 05:48
so i still cant get the code to out put anything other than 1. the code doesnt like i = or j= tried putting other properties after it but they change nothing. what am i either over looking or just over thinking. ```js

function multiplyAll(arr) {
  var product = 1;
  // Only change code below this line
  for (var i = 0; i < arr.lenght; i++ ) {
    for (var j = 0; j <arr[i].lenght; j++) {
      console.log(arr[i][j]);
    }
  }
  // Only change code above this line
  return product;
}

// Modify values below to test your code
multiplyAll([[1,2],[3,4],[5,6,7]]);
thats suppose to be *=
heroiczero
@heroiczero
Nov 08 2016 05:50
@LGWinkelmann .length not lenght
__mifflin__
@cdrainxv
Nov 08 2016 05:50
@LGWinkelmann: b/c your product is 1 at the top and it didn’t change when you returned it at the bottom.
Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 08 2016 05:50
@LGWinkelmann length spelling is length and further hmm... what is the problem with multiply ??
Luke Winkelmann
@LGWinkelmann
Nov 08 2016 05:51
ugh.... need to work and my spelling and one sec i try to sho
show
Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 08 2016 05:52
@LGWinkelmann console.log(arr[i][j]); <-- change this line for multiplication :)
heroiczero
@heroiczero
Nov 08 2016 05:52
@LGWinkelmann try using the product in the for loop so you can multiply the element in each of the array.
Luke Winkelmann
@LGWinkelmann
Nov 08 2016 06:01
so i tried changing it for multiplication and idk if i am doing it wrong or what and also changed product for arr in the loop. no changes. :( also it says i cant change that 1 when product is declared.
Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 08 2016 06:06
@LGWinkelmann yes for products you need to keep the default value as 1
Luke Winkelmann
@LGWinkelmann
Nov 08 2016 06:06
k well didnt change that so there is a plus :)
Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 08 2016 06:07
@LGWinkelmann your previous code was correct apart from the typo and the line I mentioned to change before
that line should contain your multiplication operation
@LGWinkelmann assign an (you could say) algebraic value for product in that line
@LGWinkelmann it would be as product = something * something ~
@LGWinkelmann you have to figure out how it works :) you could apply shortcuts later ~ first understand
Luke Winkelmann
@LGWinkelmann
Nov 08 2016 06:12
thankyou so very much you your time i am happy to say i got it before u sent that last line.
the last 2 now :)
Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 08 2016 06:12
so show us the code :d
:D
Luke Winkelmann
@LGWinkelmann
Nov 08 2016 06:13

function multiplyAll(arr) {
  var product = 1;
  // Only change code below this line
  for (var i = 0; i < arr.length; i ++) {
    for (var j = 0; j < arr[i].length; j ++) {
      console.log(product *= arr[i][j]);
    }
  }
  // Only change code above this line
  return product;
}

// Modify values below to test your code
multiplyAll([[1,2],[3,4],[5,6,7]]);
Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 08 2016 06:14
do you still need to log the value ?? it is correct though :p
with the shortcut ~
Luke Winkelmann
@LGWinkelmann
Nov 08 2016 06:15
no it says nothing of needing to log the value
Vidhi patel
@VidhiPatel5151
Nov 08 2016 06:16
$(".slider").slider({
range: "min",
value: 0,
min: 0,
max: 10,
slide: function( event, ui ) {
$( ".slidergrid" ).html( LoadTable(sName) );
}
});
Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 08 2016 06:16
I would have removed console.log() lastly ~ I don't know what other FCC members do though
Vidhi patel
@VidhiPatel5151
Nov 08 2016 06:16
this is my function but it is not display the grid
$(".slider").slider({
range: "min",
value: 0,
min: 0,
max: 10,
slide: function( event, ui ) {
$( ".slidergrid" ).html( LoadTable(sName) );
}
});
can ony one help me
Luke Winkelmann
@LGWinkelmann
Nov 08 2016 06:17
yea i was just doing as the instructions showed cause really idk how console.log() works
Vidhi patel
@VidhiPatel5151
Nov 08 2016 06:17
console.log give the value actual which show in console
@LGWinkelmann
Luke Winkelmann
@LGWinkelmann
Nov 08 2016 06:18
o ok thanks @VidhiPatel5151
CamperBot
@camperbot
Nov 08 2016 06:18
lgwinkelmann sends brownie points to @vidhipatel5151 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for vidhipatel5151
Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 08 2016 06:18
@VidhiPatel5151 is this for a zipline challange ??
challenge *
Vidhi patel
@VidhiPatel5151
Nov 08 2016 06:19
i can show how it is work @LGWinkelmann
Luke Winkelmann
@LGWinkelmann
Nov 08 2016 06:20
yea case these challenges are great but they some times little to explain
Vidhi patel
@VidhiPatel5151
Nov 08 2016 06:21
@Mr-Kumar-Abhishek sorry
blob
@LGWinkelmann see in this image in last i write consol.log n variable which i use for check the value
@Mr-Kumar-Abhishek yes
plez any one help me for this function '$(".slider").slider({
range: "min",
value: 0,
min: 0,
max: 10,
slide: function( event, ui ) {
$( ".slidergrid" ).html( LoadTable(sName) );
}
});'
Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 08 2016 06:24
@VidhiPatel5151 uhm... do you have it it source code in github or codepen ??
its*
Vidhi patel
@VidhiPatel5151
Nov 08 2016 06:25
no @Mr-Kumar-Abhishek
but i want to do one thing i show @Mr-Kumar-Abhishek
Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 08 2016 06:26
@VidhiPatel5151 it will be difficult for me or anyone else (probably ) to interpret and understand the real problem then . lets see though
Luke Winkelmann
@LGWinkelmann
Nov 08 2016 06:27
ok cool i got it.
Vidhi patel
@VidhiPatel5151
Nov 08 2016 06:27
@Mr-Kumar-Abhishek ok
Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 08 2016 06:30
hmmm... say I can't get hold of the real problem (check minor bugs is the first suggestion ) but what is the challenge's name ?
@VidhiPatel5151
Philipp Scholz
@philipp32
Nov 08 2016 06:35
var Bike = function() {
  myBike.getGear = 2;
  myBike.setGear = 2;
  var gear = 3;

  // Only change code below this line.

};
It says here that I cannot set the property of getGear of undefined.
What does that mean?
Aldair
@ald1413
Nov 08 2016 06:37

Hello can anyone help me with my code for the Where do I belong challenge?


function getIndexToIns(arr, num) {
  // Find my place in this sorted array.
  arr.push(num);
  arr.sort();
  return arr.indexOf(num);
}

getIndexToIns([40, 60], 50);

I figured if i add the second argument into the array it will sort by itself, by using indexOf i can get the position of the second argument. However i still cant figure out how i can erase repetitions in the array if the second argument also exist on the first

Data Detective
@WCoaster77
Nov 08 2016 06:37
@philipp32 I believe it means you must return something at the end of the function.
Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 08 2016 06:38
it is not*
Vidhi patel
@VidhiPatel5151
Nov 08 2016 06:38
i have one progressbar slider n slider contain some value suppose progressbar slider stop at the 3 position of progressbar slider blewo i have displayed one grid that contain the data related progressbar slider value 3 no is coming so in grid which data contain range 3 that show on the grid now i have to do if user menually change progressbar slider then grid have also updated n progressbar slider values blow display the grid data @Mr-Kumar-Abhishek
Markus Kiili
@Masd925
Nov 08 2016 06:39
@ald1413 The default sort is not numerical sort. It should work after fixing that.
Philipp Scholz
@philipp32
Nov 08 2016 06:40
@WCoaster77 solved it. thank you. :)
CamperBot
@camperbot
Nov 08 2016 06:40
philipp32 sends brownie points to @wcoaster77 :sparkles: :thumbsup: :sparkles:
:cookie: 201 | @wcoaster77 |http://www.freecodecamp.com/wcoaster77
Philipp Scholz
@philipp32
Nov 08 2016 06:41
var oldArray = [1,2,3,4,5];

// Only change code below this line.
var plusThree = oldArray.map(function(val){
  return val + 3;

});

var newArray = oldArray;

The error says that I should add three to each value of the array. In their example they use:

var oldArray = [1, 2, 3];
var timesFour = oldArray.map(function(val){
  return val * 4;
});

I can't find my error. :/

Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 08 2016 06:41
@VidhiPatel5151 hmmm.. sorry wait for others for help ~ or try out frontend chatroom FCC I haven't gotten to that part yet ~
chatroom of FCC *
Markus Kiili
@Masd925
Nov 08 2016 06:42
@philipp32 myBike should be created outside the constructor using new keyword.
Aldair
@ald1413
Nov 08 2016 06:42

I got it!


function getIndexToIns(arr, num) {
  // Find my place in this sorted array.
  arr.push(num);
  arr.sort(function noRepetition(a, b) {
    return a - b;
  });
  return arr.indexOf(num);
}

getIndexToIns([40, 60], 50);

thank you @Masd925 for pointing out the problem!

CamperBot
@camperbot
Nov 08 2016 06:42
ald1413 sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 2854 | @masd925 |http://www.freecodecamp.com/masd925
Vidhi patel
@VidhiPatel5151
Nov 08 2016 06:43
wht is fcc??
@Mr-Kumar-Abhishek
Markus Kiili
@Masd925
Nov 08 2016 06:43
@philipp32 Methods should be created inside the constructor like this.getGear = function (...){...};
@ald1413 There is also a clever way to solve it without sorting at all.
Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 08 2016 06:43
@VidhiPatel5151 FCC -> free code camp :)
Philipp Scholz
@philipp32
Nov 08 2016 06:45
@Masd925 thank you.
CamperBot
@camperbot
Nov 08 2016 06:45
philipp32 sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 2855 | @masd925 |http://www.freecodecamp.com/masd925
Philipp Scholz
@philipp32
Nov 08 2016 06:45
I believe this challenge here is bugged. I googled for the solution and it is the same as my code. Yet it won't pass. I've tried to reset the code 4 times now. :/
Markus Kiili
@Masd925
Nov 08 2016 06:46
@philipp32 Post the code please.
And the challenge name.
Philipp Scholz
@philipp32
Nov 08 2016 06:47
@Masd925 It worked. But only if you change a lot of code that should be changed. -.- This has happened to me before. Really annoying. :/ Thanks.
CamperBot
@camperbot
Nov 08 2016 06:47
philipp32 sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:warning: philipp32 already gave masd925 points
Vidhi patel
@VidhiPatel5151
Nov 08 2016 06:48
lolzz :smile: @Mr-Kumar-Abhishek
Alexandra
@aftrant
Nov 08 2016 06:54
Just out of curiosity, why would you use array.unshift("text") vs. array[0] = "text"?
Never mind
Once I wrote it down I realized it
Markus Kiili
@Masd925
Nov 08 2016 06:58
@aftrant The second one overwrites the first element. Using arr[i]=... syntax can also produce arrays with holes, which should be avoided. So using methods for adding and removing elements is safer.
ffelix
@faerthen
Nov 08 2016 07:00

I'm completely lost at JavaScript 'Stand in Line" section. A little help? function nextInLine(arr, item) {
// Your code here
var myNumber = 5; // create 'item'
var originalArr = [1,2,3,4]; // create 'arr'
newArray = originalArray.push(myNumber); // append 'item' to 'arr' queue
removedNum = newArray.shift(); // cut first entry from the 'arr' queue
return removedNum; // return the clipped first entry
}

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

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

Markus Kiili
@Masd925
Nov 08 2016 07:00
@faerthen You should only use arr and item and two array methods inside the function.
ffelix
@faerthen
Nov 08 2016 07:01
You mean only arr and item as variables?
@Masd925 You mean arr and item as the only variables?
Data Detective
@WCoaster77
Nov 08 2016 07:02
@faerthen remeber, you variables will be supplied to your function by the testArr. You don't have to provide the numbers
Markus Kiili
@Masd925
Nov 08 2016 07:02
@faerthen Yes, those parameters hold the passed array and number.
ffelix
@faerthen
Nov 08 2016 07:03
@Masd925 Ok, I'll play with it. Thx!
CamperBot
@camperbot
Nov 08 2016 07:03
faerthen sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 2856 | @masd925 |http://www.freecodecamp.com/masd925
Jeff Shapiro
@Jeff-Shapiro
Nov 08 2016 07:03
@WCoaster77 you mean parameters?
Data Detective
@WCoaster77
Nov 08 2016 07:04
ah, yes parameters. Thanks @Jeff-Shapiro
CamperBot
@camperbot
Nov 08 2016 07:04
wcoaster77 sends brownie points to @jeff-shapiro :sparkles: :thumbsup: :sparkles:
:cookie: 316 | @jeff-shapiro |http://www.freecodecamp.com/jeff-shapiro
adilkara
@adilkara
Nov 08 2016 07:07
help please. can anyone spot mistake in following line
CamperBot
@camperbot
Nov 08 2016 07:07
no wiki entry for: please can anyone spot mistake in following line
adilkara
@adilkara
Nov 08 2016 07:07
} else if (num<10);{
Markus Kiili
@Masd925
Nov 08 2016 07:08
@adilkara Remove the semicolon there.
christiannguyen
@christiannguyen
Nov 08 2016 07:08
why do you have the semi colon
can someone help me with the record collection problem?

im not sure where im going wrong
if(collection.hasOwnProperty(prop) === true){
if(value !== ""){
collection.id.prop.push(value);
}
}

return collection;

adilkara
@adilkara
Nov 08 2016 07:09
i'm sorry i din't see that
Data Detective
@WCoaster77
Nov 08 2016 07:10
@adilkara all good sometimes it just that simple and a second pair of eyes can help. :-)
Data Detective
@WCoaster77
Nov 08 2016 07:33
@vuvu10 do you have the code you tried so far?
DC
@vuvu10
Nov 08 2016 07:33
@WCoaster77 this is the 1: var myStr = "<a href= http://www.example.com target=_blank>Link</a>";
Data Detective
@WCoaster77
Nov 08 2016 07:38
you do not want to remove the double quotes from the string only the backslashes.
@vuvu10
you will need to use two single quotes ' ' to make it work.
Reset you code and try again. Let me know if you get closer.
@vuvu10 any luck?
Ogundele Olumide
@Lumexralph
Nov 08 2016 07:45
@christiannguyen what's the challenge? what are you to do if the value is not empty
DC
@vuvu10
Nov 08 2016 07:46
@WCoaster77 All i had to do is replace the opening double quotes before <ahref tag with single quotes. It worked. Thanks.
CamperBot
@camperbot
Nov 08 2016 07:46
vuvu10 sends brownie points to @wcoaster77 :sparkles: :thumbsup: :sparkles:
:cookie: 211 | @wcoaster77 |http://www.freecodecamp.com/wcoaster77
Data Detective
@WCoaster77
Nov 08 2016 07:46
There you go! Good Stuff!
Ogundele Olumide
@Lumexralph
Nov 08 2016 07:46
@christiannguyen and the property exists?
Ilian Iliev
@zaken
Nov 08 2016 07:53
What's up guys
Markus Kiili
@Masd925
Nov 08 2016 07:54
@dzift Lowercase them strings and loop second string characters.
Ludovic Bourgoin
@ludobourgoin
Nov 08 2016 07:55
Hi guys, I'm stuck here and I think there's a bug. Would you mind having a quick look ?

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

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

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

// Change this value to test
phoneticLookup("charlie");
Data Detective
@WCoaster77
Nov 08 2016 07:57
@ludobourgoin what's the name of that challenge?
Ilian Iliev
@zaken
Nov 08 2016 07:58
@Masd925 do you split the second string ?
Ludovic Bourgoin
@ludobourgoin
Nov 08 2016 07:58
@WCoaster77 Using Objects for Lookups
Markus Kiili
@Masd925
Nov 08 2016 07:58
@dzift No need for arrays.
Data Detective
@WCoaster77
Nov 08 2016 07:59
you have not returned anything in the var result it is still empty.
@ludobourgoin
```
Ludovic Bourgoin
@ludobourgoin
Nov 08 2016 08:00
@WCoaster77 Mmmmh! (thinking) :)
Data Detective
@WCoaster77
Nov 08 2016 08:01
"":undefined,
is not needed.
Ogundele Olumide
@Lumexralph
Nov 08 2016 08:02
@ludobourgoin you're to check for the value of that property if it exists, right?
Ryan VanDyke
@ryanjvandyke
Nov 08 2016 08:03
var newArray = oldArray;
array = oldArray.map(function(val){
  return val + 3;
});
ok so I should be adding 3 to each value in the array... what am I doing wrong here?
Ludovic Bourgoin
@ludobourgoin
Nov 08 2016 08:03
@WCoaster77 : "you have not returned anything in the var result it is still empty." But it says "only change code below this line, so i shouldn't have to change, right?
Ogundele Olumide
@Lumexralph
Nov 08 2016 08:03
@ludobourgoin your result is still an empty string, result = lookup[val]
Ludovic Bourgoin
@ludobourgoin
Nov 08 2016 08:04
to change
var result = "";
Data Detective
@WCoaster77
Nov 08 2016 08:04
@Lumexralph you should try and let people figure it out for them selves not give answers
@ludobourgoin almost
Ludovic Bourgoin
@ludobourgoin
Nov 08 2016 08:06
@WCoaster77 @Lumexralph Thanks guys :)
CamperBot
@camperbot
Nov 08 2016 08:06
ludobourgoin sends brownie points to @wcoaster77 and @lumexralph :sparkles: :thumbsup: :sparkles:
:cookie: 212 | @wcoaster77 |http://www.freecodecamp.com/wcoaster77
:cookie: 414 | @lumexralph |http://www.freecodecamp.com/lumexralph
Ogundele Olumide
@Lumexralph
Nov 08 2016 08:07
@WCoaster77 i understand
Data Detective
@WCoaster77
Nov 08 2016 08:08
Awesome stuff. :smile:
lazycat
@lazycat92
Nov 08 2016 08:10
hello , everyone , I am new here
Data Detective
@WCoaster77
Nov 08 2016 08:10
Hello @lazycat92
Ogundele Olumide
@Lumexralph
Nov 08 2016 08:11
@ryanjvandyke what's the issue? if you return array, it should return the newarray with the new values
lazycat
@lazycat92
Nov 08 2016 08:11
hello
Ogundele Olumide
@Lumexralph
Nov 08 2016 08:12
@lazycat92 hi
welcome
Markus Kiili
@Masd925
Nov 08 2016 08:13
@lazycat92 Aks here if (when :) ) you get stuck on a challenge or have some JS related questions.
Phillip Kelley-Dotson
@pkdotson
Nov 08 2016 08:14
anyone have any advice on the chunky money algorithm. this one is pretty hard.
Markus Kiili
@Masd925
Nov 08 2016 08:15
@philipp32 You could iterate arr indices with increment +=size and use .slice() to make subarrays to push into result array.
Ogundele Olumide
@Lumexralph
Nov 08 2016 08:15
@pkdotson :smile: you can paste what you're to do, we can help with pseudo code
lazycat
@lazycat92
Nov 08 2016 08:15
of course, I will , I know that you are all friendly
Markus Kiili
@Masd925
Nov 08 2016 08:15
@lazycat92 No, not always. 6 months ago I told someone his code was crap.
Phillip Kelley-Dotson
@pkdotson
Nov 08 2016 08:16
this is what i have so far.

function chunkArrayInGroups(arr, size) {
// Break it up.
var newArr = [];
var arrSplt = 0;
for (arr = 0; arr.length < 0; arr++)

return arr.slice(0, size).push(newArr);
}

chunkArrayInGroups(["a", "b", "c", "d"], 2);

Ogundele Olumide
@Lumexralph
Nov 08 2016 08:16
@lazycat92 :smile: so far we respect each other, we're good
Markus Kiili
@Masd925
Nov 08 2016 08:16
@pkdotson Don't use arr as the loop variable.
Blauelf
@Blauelf
Nov 08 2016 08:17
@pkdotson push works the other way around, arrToPushTo.push(thingToPush)
@pkdotson Also, you would not want to return in a loop, as returning ends the function (and therefore also the loop)
Ogundele Olumide
@Lumexralph
Nov 08 2016 08:18
@pkdotson remember that when you use return, you exit the function
@pkdotson i'll suggest you avoid returning in loops and in functions until you've gotten your result or what you want
Phillip Kelley-Dotson
@pkdotson
Nov 08 2016 08:19
thanks @Lumexralph , @Blauelf , @Masd925
CamperBot
@camperbot
Nov 08 2016 08:19
pkdotson sends brownie points to @lumexralph and @blauelf and @masd925 :sparkles: :thumbsup: :sparkles:
:cookie: 415 | @lumexralph |http://www.freecodecamp.com/lumexralph
:star2: 2819 | @blauelf |http://www.freecodecamp.com/blauelf
:star2: 2857 | @masd925 |http://www.freecodecamp.com/masd925
Ogundele Olumide
@Lumexralph
Nov 08 2016 08:21
@lazycat92 if you need any help or clarification, we're all here to help and learn
Markus Kiili
@Masd925
Nov 08 2016 08:21
@pkdotson I suggest that you loop over arr indices with increment i = i + size and then figure out slice arguments.
lazycat
@lazycat92
Nov 08 2016 08:22
thanks
Tofara Makombe
@toffymakombe23
Nov 08 2016 08:22

Hi not sure what is wrong with this function isLess(a, b) {
// Fix this code
return a === b;
}

// Change these values to test
isLess(10, 15);

André
@pennyJack
Nov 08 2016 08:23

Hey guys, just a minor question from the Challenge "Counting Cards". I already solved the task, but I'm a bit confused with a tiny thing:

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

Why do the return statements give back a full string, like "2 Bet" or "-2 Hold", since the count variable is a number but the second expression is a string. Does JS automatically convert the variable count into a string because it recognizes the concatenation operator(i.e. "+")?

Ogundele Olumide
@Lumexralph
Nov 08 2016 08:24
@toffymakombe23 if you compare a ===b, it will return true if they are equal, while don't you work on your comprison operator to check a les than b
Markus Kiili
@Masd925
Nov 08 2016 08:25
@pennyJack Yes. You could also do it explicitly String(count) + " Bet"
lazycat
@lazycat92
Nov 08 2016 08:25
@pennyJack yes, it does
André
@pennyJack
Nov 08 2016 08:25
@Masd925 @lazycat92 Thanks! :)
CamperBot
@camperbot
Nov 08 2016 08:25
pennyjack sends brownie points to @masd925 and @lazycat92 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for lazycat92
:star2: 2858 | @masd925 |http://www.freecodecamp.com/masd925
Ogundele Olumide
@Lumexralph
Nov 08 2016 08:25
@toffymakombe23 you're to return true if a is less than b, so what comparison operator will you use for that?
@lazycat92 you should receive brownie points, how did you do your FCC setup?
Emmanuel
@chriemma
Nov 08 2016 08:27
what is wrong with this code var myName="Emmanuel";
lazycat
@lazycat92
Nov 08 2016 08:27
I just doing that
Ogundele Olumide
@Lumexralph
Nov 08 2016 08:28
@chriemma it's a string declaration, there's nothing wrong with it
André
@pennyJack
Nov 08 2016 08:28
By the way: what actually are the Brownie Points good for? :D
Ogundele Olumide
@Lumexralph
Nov 08 2016 08:29
@pennyJack just a compensation for your efforts for helping people out, it's linked with your FCC, lol
André
@pennyJack
Nov 08 2016 08:29
:( I hoped I'd get some cookies someday..
Ogundele Olumide
@Lumexralph
Nov 08 2016 08:29
@pennyJack you can get now, thanks....lol
CamperBot
@camperbot
Nov 08 2016 08:29
lumexralph sends brownie points to @pennyjack :sparkles: :thumbsup: :sparkles:
:cookie: 197 | @pennyjack |http://www.freecodecamp.com/pennyjack
André
@pennyJack
Nov 08 2016 08:30
:D
Blauelf
@Blauelf
Nov 08 2016 08:30
@chriemma If you're on Declare JavaScript Variables, there you are to just declare the variable, not initialize it (so just var myName;). Or are you somewhere else?
Ogundele Olumide
@Lumexralph
Nov 08 2016 08:30
@pennyJack :+1:
the son of god
@the-god-of-son
Nov 08 2016 08:31
i hava a question
function sumPrimes(num){
    var newArr=[];
    for(var i=1;i<1000;i++){
        var total=0;
        for(var j=1;j<=Math.sqrt(i);j++){

            if((i%j)==0){
                total++;
                alert(i);
            }
            if(total<=2){
                newArr.push(i);
            }
        }
    }

    return newArr;
}
sumPrimes(3);
why newArr is wrong?
lazycat
@lazycat92
Nov 08 2016 08:32
I am not familiar with the FCC setup
Blauelf
@Blauelf
Nov 08 2016 08:32
@the-god-of-son You are meant to return the sum of the primes. And I don't see how num is used.
Ogundele Olumide
@Lumexralph
Nov 08 2016 08:32
@lazycat92 how did you signup?
Blauelf
@Blauelf
Nov 08 2016 08:33
@lazycat92 On FCC, you can link your Github account (I think one does that on the profile page, reached by clicking on the avatar or brownie point counter)
the son of god
@the-god-of-son
Nov 08 2016 08:34
@Blauelf i can't use total to control,now newArr is worong
Emmanuel
@chriemma
Nov 08 2016 08:34
@Blauelf @Blauelf am on declare javascript but can't work
Ogundele Olumide
@Lumexralph
Nov 08 2016 08:35
@chriemma what are you to do?
@lazycat92 click on the avatar or picture in your FCC page, go to link account, you can link it with your github account if you have
Blauelf
@Blauelf
Nov 08 2016 08:36
@chriemma Have you tried removing the initialization, having only var myName;? And sometimes page reload helps if your code seems to be correct.
eusid
@eusid
Nov 08 2016 08:37
anybody have difficulty with the wikipedia wiki ? i was able to get some data back once i started to use jsonp but i've since found the proper search query and it tells me no access control header, which i thought was supposed to be solved by jsonp? http://codepen.io/eusid/pen/pNvNjo
lazycat
@lazycat92
Nov 08 2016 08:37
I did that
Agung Tuah Ananda
@anan474
Nov 08 2016 08:37
@the-god-of-son how about 'for(var i=1;i<1000;i++){' to 'for(var i=1;i<num;i++){'
Ogundele Olumide
@Lumexralph
Nov 08 2016 08:38
@lazycat92 now?
lazycat
@lazycat92
Nov 08 2016 08:38
a few minutes ago
Ogundele Olumide
@Lumexralph
Nov 08 2016 08:39
@lazycat92 let's check if it's linked, thanks
CamperBot
@camperbot
Nov 08 2016 08:39
lumexralph sends brownie points to @lazycat92 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for lazycat92
the son of god
@the-god-of-son
Nov 08 2016 08:39
@anan474 i don't konw
lazycat
@lazycat92
Nov 08 2016 08:39
thanks
Agung Tuah Ananda
@anan474
Nov 08 2016 08:40
@eusid i have same issue, check in fcc forum will help
sumit kumar
@sumit-prgmr
Nov 08 2016 08:40
i cant get Manipulating Complex Objects in js
Ogundele Olumide
@Lumexralph
Nov 08 2016 08:40
@lazycat92 but it's not working
c0d0er
@c0d0er
Nov 08 2016 08:40
@yongslee79 thanks
CamperBot
@camperbot
Nov 08 2016 08:40
c0d0er sends brownie points to @yongslee79 :sparkles: :thumbsup: :sparkles:
:cookie: 422 | @yongslee79 |http://www.freecodecamp.com/yongslee79
Blauelf
@Blauelf
Nov 08 2016 08:41
@lazycat92 Is it linked with the same github account that you use for gitter?
about @lazycat92
CamperBot
@camperbot
Nov 08 2016 08:41
:warning: no user found for lazycat92
lazycat
@lazycat92
Nov 08 2016 08:43
yes
Agung Tuah Ananda
@anan474
Nov 08 2016 08:43
@the-god-of-son
if(total<=2){
shoud be
if(total>=2){
i think
lazycat
@lazycat92
Nov 08 2016 08:43
It may works now
Blauelf
@Blauelf
Nov 08 2016 08:44
about @lazycat92
CamperBot
@camperbot
Nov 08 2016 08:44
:warning: no user found for lazycat92
Blauelf
@Blauelf
Nov 08 2016 08:44
At least @camperbot thinks there's no FCC user for your github account.
lazycat
@lazycat92
Nov 08 2016 08:45
wait a minute
I have a see
the son of god
@the-god-of-son
Nov 08 2016 08:45
@anan474 wrong,,,
Abhisek Pattnaik
@abhisekp
Nov 08 2016 08:47
@Blauelf i've added an algorithm explanation of the advanced rot13 algorithm
Could you please review and give some feedback or suggestions wherever necessary for beginners to understand it better.
http://forum.freecodecamp.com/t/algorithm-caesars-cipher/16003
Agung Tuah Ananda
@anan474
Nov 08 2016 08:52
@the-god-of-son what output you expect?
lazycat
@lazycat92
Nov 08 2016 08:53
@Blauelf I only have a github accout , but I don't know why it does't work
one
Blauelf
@Blauelf
Nov 08 2016 08:55
@abhisekp I think it's not clear why omitting the shifting by -65 and then by +13 is possible (it is only because (-65+13)%26 is 0), as the formula itself would be the same as in the intermediate version. The lengthy explanation of modulo operator might also apply to the intermediate version (as that uses the same maths, just with explicit shifting by -65 and +13, which makes it possible to adapt the code for other Caesar shifts)
Ogundele Olumide
@Lumexralph
Nov 08 2016 08:55
@lazycat92 have you checked your FCC profile?
DC
@vuvu10
Nov 08 2016 08:56
I need help with this: var myStr= "FirstLine\nSecondLine\rThirdLine\";
the son of god
@the-god-of-son
Nov 08 2016 08:57
@anan474 i want output Prime array
Blauelf
@Blauelf
Nov 08 2016 08:57
@lazycat92 Maybe @camperbot is not real-time in that aspect. Do you have a profile link you could show, so I can check whether the profile looks as if it is linked?
@vuvu10 In your string var myStr= "FirstLine\nSecondLine\rThirdLine\\"; there is a \\ at the end, but there should be two \\ in the string, around SecondLine, not at the end.
@the-god-of-son Is that the task?
the son of god
@the-god-of-son
Nov 08 2016 08:59
Sum All Primes
this algorithm
Blauelf
@Blauelf
Nov 08 2016 09:00
@the-god-of-son Sum All Primes (you should return a sum only, not an array). And do you use parameter num?
Kush Sharma
@N0M9D
Nov 08 2016 09:01
Hey Everyone, Which API to use for the Random Quote Machine project ?
the son of god
@the-god-of-son
Nov 08 2016 09:02
@Blauelf I want to get a correct prime array, and then proceed to the next step
eusid
@eusid
Nov 08 2016 09:03
well i figured this out but the wikipedia api documentation is awfully cryptic to me. maybe im just incompetent who knows
the son of god
@the-god-of-son
Nov 08 2016 09:08
@Blauelf thanks
CamperBot
@camperbot
Nov 08 2016 09:08
the-god-of-son sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star2: 2820 | @blauelf |http://www.freecodecamp.com/blauelf
Abhisek Pattnaik
@abhisekp
Nov 08 2016 09:10
lazycat
@lazycat92
Nov 08 2016 09:10
it does't work
Abhisek Pattnaik
@abhisekp
Nov 08 2016 09:15
@eusid the wiki api doc is cryptic.
about @lazycat92
CamperBot
@camperbot
Nov 08 2016 09:16
:warning: no user found for lazycat92
lazycat
@lazycat92
Nov 08 2016 09:16
@_@
Abhisek Pattnaik
@abhisekp
Nov 08 2016 09:16
about @lazycat92
CamperBot
@camperbot
Nov 08 2016 09:18
:cookie: 1 | @lazycat92 |http://www.freecodecamp.com/lazycat92
Abhisek Pattnaik
@abhisekp
Nov 08 2016 09:18
:+1:
lazycat
@lazycat92
Nov 08 2016 09:20
@_@
Emmanuel
@chriemma
Nov 08 2016 09:23
This my code is not working what is wrong somebody help var myName="Emmanuel";
Ghulam Shabir
@ghulamshabir
Nov 08 2016 09:25
@chriemma post full code
the son of god
@the-god-of-son
Nov 08 2016 09:27
@ghulamshabir hello
function sumPrimes(num){
    var newArr=[];
    for(var i=num;i>=2;i--){
        var total=0;
        for(var j=2;j<=Math.sqrt(i);j++){

            if((i%j)==0){
                total++;
            }

        } 
        if(total==0){
                newArr.push(i);
            }
    }
   var suma = arr.reduce(function(a, b) {
    return a+b;
  });
    return suma;
}
Abhisek Pattnaik
@abhisekp
Nov 08 2016 09:28

@Blauelf thank you for suggestion. Will add that.

It takes a lot of time to explain though. :pensive:

CamperBot
@camperbot
Nov 08 2016 09:28
abhisekp sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star2: 2821 | @blauelf |http://www.freecodecamp.com/blauelf
the son of god
@the-god-of-son
Nov 08 2016 09:28
i want konw why must use Math.sqrt(i),use i is wrong
Abhisek Pattnaik
@abhisekp
Nov 08 2016 09:39
@lazycat92 :sleepy: :cat2:
Nikhil Singh
@nikhilmufc7
Nov 08 2016 09:41
can someone help me with Convert Celsius to Fahrenheit
Ilian Iliev
@zaken
Nov 08 2016 09:42

Hello, my code is correct, yet it doesn't pass, is it a bug?

var newArr = [];

function bouncer(arr) {
  for (i=0; i<arr.length; i++) {
    if (arr[i]) {
      newArr.push(arr[i]);
    }
  }
  return newArr;
}

Here is the link to the challenge: https://www.freecodecamp.com/challenges/falsy-bouncer

the son of god
@the-god-of-son
Nov 08 2016 09:43
@nikhilmufc7 post your code
Anymore
@ICFly
Nov 08 2016 09:43
hello
任务
按照下面的顺序,并且用空格来分割:
反斜杠 制表符 退格符 回车符 换行符并把它赋值给变量myStr
这题要怎么写啊,卡好久了
the son of god
@the-god-of-son
Nov 08 2016 09:44
say english
Ilian Iliev
@zaken
Nov 08 2016 09:44
@nikhilmufc7 what is the problem?
Abhisek Pattnaik
@abhisekp
Nov 08 2016 09:44
@ICFly only English
Ghulam Shabir
@ghulamshabir
Nov 08 2016 09:44
@dzift FCC does not like global variables, move down newArr inside the function
Anymore
@ICFly
Nov 08 2016 09:44
i can't speak english
Abhisek Pattnaik
@abhisekp
Nov 08 2016 09:44
only English please
Ilian Iliev
@zaken
Nov 08 2016 09:44
thanks @ghulamshabir
CamperBot
@camperbot
Nov 08 2016 09:44
dzift sends brownie points to @ghulamshabir :sparkles: :thumbsup: :sparkles:
:cookie: 904 | @ghulamshabir |http://www.freecodecamp.com/ghulamshabir
Abhisek Pattnaik
@abhisekp
Nov 08 2016 09:44
Anymore
@ICFly
Nov 08 2016 09:44
oh no
Ghulam Shabir
@ghulamshabir
Nov 08 2016 09:44
@dzift :+1:
Anymore
@ICFly
Nov 08 2016 09:45
thank you @abhisekp
CamperBot
@camperbot
Nov 08 2016 09:45
icfly sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star2: 3147 | @abhisekp |http://www.freecodecamp.com/abhisekp
Nikhil Singh
@nikhilmufc7
Nov 08 2016 09:46
@dzift Convert Celsius to fahrenheit
Ghulam Shabir
@ghulamshabir
Nov 08 2016 09:46
@dzift use js at the end of top three backticks to make the code clear
Nikhil Singh
@nikhilmufc7
Nov 08 2016 09:46

```function convertToF(celsius) {
var fahrenheit;
// Only change code below this line
celsius= 9/5 + 32

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

// Change the inputs below to test your code
convertToF(-30); ```

Ghulam Shabir
@ghulamshabir
Nov 08 2016 09:47
@nikhilmufc7 what are you applying the formula with ? you have celsiusto use in the formula
Nikhil Singh
@nikhilmufc7
Nov 08 2016 09:50
@ghulamshabir how should i use the algorithm 9/5+32 ?
Jeff Shapiro
@Jeff-Shapiro
Nov 08 2016 09:51
@nikhilmufc7 (9/5) + 32
Ghulam Shabir
@ghulamshabir
Nov 08 2016 09:51
@nikhilmufc7 you are supposed to apply that formula to a celsius value
24HourDeveloper
@24HourDeveloper
Nov 08 2016 09:51
has anyone did lesson 152
?
Ghulam Shabir
@ghulamshabir
Nov 08 2016 09:52
@nikhilmufc7 t(f) = c * 9/5 +32
@nikhilmufc7 here c is for celsius value, you have celsius parameter, use that for c
Nikhil Singh
@nikhilmufc7
Nov 08 2016 09:53
okay thanks guys @ghulamshabir @Jeff-Shapiro
CamperBot
@camperbot
Nov 08 2016 09:53
nikhilmufc7 sends brownie points to @ghulamshabir and @jeff-shapiro :sparkles: :thumbsup: :sparkles:
:cookie: 905 | @ghulamshabir |http://www.freecodecamp.com/ghulamshabir
:cookie: 317 | @jeff-shapiro |http://www.freecodecamp.com/jeff-shapiro
Jeff Shapiro
@Jeff-Shapiro
Nov 08 2016 09:54
@24HourDeveloper nah you're the first to ever get that far
Nikhil Singh
@nikhilmufc7
Nov 08 2016 09:54
lol
Ilian Iliev
@zaken
Nov 08 2016 09:54
@ghulamshabir you mean like this ```js
?
Ghulam Shabir
@ghulamshabir
Nov 08 2016 09:54
@dzift yes
24HourDeveloper
@24HourDeveloper
Nov 08 2016 09:55
its the word blanks game
Ilian Iliev
@zaken
Nov 08 2016 09:55
@Jeff-Shapiro you're
Emmanuel
@chriemma
Nov 08 2016 09:55
Jeff Shapiro
@Jeff-Shapiro
Nov 08 2016 09:55
@dzift thats what I said
Abhisek Pattnaik
@abhisekp
Nov 08 2016 09:56
how many hours do you spend in development @24HourDeveloper ? :D
24HourDeveloper
@24HourDeveloper
Nov 08 2016 09:57
24 hours lol
but really as much as i can
with school work and family
Ilian Iliev
@zaken
Nov 08 2016 09:57
@24HourDeveloper no need for creativity
concat empty spaces only
Abhisek Pattnaik
@abhisekp
Nov 08 2016 09:58
Creativity is life @dzift
Ilian Iliev
@zaken
Nov 08 2016 09:58
not in this case :)
24HourDeveloper
@24HourDeveloper
Nov 08 2016 09:58
ok thanks ill try it now
wow thanks I was just busting my brain on that simple level
Ilian Iliev
@zaken
Nov 08 2016 10:00
btw next time crop the link please
24HourDeveloper
@24HourDeveloper
Nov 08 2016 10:00
Thanks @dzift
CamperBot
@camperbot
Nov 08 2016 10:00
24hourdeveloper sends brownie points to @dzift :sparkles: :thumbsup: :sparkles:
:cookie: 257 | @dzift |http://www.freecodecamp.com/dzift
24HourDeveloper
@24HourDeveloper
Nov 08 2016 10:00
ok cool
must have come from my attempts at solving it
Ilian Iliev
@zaken
Nov 08 2016 10:01
@24HourDeveloper :thumbsup:
Abhisek Pattnaik
@abhisekp
Nov 08 2016 10:01
don't truncate the link otherwise your solution is gone from our viewpoint
Ilian Iliev
@zaken
Nov 08 2016 10:02
yes but so is ours
Abhisek Pattnaik
@abhisekp
Nov 08 2016 10:02
better to use markdown link style
but it doesn't always work
Ilian Iliev
@zaken
Nov 08 2016 10:03
linking like that changes your own solution
Abhisek Pattnaik
@abhisekp
Nov 08 2016 10:03
naw... our solution is safe in our profile
we can load it anytime anywhere
Emmanuel
@chriemma
Nov 08 2016 10:05
www.freecodecamp.com/challenges/declare-javascript-variables can somebody help me with this challenge
Jeff Shapiro
@Jeff-Shapiro
Nov 08 2016 10:06
@chriemma whats up?
Abhisek Pattnaik
@abhisekp
Nov 08 2016 10:08
@chriemma Q: what is a variable?
Emmanuel
@chriemma
Nov 08 2016 10:08
@Jeff-Shapiro i need help in this var myName="Emmanuel" what is wrong here
24HourDeveloper
@24HourDeveloper
Nov 08 2016 10:08
declare a variable @chriemma
Jeff Shapiro
@Jeff-Shapiro
Nov 08 2016 10:08
@chriemma declare it with no initalisation
24HourDeveloper
@24HourDeveloper
Nov 08 2016 10:08
i think they just wat you to say var myName;
Vijayanandkrishnan
@Vijayanandkrishnan
Nov 08 2016 10:09
@chriemma assign a keyword by putting it before var
24HourDeveloper
@24HourDeveloper
Nov 08 2016 10:09
what @Jeff-Shapiro said
Vijayanandkrishnan
@Vijayanandkrishnan
Nov 08 2016 10:10
@chriemma for ex : var name;
@chriemma then it becomes the variable
D O R C ¥
@Dorcy-ndg3
Nov 08 2016 10:10
after reading the instructions of this Caesars Cipher challenge , am now playing subway surfers.... no idea of where to start from at all
Jeff Shapiro
@Jeff-Shapiro
Nov 08 2016 10:10
@Vijayanandkrishnan providing solutions is destructive and usless. The name of the room is Help not Solve
Vijayanandkrishnan
@Vijayanandkrishnan
Nov 08 2016 10:10
@Jeff-Shapiro i just gave an example
@Jeff-Shapiro it is not the answer
Stephen James
@sjames1958gm
Nov 08 2016 10:11
@Dorcy-ndg3 Since you need to process each character, perhaps a loop over the characters?
24HourDeveloper
@24HourDeveloper
Nov 08 2016 10:11
actually I gave the answer
Emmanuel
@chriemma
Nov 08 2016 10:11
@Vijayanandkrishnan like this var name="Emmanuel";
Abhisek Pattnaik
@abhisekp
Nov 08 2016 10:12
@Dorcy-ndg3 Subway surfer is difficult for me though :pensive:
24HourDeveloper
@24HourDeveloper
Nov 08 2016 10:12
no you don't have to initialize
D O R C ¥
@Dorcy-ndg3
Nov 08 2016 10:12
@sjames1958gm ok ive now paused the game :smile: i think am starting to have clues
Vijayanandkrishnan
@Vijayanandkrishnan
Nov 08 2016 10:12
@chriemma exactly, except the ""
Stephen James
@sjames1958gm
Nov 08 2016 10:13
@chriemma The challenge is not expecting you to assign a value to the variable.
D O R C ¥
@Dorcy-ndg3
Nov 08 2016 10:13
@abhisekp nohhhhh it aint hard at all
Abhisek Pattnaik
@abhisekp
Nov 08 2016 10:13
@Dorcy-ndg3 I've not scored much
i always hit the train
D O R C ¥
@Dorcy-ndg3
Nov 08 2016 10:13
me neither
but i keep trying
24HourDeveloper
@24HourDeveloper
Nov 08 2016 10:13
just declare a variable without initialization
D O R C ¥
@Dorcy-ndg3
Nov 08 2016 10:13
i think my high score is like 600k
Abhisek Pattnaik
@abhisekp
Nov 08 2016 10:14
I had no idea how to start it either...
I touched and dragged up and down and it worked
Vijayanandkrishnan
@Vijayanandkrishnan
Nov 08 2016 10:15
@chriemma if you put with "" then it becomes string
Emmanuel
@chriemma
Nov 08 2016 10:15
I did it like this var name=Emmanuel; it says that Emmanuel is not define
Tsulatsi Tamim
@tsulatsitamim
Nov 08 2016 10:15

function rot13(str) { // LBH QVQ VG!
  var arr = [];
  var newArr = [];

  for( var i = 0; i < str.length; i++){
    if( str[i].match(/[A-Z]/) ){
      arr[i] = String.fromCharCode(str.charCodeAt(i) - 13);
      if(str.charCodeAt(i) < 78){
        arr[i] = String.fromCharCode(str.charCodeAt(i) + 13);
      } 
    } else {
      arr[i] = str[i];
    } 
  }

  return arr.join('');

}

// Change the inputs below to test
rot13("SERR PBQR PNZC");
currently i'm working on Caesar Cipher challenge, my code works, is there any simple approach to solve the challenge?
Vijayanandkrishnan
@Vijayanandkrishnan
Nov 08 2016 10:15
@chriemma they have asked for a variable called myName.
Stephen James
@sjames1958gm
Nov 08 2016 10:15
@chriemma Look at the ourName example if you get stuck.
Vijayanandkrishnan
@Vijayanandkrishnan
Nov 08 2016 10:16
@chriemma instead of Emmanuel use myName
SlimxaQ
@SlimxaQ
Nov 08 2016 10:16

How can I add div over another div?

Because when I have this:

document.getElementById('game').innerHTML += '<tr><td><i class="heart icon"</i></td><td>'+username+'</td><td>'+deposited_value+' PKT</td><td><button class="ui big primaryyy button">Dołącz</button></td></tr>';

The DIV is adding under another DIV etc.

24HourDeveloper
@24HourDeveloper
Nov 08 2016 10:16
basically just do it the same way as ourName
Vijayanandkrishnan
@Vijayanandkrishnan
Nov 08 2016 10:17
@24HourDeveloper yep
@chriemma copy the code from above - change our to my - this is all they are asking for.
Tsulatsi Tamim
@tsulatsitamim
Nov 08 2016 10:18
@sjames1958gm thank you
CamperBot
@camperbot
Nov 08 2016 10:18
tsulatsitamim sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 4238 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Emmanuel
@chriemma
Nov 08 2016 10:19
Did not work haba var name=myName;
24HourDeveloper
@24HourDeveloper
Nov 08 2016 10:20
heres the answer @chriemma var myName;
Emmanuel
@chriemma
Nov 08 2016 10:21
@tsulatsitamim @24HourDeveloper thanks
CamperBot
@camperbot
Nov 08 2016 10:21
:cookie: 157 | @24hourdeveloper |http://www.freecodecamp.com/24hourdeveloper
:cookie: 256 | @tsulatsitamim |http://www.freecodecamp.com/tsulatsitamim
chriemma sends brownie points to @tsulatsitamim and @24hourdeveloper :sparkles: :thumbsup: :sparkles:
24HourDeveloper
@24HourDeveloper
Nov 08 2016 10:22
welcome @chriemma
Conor Murphy
@cmurphy580
Nov 08 2016 10:23
@JohnnyBizzel Yeah. Sorry about that had to go to work. Here you go: https://codepen.io/cmurphy580/pen/rWBJEr?editors=0011
anyone know how two different data items from an api and assign the to icon
Vijayanandkrishnan
@Vijayanandkrishnan
Nov 08 2016 10:27
@chriemma sorrry i didnt notice the = sign, you needed to remove that too.
shadyonline
@shadyonline
Nov 08 2016 10:29
Is there any library to format Date object (Javascript) parsed from input type=datetime-local into mssql format for parameter (requests are frequently sending via ajax)?
Ziazan
@Ziazan
Nov 08 2016 10:31
how to use array.reduce() in function which arguments is [1,4] and what i want result is 10(add from 1 to 4)
nickbagnall
@nickbagnall
Nov 08 2016 10:32
JavaScript - FalsyBouncer, anybody tell me why the following does not remove the nulls from my array ?
arr = arr.filter( function(val) { return val !== null; } );
Conor Murphy
@cmurphy580
Nov 08 2016 10:34
get rid of everything except the arr.filter and the return
Johnny
@JohnnyBizzel
Nov 08 2016 10:37
@cmurphy580 The best way to do this is to use an IP address lookup for location as you can't guarantee the user shares their location. I know this is not the question you were asking.
nickbagnall
@nickbagnall
Nov 08 2016 10:37
@cmurphy580 could you be more verbose please
Emmanuel
@chriemma
Nov 08 2016 10:38
Any wrong code here var a=7;
var b=7;
var a=b;
Stephen James
@sjames1958gm
Nov 08 2016 10:39
@chriemma don't repeat var it is already done for you above, don't assign 7 to b, rather assign a to b (your last line is assigning b to a
@Ziazan What have you tried?
Nikhil Singh
@nikhilmufc7
Nov 08 2016 10:43
whats wrong with this code in the challenge Escape sequences in Strings
var myStr= "FirstLine\n \\SecondLine\\ \rThirdLine"
Stephen James
@sjames1958gm
Nov 08 2016 10:44
@nikhilmufc7 Per the instructions with no spaces between escape sequences or words.
Emmanuel
@chriemma
Nov 08 2016 10:45
@sjames1958gm like this ;
Nikhil Singh
@nikhilmufc7
Nov 08 2016 10:45
@sjames1958gm I tried without space too but no progress
Johnny
@JohnnyBizzel
Nov 08 2016 10:46
@nikhilmufc7 Reading instructions is an important skill of a developer. Most errors in computing are human made.
Nikhil Singh
@nikhilmufc7
Nov 08 2016 10:46
is this what you meant @sjames1958gm js var myStr= "FirstLine\n\\SecondLine\\\rThirdLine"
Phillip Kelley-Dotson
@pkdotson
Nov 08 2016 10:46
@Masd925 what did you mean loop over the arr indices with i = i + size? i'm confused how that works?
Emmanuel
@chriemma
Nov 08 2016 10:47
@sjames1958gm like this a=7;
b=7;
a=b;
Nikhil Singh
@nikhilmufc7
Nov 08 2016 10:47
@JohnnyBizzel yeah right
Stephen James
@sjames1958gm
Nov 08 2016 10:48
@chriemma Without the b=7 (b gets the value from a)
Johnny
@JohnnyBizzel
Nov 08 2016 10:48
@nikhilmufc7 var str= "FirstLine\n\\SecondLine\\\rThirdLine"; should work
Stephen James
@sjames1958gm
Nov 08 2016 10:49
@nikhilmufc7 Try refresh the page, but that looks correct
Nikhil Singh
@nikhilmufc7
Nov 08 2016 10:49
yeah worked now thanks lads @JohnnyBizzel @sjames1958gm
CamperBot
@camperbot
Nov 08 2016 10:49
nikhilmufc7 sends brownie points to @johnnybizzel and @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 4239 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
:cookie: 772 | @johnnybizzel |http://www.freecodecamp.com/johnnybizzel
Stephen James
@sjames1958gm
Nov 08 2016 10:50
@nikhilmufc7 :+1:
Emmanuel
@chriemma
Nov 08 2016 10:50
Still not working