These are chat archives for FreeCodeCamp/HelpJavaScript

30th
May 2016
Adrian Kopytko
@adriankopytko
May 30 2016 00:00
Hello guys, I have problem with Seek and Destroy challenge. Can you give me some advice? I have no idea how should I do it, I made a couple of codes, nothing works. :(
Damon Redding
@DamonRedding
May 30 2016 00:00
Screen Shot 2016-05-29 at 7.57.27 PM.png
Stephen James
@sjames1958gm
May 30 2016 00:00
@DamonRedding If you check \W does not eliminate _
DJ
@qualitymanifest
May 30 2016 00:00
@DamonRedding underscores are considered a word character, so replacing \W doesn't get rid of underscores
Stephen James
@sjames1958gm
May 30 2016 00:01
@Shimizo What do you have so far
Ken Haduch
@khaduch
May 30 2016 00:01
@subhsamal - Hello there. You should not have to do that replace two times, if you're looking for improvements. And your regexp could be a little simpler - you do not need the spaces in there. But it was pretty good, overall.
Damon Redding
@DamonRedding
May 30 2016 00:01
@qualitymanifest @sjames1958gm gotcha, thanks you guys
CamperBot
@camperbot
May 30 2016 00:01
damonredding sends brownie points to @qualitymanifest and @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 1362 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
:star2: 1179 | @qualitymanifest |http://www.freecodecamp.com/qualitymanifest
Ken Haduch
@khaduch
May 30 2016 00:02
@DamonRedding - hello. In regexp \W is all non-word characters, and word characters include the underscore, so you have to add that to your expression.
Adrian Kopytko
@adriankopytko
May 30 2016 00:02
@sjames1958gm Now I haven't any code. I don't know how to use .filter() in this task and I think it will solve my problems.
Stephen James
@sjames1958gm
May 30 2016 00:02
@Shimizo Filter is a good choice for this.
@Shimizo When you call filter on an array - you will give it a function to call. It will call the function for each element in the array. Return true from this function and the element will be in the resulting array, false and it will not.
Damon Redding
@DamonRedding
May 30 2016 00:04
@khaduch Will do! thanks!
CamperBot
@camperbot
May 30 2016 00:04
damonredding sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1223 | @khaduch |http://www.freecodecamp.com/khaduch
Hanifah Walidah
@hackyourcraft
May 30 2016 00:06
Jesus H Christopher!!! (no offense to anyone) Finally got Record Collection [231]. It was such a simple oversight. But the kind that happens when you don't have syntax down. Thank you! @sjames1958gm @llamatarianism Also bigups to the patience of a fellow Camper and friend @NataliePatriceTucker who got me through without giving me the answer.
CamperBot
@camperbot
May 30 2016 00:06
souloperator sends brownie points to @sjames1958gm and @llamatarianism and @nataliepatricetucker :sparkles: :thumbsup: :sparkles:
:star2: 1363 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
:cookie: 671 | @llamatarianism |http://www.freecodecamp.com/llamatarianism
:cookie: 286 | @nataliepatricetucker |http://www.freecodecamp.com/nataliepatricetucker
Adrian Kopytko
@adriankopytko
May 30 2016 00:06
@sjames1958gm Should I make a loop to filter every thing that I put into 'arrWithArgs', which contains all args to delete from my array?
Stephen James
@sjames1958gm
May 30 2016 00:06
@Shimizo Filter is a loop
@Shimizo creating an array of the remaining args is a good idea
Adrian Kopytko
@adriankopytko
May 30 2016 00:08
@sjames1958gm or maybe can I put an array with args in filter, to filter them all?
Subh Samal
@subhsamal
May 30 2016 00:09
Someone review my code. Have I done any stupid mistakes ?
function findLongestWord(str) {
var myArray = [];
myArray =  str.split(" ");
  var longest = 0;
  var lengthOfArray;
  for (i= 0; i < myArray.length; i++)
    {
      lengthOfArray = myArray[i].length;
      if(lengthOfArray > longest)
        {
          longest = lengthOfArray;
        }

    }
  return longest;
}

findLongestWord("The quick brown fox jumped over the lazy dog");
Adrian Kopytko
@adriankopytko
May 30 2016 00:09
@sjames1958gm I'm a bit confused, because in JS you can put arrays in many ways, where in for example C++ you cant
Subh Samal
@subhsamal
May 30 2016 00:09
topic : Find the Longest Word in a String
Erik Moura
@erikian
May 30 2016 00:10
@subhsamal lengthOfArray will always be greater than longest since you set longest to 0
Subh Samal
@subhsamal
May 30 2016 00:11
no , it is only initialized. I wanted to put value of array length into it.
and the code gives correct output
Erik Moura
@erikian
May 30 2016 00:12
@subhsamal does it work for all cases?
Subh Samal
@subhsamal
May 30 2016 00:13
yes , I cleared the challenge. checked with empty string . @erikian
Xavier Velez
@JonSnow08
May 30 2016 00:14
yeah I still got nothing
Simon Cordova
@gbsimon87
May 30 2016 00:14
Can you explain what it is that you mean by 'checked with empty string'?
Subh Samal
@subhsamal
May 30 2016 00:15
How would you have done it ? @erikian
Xavier Velez
@JonSnow08
May 30 2016 00:15
function factorialize(num) {
  var number = num;
  var factorArray = [];
  for (i=num; i === 0 ; i--){
    factorArray.push(number-i); 
  }



}

factorialize(5);
i feel like i'm going in the wrong direction tbh...
Kyle W Pilkinton
@tadake
May 30 2016 00:15
hey guys can anyone tell me why my function start isn't working ???? http://codepen.io/tadake/pen/VjZNON
Subh Samal
@subhsamal
May 30 2016 00:16
in that case my if condition fails. @gbsimon87
Simon Cordova
@gbsimon87
May 30 2016 00:17
True, thank you.
buiphuking
@buiphuking
May 30 2016 00:17
hi guys, someone has a tool to covert javascript to babel , plz share with me,
Erik Moura
@erikian
May 30 2016 00:17
@JonSnow08 try to fix the conditions for your loop
Subh Samal
@subhsamal
May 30 2016 00:17
@gbsimon87 :blush:
Erik Moura
@erikian
May 30 2016 00:18
@subhsamal i've converted the string to an array
Subh Samal
@subhsamal
May 30 2016 00:18
@JonSnow08 I am not sure about your approach , but I can give you hint if u want!
@erikian I did too. Split() does that :blush:
Erik Moura
@erikian
May 30 2016 00:20
@subhsamal you're right. so, i've sorted the array elements from longest to shortest
Subh Samal
@subhsamal
May 30 2016 00:21
oh..that seems like good idea :clap: @erikian
Norvin Burrus
@ndburrus
May 30 2016 00:23
@buiphuking are you going from ES6 to ES5?
Simon Cordova
@gbsimon87
May 30 2016 00:24
What purpose do you guys have for writing code?
Simply hobbies or any specific goals in mind?
Subh Samal
@subhsamal
May 30 2016 00:25
@JonSnow08 in factorialize () you have to multiply a number recursively until it becomes 0.
@gbsimon87 to make things happen at your finger tips :smile:
Adrian Kopytko
@adriankopytko
May 30 2016 00:25
function destroyer(arr) {

  var arrToFilter = [];

  var arrWithArgs = [];
  var arrFiltered;

  for(var i = 0; i < arr[0].length; i++) {
    arrToFilter.push(arr[0][i]);
  }

  for(var i = 1; i < arr.length; i++) {
    arrWithArgs.push(arr[i]);
  }


  arrfiltered = arrToFilter.filter(function(value) {
    if() {
      return false;
    }
    return true;
  });



  return arr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Simon Cordova
@gbsimon87
May 30 2016 00:26
Fair enough...
How do I input code into the chat window?
Subh Samal
@subhsamal
May 30 2016 00:26
formatting ?
Moisés Man
@moigithub
May 30 2016 00:27
explain format
CamperBot
@camperbot
May 30 2016 00:27

:point_right: code formatting [wiki]

Multi line Code

```js ⇦ Type 3 backticks and then press [shift + enter ⏎] (type js or html or css)

<paste your code here>,
then press [shift + enter ⏎]

``` ⇦ Type 3 backticks, then press [enter ⏎]

Single line Code

This an inline `<paste code here>` code formatting with a single backtick() at _start_ and _end_ around thecode`.

See also: ☛ How to type Backticks | ☯ Compose Mode | ❄ Gitter Formatting Basics

:pencil: read more about code formatting on the FCC Wiki

Adrian Kopytko
@adriankopytko
May 30 2016 00:27
What should i put info if in function in filter? I have no idea.
Any advice?
Moisés Man
@moigithub
May 30 2016 00:27
read the documentation :) @Shimizo
Stephen James
@sjames1958gm
May 30 2016 00:27
@Shimizo I am not sure you are understanding the challenge - you need to research the arguments object. arr[0] is a number not an array
Subh Samal
@subhsamal
May 30 2016 00:28
type
js , then shift+enter, paste your code, come to bottom then ctrl+enter @gbsimon87
buiphuking
@buiphuking
May 30 2016 00:28
@ndburrus
html i use jade
css i use sass
so javascript i want to use something, first i try livescript, but when i covert my js pomodoro clock to livescript , there are some bug , so i want to try babel, do you have experience with babel ?
Xavier Velez
@JonSnow08
May 30 2016 00:29
@ndburrus any chance you're around man?
Erik Moura
@erikian
May 30 2016 00:29
@subhsamal @JonSnow08 actually you have to multiply all integers between 1 and the number
Simon Cordova
@gbsimon87
May 30 2016 00:30
thanks @subhsamal
CamperBot
@camperbot
May 30 2016 00:30
gbsimon87 sends brownie points to @subhsamal :sparkles: :thumbsup: :sparkles:
:cookie: 256 | @subhsamal |http://www.freecodecamp.com/subhsamal
Adrian Kopytko
@adriankopytko
May 30 2016 00:30
@sjames1958gm Maybe it's why I have no idea - but how should I storage these values? I really have no idea how can i do this task
Xavier Velez
@JonSnow08
May 30 2016 00:30
yeah @erikian I got that, i'm just trying to figure out how to build an array that has all those numbers
Subh Samal
@subhsamal
May 30 2016 00:30
able to do it ? @gbsimon87
Simon Cordova
@gbsimon87
May 30 2016 00:30

js
/
Write a switch statement which tests val
and sets answer for the following conditions:
1 - "alpha"
2 - "beta"
3 - "gamma"
4 - "delta"
/

function caseInSwitch(val) {
var answer = "";
// Only change code below this line

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

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

Xavier Velez
@JonSnow08
May 30 2016 00:30
I'm pretty confident of what to code once I have the array but I have to get to that first
Moisés Man
@moigithub
May 30 2016 00:30
@erikian @subhsamal @JonSnow08 the order of the operands does not change the result
https://en.wikipedia.org/wiki/Commutative_property
goin 1 to num OR
num to 1 doesnt matter
Simon Cordova
@gbsimon87
May 30 2016 00:31
@subhsamal doesn't seem like it lol
Xavier Velez
@JonSnow08
May 30 2016 00:31
@moigithub yup that I know as well, I won't have to reverse the array or anything
Simon Cordova
@gbsimon87
May 30 2016 00:31
Either way, any help with that switch statement problem would be amazing
Erik Moura
@erikian
May 30 2016 00:32
@JonSnow08 okay, you should start your counter at 1, push numbers in the array while your counter is less than or equal to your number
Subh Samal
@subhsamal
May 30 2016 00:32
put ''' before js @gbsimon87
CamperBot
@camperbot
May 30 2016 00:32
:bulb: to format code use backticks! ``` more info
Xavier Velez
@JonSnow08
May 30 2016 00:33
@erikian okay thanks I'll give that a try
CamperBot
@camperbot
May 30 2016 00:33
jonsnow08 sends brownie points to @erikian :sparkles: :thumbsup: :sparkles:
:warning: jonsnow08 already gave erikian points
Simon Cordova
@gbsimon87
May 30 2016 00:33

'''js
/
Write a switch statement which tests val
and sets answer for the following conditions:
1 - "alpha"
2 - "beta"
3 - "gamma"
4 - "delta"
/

function caseInSwitch(val) {
var answer = "";
// Only change code below this line

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

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

CamperBot
@camperbot
May 30 2016 00:33
:bulb: to format code use backticks! ``` more info
Simon Cordova
@gbsimon87
May 30 2016 00:33
```js
Subh Samal
@subhsamal
May 30 2016 00:33
then shift + enter
Simon Cordova
@gbsimon87
May 30 2016 00:34
/*
Write a switch statement which tests val 
and sets answer for the following conditions:
1 - "alpha"
2 - "beta"
3 - "gamma"
4 - "delta" */

function caseInSwitch(val) {
  var answer = "";
  // Only change code below this line



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

// Change this value to test
caseInSwitch(1);
Perfect, thank you once again! :)
Subh Samal
@subhsamal
May 30 2016 00:34
woha..u did it.
Simon Cordova
@gbsimon87
May 30 2016 00:34
Any word on this problem I've been stuck on it for some time now....
I'll show what I've got so far...
Subh Samal
@subhsamal
May 30 2016 00:35
try hard bit more with your code, you will be able to solve it. @gbsimon87
Moisés Man
@moigithub
May 30 2016 00:35
@JonSnow08 u dont really need an array... just a variable to hold the total of the multiplication,, and on each iteration multiply the result with the new num
so first iteration u get
result = result * 1 <-- probably this no need
( next iteration )
result = result * 2
result = result * 3
etc
Xavier Velez
@JonSnow08
May 30 2016 00:35
function factorialize(num) {
  var number = num;
  var factorArray = [];
  for (i=1; i <= num ; i--){
    factorArray.push(number-i); 
  }

  }
Subh Samal
@subhsamal
May 30 2016 00:36
@JonSnow08 yeah..he is correct @moigithub you need to multiply inside for loop, i:e recursively.
Simon Cordova
@gbsimon87
May 30 2016 00:36
Bam! Got it! :)
Subh Samal
@subhsamal
May 30 2016 00:36
:+1:
Xavier Velez
@JonSnow08
May 30 2016 00:37
gotcha let me see if I can figure that out
Subh Samal
@subhsamal
May 30 2016 00:37
It can be easier than what you have thought. @JonSnow08
Xavier Velez
@JonSnow08
May 30 2016 00:37
okay
O'ange
@oange
May 30 2016 00:39
aren't you suppose to use a switch statement?
Subh Samal
@subhsamal
May 30 2016 00:39
instead of array, take factorial to store multiplications, consider it as a big hint @JonSnow08 I don't want to stop you from thinking.
Xavier Velez
@JonSnow08
May 30 2016 00:40
yeah I want to figure it out the idea of this is to help me problem solve
Daniel Godigna
@DGAcode
May 30 2016 00:40
hello again, having some problems here " Make Unique Objects by Passing Parameters to our Constructor "

var Car = function() {
  //Change this constructor
  this.wheels = 4;
  this.seats = 1;
  this.engines = 1;
};

//Try it out here
var myCar = function(wheels, seats, engines) {
  this.wheels = wheels;
  this.seats = seats;
  this.engines = engines;
};
myCar = new Car(4,4,2);
Norvin Burrus
@ndburrus
May 30 2016 00:40
@JonSnow08 hey, how are you.. i'm here... @buiphuking ...no experience with babel. i think i was checking the functionality to see if it was what you were looking for...
Simon Cordova
@gbsimon87
May 30 2016 00:42
If there is more than 1 case match in a switch statement, will they both be executed?
Xavier Velez
@JonSnow08
May 30 2016 00:42
@ndburrus awesome haha I may be able to get it now, but if not and you don't mind would you help me walk through the logic?
Norvin Burrus
@ndburrus
May 30 2016 00:42
@JonSnow08 ..sure
Xavier Velez
@JonSnow08
May 30 2016 00:43
@33hawk let me look at that challenge and maybe I can help you out real quick
i wanna pay forward the help im getting
Norvin Burrus
@ndburrus
May 30 2016 00:43
@33hawk you're simply passing parameters to a new constructor... :) hint: emphasis on New.... (ie make a new one - a new what?)
Luke
@lukenetti3
May 30 2016 00:44
Hi guys, I am working on the Make Object Properties Private challenge and am having some trouble. I don't quite understand how I call the properties. The instructions say myBike.getGear() should return 3 after calling myBike.setGear(3).
Diego Mayer
@Chrono79
May 30 2016 00:45
@33hawk you're overwriting the constructor
Simon Cordova
@gbsimon87
May 30 2016 00:45
Man you are all so far ahead of me lol.
Moisés Man
@moigithub
May 30 2016 00:45
@33hawk above comment says //Change this constructor
Simon Cordova
@gbsimon87
May 30 2016 00:45
Only means I gots to keep at it!
Xavier Velez
@JonSnow08
May 30 2016 00:46
@33hawk yeah you went to far with it. Just reset the code and think simpler
Diego Mayer
@Chrono79
May 30 2016 00:46
@moigithub comments are there just to be ignored it seems ;)
Erik Moura
@erikian
May 30 2016 00:46
@JonSnow08 your conditions would be right if you were starting your counter at i = num
Moisés Man
@moigithub
May 30 2016 00:46
@33hawk soo all the code below.. u should put above instead. do not create a new constructor/function
Daniel Godigna
@DGAcode
May 30 2016 00:47
@moigithub hahaha thanks now I see it I always have this type of errors at this time 2:47am
CamperBot
@camperbot
May 30 2016 00:47
33hawk sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star2: 1287 | @moigithub |http://www.freecodecamp.com/moigithub
Daniel Godigna
@DGAcode
May 30 2016 00:48
@ndburrus @Chrono79 thanks
CamperBot
@camperbot
May 30 2016 00:48
33hawk sends brownie points to @ndburrus and @chrono79 :sparkles: :thumbsup: :sparkles:
:cookie: 932 | @chrono79 |http://www.freecodecamp.com/chrono79
:cookie: 464 | @ndburrus |http://www.freecodecamp.com/ndburrus
Xavier Velez
@JonSnow08
May 30 2016 00:49
I'm so lost
Simon Cordova
@gbsimon87
May 30 2016 00:49
If there is more than 1 case match in a switch statement, will they both be executed?
more than 1 case match that strictly matches
llamatarianism
@llamatarianism
May 30 2016 00:51
@gbsimon87 it depends.
if you have a break statement after the case, only the first one is executed
otherwise, both are
Diego Mayer
@Chrono79
May 30 2016 00:51
@gbsimon87 depends on break statement https://repl.it/CThc/3
llamatarianism
@llamatarianism
May 30 2016 00:51
strictly speaking though
if there are multiple possible matches
you probably shouldn't be using switch/case
Simon Cordova
@gbsimon87
May 30 2016 00:52
Perfect, thank you both.
Your answers just made me understand the switch statement much clearer.
thanks @Chrono79 and thanks @llamatarianism
CamperBot
@camperbot
May 30 2016 00:52
gbsimon87 sends brownie points to @chrono79 and @llamatarianism :sparkles: :thumbsup: :sparkles:
:cookie: 672 | @llamatarianism |http://www.freecodecamp.com/llamatarianism
:cookie: 933 | @chrono79 |http://www.freecodecamp.com/chrono79
Xavier Velez
@JonSnow08
May 30 2016 00:53
@erikian i give up on the array
gave*
Kelvin
@loweehahn
May 30 2016 00:54
Why isn't my search function working? https://codepen.io/loweehahn/pen/LZYxwj
Erik Moura
@erikian
May 30 2016 00:54
@JonSnow08 don't give up, you're almost there
Daniel Godigna
@DGAcode
May 30 2016 00:55

@JonSnow08
Hint: 1

You need to take the number and multiply it for one less until you get to one.

Hint: 2

You can use a for loop and have a variable store the product of the current value and one less than it.

Hint: 3

Remember the control, the last number has to be 1 and the initial number should be minimum 2, if one then return it, otherwise handle the error.

@JonSnow08 just a copy paste hope it helps
Erik Moura
@erikian
May 30 2016 00:55
you just need to be congruente on your for statement: if you're starting at 1, you shouldd increment your counter rather than decrement it
Simon Cordova
@gbsimon87
May 30 2016 00:56
@loweehahn your input type needs just a tad more
Kelvin
@loweehahn
May 30 2016 00:56
@gbsimon87 What am I missing?
Simon Cordova
@gbsimon87
May 30 2016 00:59
We try to not give out answers here, but to help guide in the right direction...
Here's a hint. You've inputted type="search" - how does it know where to search from?
Kelvin
@loweehahn
May 30 2016 01:01
@gbsimon87 Thanks for the hint. I'll try to figure it out.
CamperBot
@camperbot
May 30 2016 01:01
loweehahn sends brownie points to @gbsimon87 :sparkles: :thumbsup: :sparkles:
:cookie: 197 | @gbsimon87 |http://www.freecodecamp.com/gbsimon87
Simon Cordova
@gbsimon87
May 30 2016 01:01
I'd also recommend W3 for input search, you may need some PHP depending upon what you're looking for....
Good luck! :)
Isaac Pak
@pak11273
May 30 2016 01:05
can someone help me extract the temp out of this json plz:
{"coord":{"lon":139,"lat":35},
"sys":{"country":"JP","sunrise":1369769524,"sunset":1369821049},
"weather":[{"id":804,"main":"clouds","description":"overcast clouds","icon":"04n"}],
"main":{"temp":289.5,"humidity":89,"pressure":1013,"temp_min":287.04,"temp_max":292.04},
"wind":{"speed":7.31,"deg":187.002},
"rain":{"3h":0},
"clouds":{"all":92},
"dt":1369824698,
"id":1851632,
"name":"Shuzenji",
"cod":200}
Diego Mayer
@Chrono79
May 30 2016 01:07
@pak11273 data.main.temp being data the name of the object (or whatever you called it)
how is it ?
Erik Moura
@erikian
May 30 2016 01:08
any hint s about why my code issn't replacing uppercasa characters from the middle of the sentence?

function spinalCase(str) {
  // "It's such a fine line between stupid, and clever."
  // --David St. Hubbins

  var i = 0,
      l = str.length,
      st = "";

  var test = str.replace(str[4], "-" + str[4]);

   for (i; i <= l; i++) {
     if (str.charCodeAt(i) >= 65 && str.charCodeAt(i) <= 90) {
        var c = str.charCodeAt(i);
        var char = String.fromCharCode(c);
        var charToRegExp = new RegExp(char, "g");
        st = str.replace(charToRegExp, "-" + char);
    }

  }

  return st;
}

spinalCase("The_Andy_Griffith_Show");
buiphuking
@buiphuking
May 30 2016 01:08
@Chrono79
do you use flexbox in css, or livescript or babel js , plz help me out....
Diego Mayer
@Chrono79
May 30 2016 01:09
@buiphuking I can't say I do
llamatarianism
@llamatarianism
May 30 2016 01:10
@buiphuking I use flexbox and ES6 sometimes, so I might be able to
Simon Cordova
@gbsimon87
May 30 2016 01:11
@keshav929 Looking like some great work!
Isaac Pak
@pak11273
May 30 2016 01:11
@Chrono79 nice, that works thanks, i don't get the number though, it's neither F or C...
CamperBot
@camperbot
May 30 2016 01:11
pak11273 sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:cookie: 934 | @chrono79 |http://www.freecodecamp.com/chrono79
buiphuking
@buiphuking
May 30 2016 01:12
@llamatarianism
i try livecript to make my code shorter, so i convert my js on my pomodoro clock to livecript , but there are some bugs , so i try babel, but i dont' know where to start
Diego Mayer
@Chrono79
May 30 2016 01:12
@pak11273 you should add to your api request the unit system you want
KESHAV KUNDAL
@keshav929
May 30 2016 01:12
thanks @gbsimon87
CamperBot
@camperbot
May 30 2016 01:12
keshav929 sends brownie points to @gbsimon87 :sparkles: :thumbsup: :sparkles:
:cookie: 198 | @gbsimon87 |http://www.freecodecamp.com/gbsimon87
llamatarianism
@llamatarianism
May 30 2016 01:12
@buiphuking well, switching what preprocessor you use won't fix those bugs
there's nothing inherent to livescript that makes it buggy
but if you want to use babel instead
then here's a good reference about some es6 features you could use
Xavier Velez
@JonSnow08
May 30 2016 01:14
function factorialize(num) {
  var number = num;

  for (i=num; i > number  ; i--){
   var answer = number * i; 
    if (i > number){
      return answer;
    }
    }




}

factorialize(5);
am I getting closer?
buiphuking
@buiphuking
May 30 2016 01:15
@llamatarianism
check this link ,
could you help me this...
http://codepen.io/buiphuking/pen/beGMmN
Diego Mayer
@Chrono79
May 30 2016 01:15
@JonSnow08 if i is num, and you decrease it, the next time i won't be greater than number and it'll exit the loop I think
Xavier Velez
@JonSnow08
May 30 2016 01:16
@Chrono79 just caught and fixed that actually
llamatarianism
@llamatarianism
May 30 2016 01:16
@buiphuking it looks like you don't even have any JS
KESHAV KUNDAL
@keshav929
May 30 2016 01:16
if there is anyone who needs help , let me know , i'll try to help :)
Diego Mayer
@Chrono79
May 30 2016 01:17
@JonSnow08 you should use *= operator
Xavier Velez
@JonSnow08
May 30 2016 01:17
function factorialize(num) {
  var number = num;

  for (i=num; i === number + 1  ; i--){
   var answer = number * i; 
    if (i > number){
      return answer;
    }
    }




}
buiphuking
@buiphuking
May 30 2016 01:18
@llamatarianism
this is my tic tac toe,
i have my js in my pomodoro clock here,
http://codepen.io/buiphuking/pen/NrKypv
anyway what i need you is in tic tac toe
Xavier Velez
@JonSnow08
May 30 2016 01:18
wait idk why i put the +1 that doesnt help
llamatarianism
@llamatarianism
May 30 2016 01:18
@buiphuking so can you explain again
what do you need help with?
KESHAV KUNDAL
@keshav929
May 30 2016 01:18
@JonSnow08 may i help .?
Henry Nguyen
@airankles07
May 30 2016 01:18

// Setup
var myStorage = {
  "car": {
    "inside": {
      "glove box": "maps",
      "passenger seat": "crumbs"
     },
    "outside": {
      "trunk": "jack"
    }
  }
};

// Only change code below this line

var gloveBoxContents = myStorage.car.inside.glovebox;

// Change this line
llamatarianism
@llamatarianism
May 30 2016 01:19
I thought you'd written some code in livescript
Henry Nguyen
@airankles07
May 30 2016 01:19
what am i doing wrong here
llamatarianism
@llamatarianism
May 30 2016 01:19
and were trying to convert it to babel
Xavier Velez
@JonSnow08
May 30 2016 01:19
@keshav929 please lol
llamatarianism
@llamatarianism
May 30 2016 01:19
@airankles07 glove box has a space in it
you need to use bracket notation
Diego Mayer
@Chrono79
May 30 2016 01:19
@airankles07 glovebox isn't the same as glove box
Henry Nguyen
@airankles07
May 30 2016 01:19
when i spaced it, it gave me an error
KESHAV KUNDAL
@keshav929
May 30 2016 01:19
see let's see your code line by line
Adrian Kopytko
@adriankopytko
May 30 2016 01:19

function destroyer(arr) {

  var arrWithArgs = [];
  var arrFiltered;
  var arrTo = [];

  for(var i = 0; i < arr[0].length; i++) {
    arrTo.push(arr[0][i]);
  }

  for(var i = 1; i < arr.length; i++) {
    arrWithArgs.push(arr[i]);
  }

  function x(value) {
     return value !== arrWithArgs[0];
  }


  arrFiltered = arr.filter(x);



  arr = arrFiltered;

  return arr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Xavier Velez
@JonSnow08
May 30 2016 01:19
okay
llamatarianism
@llamatarianism
May 30 2016 01:19
@airankles07 because you're using dot notation
change it to bracket notation.
Adrian Kopytko
@adriankopytko
May 30 2016 01:20
How can i check by filter many args from array arrWithArgs?
llamatarianism
@llamatarianism
May 30 2016 01:20
myStorage.car.inside["glove box"]
Erik Moura
@erikian
May 30 2016 01:20
@keshav929 could you help me with this?
function factorialize(num) { var number = num; for (i=num; i > number ; i--){ var answer = number * i; if (i > number){ return answer; } } } factorialize(5);
oops wrong code
KESHAV KUNDAL
@keshav929
May 30 2016 01:20
after entering the function you have declared the number variable that has store the value of num which in turn is equal to 5
this is fine but not perfect
buiphuking
@buiphuking
May 30 2016 01:20
@llamatarianism
what i want is 9 cells in the center with all 300px and .container 350px
Xavier Velez
@JonSnow08
May 30 2016 01:20
okay
KESHAV KUNDAL
@keshav929
May 30 2016 01:21
since num is local to the scope of function
Jim Strickland
@JStrick999
May 30 2016 01:21
Has anyone done Seek and Destroy? There are a couple of tests it does not seem to delete some of the duplicates.
llamatarianism
@llamatarianism
May 30 2016 01:21
@buiphuking that's more of a CSS question than a JS question. I'd recommend trying /Help or /HelpFrontEnd instead
this is the JS help channel
Adrian Kopytko
@adriankopytko
May 30 2016 01:21
@JStrick999 I'm stuck here too!
Henry Nguyen
@airankles07
May 30 2016 01:21
@llamatarianism @clleyton thx guys!
CamperBot
@camperbot
May 30 2016 01:21
airankles07 sends brownie points to @llamatarianism and @clleyton :sparkles: :thumbsup: :sparkles:
:cookie: 673 | @llamatarianism |http://www.freecodecamp.com/llamatarianism
:cookie: 328 | @clleyton |http://www.freecodecamp.com/clleyton
KESHAV KUNDAL
@keshav929
May 30 2016 01:21
you can use num itself rather than storing it in some new variable that would do nothin better and is rather taking up the space
Erik Moura
@erikian
May 30 2016 01:22
@keshav929

function spinalCase(str) {
  // "It's such a fine line between stupid, and clever."
  // --David St. Hubbins

  var i = 0,
      l = str.length,
      st = "";

  var test = str.replace(str[4], "-" + str[4]);

   for (i; i <= l; i++) {
     if (str.charCodeAt(i) >= 65 && str.charCodeAt(i) <= 90) {
        var c = str.charCodeAt(i);
        var char = String.fromCharCode(c);
        var charToRegExp = new RegExp(char, "g");
        st = str.replace(charToRegExp, "-" + char);
    }

  }

  return st;
}

spinalCase("The_Andy_Griffith_Show");
Henry Nguyen
@airankles07
May 30 2016 01:22
@Chrono79 thx!
CamperBot
@camperbot
May 30 2016 01:22
:cookie: 935 | @chrono79 |http://www.freecodecamp.com/chrono79
airankles07 sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
Xavier Velez
@JonSnow08
May 30 2016 01:22
okay let me adjust myy code
KESHAV KUNDAL
@keshav929
May 30 2016 01:22
correct this error and post yoour code
Jim Strickland
@JStrick999
May 30 2016 01:22

function destroyer(arr) {
  var filteredArray = [];
  var arrayLength = arr.length;
  // Remove all the values
  for(var i = 0; i < arrayLength; i++){

    for (var j=1; j < arguments.length; j++)
      {
    if (arr[i] === arguments[j]) 

      {arr.splice(i, 1);
      arrayLength --;
    }
   // {
    //  filteredArray = arr.filter(arr[i]).push();

  //  }
      }

   //if (arr[i] === arguments[2]) 


}

  return arr;
}

//destroyer([1, 2, 3, 1, 2, 3], 2, 3);
//destroyer([3, 5, 1, 2, 2], 2, 3, 5);
destroyer([2, 3, 2, 3], 2, 3);
KESHAV KUNDAL
@keshav929
May 30 2016 01:22
@JonSnow08
Jim Strickland
@JStrick999
May 30 2016 01:23
when I use destroyer([3, 5, 1, 2, 2], 2, 3, 5); it returns [1,2]. it should be just 1
KESHAV KUNDAL
@keshav929
May 30 2016 01:25
then in every for loop that you would use in your life just take care about three thing and nothing else , first the initialisation like the initial value what should your loop value start with ,next thing your terminating condition, some condition if turns out to be false, can move you out of the loop and last one being the increement or decreement..
@JonSnow08
Xavier Velez
@JonSnow08
May 30 2016 01:25
got it
Erik Moura
@erikian
May 30 2016 01:26
@JonSnow08 try to reduce your array to a single value
KESHAV KUNDAL
@keshav929
May 30 2016 01:26
now for factorialise problem , 5! = 5x4x3x2x1;
Xavier Velez
@JonSnow08
May 30 2016 01:26
yup
Diego Mayer
@Chrono79
May 30 2016 01:26
@JStrick999 the 2 is now at index 0 and you advance your index in your loop
destroyer([2, 3, 2, 3], 2, 3);
Xavier Velez
@JonSnow08
May 30 2016 01:26
@erikian im not using an array
KESHAV KUNDAL
@keshav929
May 30 2016 01:26
start from 5 and loop upto 1 , with decreementing loop variable every time the loop execution.
Jim Strickland
@JStrick999
May 30 2016 01:27
@Chrono79 could you explain?
Diego Mayer
@Chrono79
May 30 2016 01:28
@JStrick999 copy and paste your code here, and look at the values: http://www.pythontutor.com/javascript.html#mode=edit
Xavier Velez
@JonSnow08
May 30 2016 01:28
okay so starting at 5 with i = num(5) and using i-- as my decreement is good
KESHAV KUNDAL
@keshav929
May 30 2016 01:28
and in the loop do the product of loop variable that would take the values 5, 4,3,2,1 successively , with the previous loop value which you are storing insome other variable.
starting with i=5 is good
Xavier Velez
@JonSnow08
May 30 2016 01:29
so i want to stop the loop at 1 === 0 in this case correct?
i mean i === 0
Jim Strickland
@JStrick999
May 30 2016 01:29

function destroyer(arr) {
  var filteredArray = [];
  var arrayLength = arr.length;
  // Remove all the values
  for(var i = 0; i < arrayLength; i++){

    for (var j=1; j < arguments.length; j++)
      {
    if (arr[i] === arguments[j]) 

      {arr.splice(i, 1);
      arrayLength --;
    }
   // {
    //  filteredArray = arr.filter(arr[i]).push();

  //  }
      }

   //if (arr[i] === arguments[2]) 


}

  return arr;
}

//destroyer([1, 2, 3, 1, 2, 3], 2, 3);
destroyer([3, 5, 1, 2, 2], 2, 3, 5);
//destroyer([2, 3, 2, 3], 2, 3);
```
Thomas Hodges
@thodges314
May 30 2016 01:29
Has anyone tried to get their CodePen projects running on their own server? I really liked my Poromodo timer so I wanted to host it on my own server so I could add the feature of the titlebar updating with the remaining time (so you could keep the timer open in a tab and glance up to see the remaining time without clicking over). I added the headers and got jQuery and Bootstrap running, but it's not recognising my java code.
KESHAV KUNDAL
@keshav929
May 30 2016 01:29
your for loop should look like this : for(var i = num ; i> 1 ; i--){}
Diego Mayer
@Chrono79
May 30 2016 01:30
@JStrick999 invert your loops, first the one that runs through arguments and inside it the one that runs through the arr
Xavier Velez
@JonSnow08
May 30 2016 01:30
i < 1 right? because i will always be greater than 1 if i start at 5
Thomas Hodges
@thodges314
May 30 2016 01:30
http://www.californiamathtutor.com/poromodo/poromodo.html <-- if you 'View Source' you should be able to see everything as I have it set up. Links to the javascript source are working.
KESHAV KUNDAL
@keshav929
May 30 2016 01:31
not smaller than sign , take the first loop execution case where i is 5 and it checks the condition , i<5 it is not so it will not enter the loop
i>=1 should be the condition
Simon Cordova
@gbsimon87
May 30 2016 01:33
@JonSnow08 you need it to start at 5 so it can decrement down...
Xavier Velez
@JonSnow08
May 30 2016 01:33
k this is what I have so far

function factorialize(num) {
  var number = num;

  for (i=num; i >= 1  ; i--){   
   var answer = num * i; 
    if (i > num){
      return answer;
    }
    }




}

factorialize(5);
Jim Strickland
@JStrick999
May 30 2016 01:33

I switched the order, but no change. ```

function destroyer(arr) {
var filteredArray = [];
var arrayLength = arr.length;
// Remove all the values
//for(var i = 0; i < arrayLength; i++){

for (var j=1; j < arguments.length; j++)
  {

  for(var i = 0; i < arrayLength; i++){
if (arr[i] === arguments[j]) 

  {arr.splice(i, 1);
  arrayLength --;
}

// {
// filteredArray = arr.filter(arr[i]).push();

// }
}

//if (arr[i] === arguments[2])

}

return arr;
}

//destroyer([1, 2, 3, 1, 2, 3], 2, 3);
destroyer([3, 5, 1, 2, 2], 2, 3, 5);
//destroyer([2, 3, 2, 3], 2, 3);
```


function destroyer(arr) {
  var filteredArray = [];
  var arrayLength = arr.length;
  // Remove all the values
  //for(var i = 0; i < arrayLength; i++){

    for (var j=1; j < arguments.length; j++)
      {

      for(var i = 0; i < arrayLength; i++){
    if (arr[i] === arguments[j]) 

      {arr.splice(i, 1);
      arrayLength --;
    }
   // {
    //  filteredArray = arr.filter(arr[i]).push();

  //  }
      }

   //if (arr[i] === arguments[2]) 


}

  return arr;
}

//destroyer([1, 2, 3, 1, 2, 3], 2, 3);
destroyer([3, 5, 1, 2, 2], 2, 3, 5);
//destroyer([2, 3, 2, 3], 2, 3);
KESHAV KUNDAL
@keshav929
May 30 2016 01:34
remove the var nuber = num;
add var keyword before i in for loop;
Xavier Velez
@JonSnow08
May 30 2016 01:35
oops yeah
ok got it
i get an error when I do that
KESHAV KUNDAL
@keshav929
May 30 2016 01:36
and in the loop , just type : answer =1; answer = answer * i ;
Simon Cordova
@gbsimon87
May 30 2016 01:36
@keshav929 thanks for clarying @JonSnow08 didn't need the number = num part.
I believe it has no use as 'number' is never used either way, correct?
CamperBot
@camperbot
May 30 2016 01:36
gbsimon87 sends brownie points to @keshav929 and @jonsnow08 :sparkles: :thumbsup: :sparkles:
:cookie: 246 | @jonsnow08 |http://www.freecodecamp.com/jonsnow08
:cookie: 265 | @keshav929 |http://www.freecodecamp.com/keshav929
KESHAV KUNDAL
@keshav929
May 30 2016 01:37
outside and before the for loop declare var answer;
@JonSnow08
@gbsimon87 exactly :)
Xavier Velez
@JonSnow08
May 30 2016 01:38
yeah @gbsimon87 i removed it from being called but forgot to remove the declaration
Diego Mayer
@Chrono79
May 30 2016 01:38
@JStrick999 instead of decreasing arrayLength, try decreasing i
KESHAV KUNDAL
@keshav929
May 30 2016 01:38
now show me the code
Connor Hastey-Palindat
@cpalindat
May 30 2016 01:38
Is anyone free to help figure out why my geolocation in my weather app isn't working? :)
Xavier Velez
@JonSnow08
May 30 2016 01:39

function factorialize(num) {
 var answer = 0;
  for (i = num; i >= 1  ; i--){   
   answer = num * i; 
    if (i > num){
      return answer;
    }
    }




}

factorialize(5);
Diego Mayer
@Chrono79
May 30 2016 01:39
@ConnHurr if it's in chrome, because you're not using https
Connor Hastey-Palindat
@cpalindat
May 30 2016 01:39
You mean https in codepen?
Simon Cordova
@gbsimon87
May 30 2016 01:39
A fellow Canadian! I guess I'll say, go Oilers!
Diego Mayer
@Chrono79
May 30 2016 01:39
@ConnHurr yes
Jim Strickland
@JStrick999
May 30 2016 01:40
@Chrono79 why would I decrease i?
Connor Hastey-Palindat
@cpalindat
May 30 2016 01:40
oh that fixed it! thank you @Chrono79 !
CamperBot
@camperbot
May 30 2016 01:40
:cookie: 936 | @chrono79 |http://www.freecodecamp.com/chrono79
connhurr sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
KESHAV KUNDAL
@keshav929
May 30 2016 01:40
follow up the instructions as above and change the code in for loop and delete that "=0"after the answer before the for loop
also delete the if block from the for loop for now;
@JonSnow08
Xavier Velez
@JonSnow08
May 30 2016 01:41
@keshav929 you mean var i ?
Jim Strickland
@JStrick999
May 30 2016 01:41
@chrono79 That worked. I am just trying to figure out why?
KESHAV KUNDAL
@keshav929
May 30 2016 01:41
var answer
i mean
Diego Mayer
@Chrono79
May 30 2016 01:41
@JStrick999 because you're mutating your array and your index is always increasing, so no wonder your algorithm looses some numbers
arr = [2,3,2,3], the first time it deletes the 2 2s i value was 0
the second time i value is 1 so the first 3 is skipped and you delete only the last 3
Xavier Velez
@JonSnow08
May 30 2016 01:41
no i mean the instructions from above
Moisés Man
@moigithub
May 30 2016 01:42
@JonSnow08 actually ur return never executed
cuz i will never be > num
KESHAV KUNDAL
@keshav929
May 30 2016 01:42
i am writing the code :
var answer;
Xavier Velez
@JonSnow08
May 30 2016 01:43
function factorialize(num) {
 var answer;
  for (i = num; i >= 1  ; i--){   
   answer = num * i; 

   }




}

factorialize(5);
KESHAV KUNDAL
@keshav929
May 30 2016 01:44

var answer;
for(var i =num ; i>=1 ; i--){
answer = answer * i;

}

return answer;
try this
Moisés Man
@moigithub
May 30 2016 01:44
@JonSnow08 u need to initialize ur answer variable
if u dont set a initial value.. by default it will be undefined
and undefined multiplied by any number = NaN
Simon Cordova
@gbsimon87
May 30 2016 01:45
Yeah I believe so as well, you'll get NaN
KESHAV KUNDAL
@keshav929
May 30 2016 01:45
set answer =1;
Asma
@asma8867
May 30 2016 01:45

// Setup
var collection = {
    2548: {
      album: "Slippery When Wet",
      artist: "Bon Jovi",
      tracks: [ 
        "Let It Rock", 
        "You Give Love a Bad Name" 
      ]
    },
    2468: {
      album: "1999",
      artist: "Prince",
      tracks: [ 
        "1999", 
        "Little Red Corvette" 
      ]
    },
    1245: {
      artist: "Robert Palmer",
      tracks: [ ]
    },
    5439: {
      album: "ABBA Gold"
    }
};
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));

// Only change code below this line
function updateRecords(id, prop, value) {

var test=collection.id;
  if (test!=="" && test1!=="tracks"){
    value=prop;
  }

  else if (prop="tracks" && value!=="") {
    tracks.push("value");
  }
  else if (value==""){
    prop.delete;
  }

  return collection;
}

// Alter values below to test your code
updateRecords(5439, "artist", "ABBA");
is there here anyone help me with my code?
I am confused what should I do :(
Simon Cordova
@gbsimon87
May 30 2016 01:45
Initial answer should be assigned to 0 no? Is this incorrect?
Moisés Man
@moigithub
May 30 2016 01:45
not 0.. cuz 0*any num = 0
Simon Cordova
@gbsimon87
May 30 2016 01:45
Excuse me, to 5...
Xavier Velez
@JonSnow08
May 30 2016 01:46
function factorialize(num) {
 var answer;
  for (i = num; i >= 1  ; i--){   
   answer = num * i; 

   }




}

factorialize(5);
KESHAV KUNDAL
@keshav929
May 30 2016 01:46
now yes not zero,
Diego Mayer
@Chrono79
May 30 2016 01:46
@asma8867 review dot and bracket notation
Xavier Velez
@JonSnow08
May 30 2016 01:46
oops
KESHAV KUNDAL
@keshav929
May 30 2016 01:46
@JonSnow08 var answer= 1;
Xavier Velez
@JonSnow08
May 30 2016 01:46
hold on
KESHAV KUNDAL
@keshav929
May 30 2016 01:46
ok
Xavier Velez
@JonSnow08
May 30 2016 01:46
yeah didnt copy
Simon Cordova
@gbsimon87
May 30 2016 01:46
Oh sorry, 1, yes! ha, I had to triple think that like a dummy lolol
Xavier Velez
@JonSnow08
May 30 2016 01:46
i had it
function factorialize(num) {
 var answer = 1;
  for (var i = num; i >= 1  ; i--){   
   answer = answer * i; 

   }




}

factorialize(5);
Diego Mayer
@Chrono79
May 30 2016 01:47
@JStrick999 did you understand why?
joel
@wabittman
May 30 2016 01:47
Initialize the three variables a b and c with 5 10 and "I Respectively am a" so that they will not be undefined.......[how would i write this out in code?
KESHAV KUNDAL
@keshav929
May 30 2016 01:47
now outside the for loop return answer;
is it working ?
Xavier Velez
@JonSnow08
May 30 2016 01:47
@keshav929 you're the man thank you
CamperBot
@camperbot
May 30 2016 01:47
jonsnow08 sends brownie points to @keshav929 :sparkles: :thumbsup: :sparkles:
:cookie: 266 | @keshav929 |http://www.freecodecamp.com/keshav929
Simon Cordova
@gbsimon87
May 30 2016 01:48
hey @keshav929, if I can ask, why does 'answer' get set outside the for loop?
@JonSnow08 that was a hefty problem there lol
Moisés Man
@moigithub
May 30 2016 01:48
@JonSnow08 if u still dont understand what u code does.. u can analyze it here http://pythontutor.com/javascript.html#mode=edit
KESHAV KUNDAL
@keshav929
May 30 2016 01:48
its ok bro @JonSnow08
joel
@wabittman
May 30 2016 01:49
Initialize the three variables a b and c with 5 10 and "I Respectively am a" so that they will not be undefined.
Xavier Velez
@JonSnow08
May 30 2016 01:49
@moigithub thank you ill try it out i think I understand this one though
CamperBot
@camperbot
May 30 2016 01:49
:star2: 1288 | @moigithub |http://www.freecodecamp.com/moigithub
jonsnow08 sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
Simon Cordova
@gbsimon87
May 30 2016 01:49
Oh, got it, never mind @keshav929
This is a great community, I love how willing people are to help :+1:
Isaac Pak
@pak11273
May 30 2016 01:50
can anyone help me on the weather app plz
KESHAV KUNDAL
@keshav929
May 30 2016 01:50
yeah @gbsimon87 declaring the variable outside the for loop set the scope of that answer variable to be in the whole function and in other case if i would have declare it inside the for loop it would not have been possible to return the answer as it's scope would have been local to that for block .
joel
@wabittman
May 30 2016 01:50
Initialize the three variables a b and c with 5 10 and "I Respectively am a" so that they will not be undefined.
Jim Strickland
@JStrick999
May 30 2016 01:50
@Chrono79 I think so. Because the arr is being shortened by one element, we need to back out the increment.
KESHAV KUNDAL
@keshav929
May 30 2016 01:51
@gbsimon87 so happy that you got it on you own
:)
Diego Mayer
@Chrono79
May 30 2016 01:51
@JStrick999 right, you can leave arr.length in the for loop
Simon Cordova
@gbsimon87
May 30 2016 01:51
I did, but thank you nonetheless! :)
How long have you been coding?
KESHAV KUNDAL
@keshav929
May 30 2016 01:51
2 years ,
joel
@wabittman
May 30 2016 01:51
Initialize the three variables a b and c with 5 10 and "I Respectively am a" so that they will not be undefined. [how would i write this out in code?]
KESHAV KUNDAL
@keshav929
May 30 2016 01:52
but not continuous
Isaac Pak
@pak11273
May 30 2016 01:52
@Chrono79 I thought you left. Thanks for the main.temp. it works!
CamperBot
@camperbot
May 30 2016 01:52
pak11273 sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:warning: pak11273 already gave chrono79 points
Xavier Velez
@JonSnow08
May 30 2016 01:52
thank you all for your help
Diego Mayer
@Chrono79
May 30 2016 01:52
@pak11273 no problem
Simon Cordova
@gbsimon87
May 30 2016 01:53

OH ok, I'm on a good 2 months right now but trying to keep a steady pace.
I wish I found free code camp earlier.

@JonSnow08 I didn't contribute but good job!

Isaac Pak
@pak11273
May 30 2016 01:53
Anyone on the weather app challenge?
Xavier Velez
@JonSnow08
May 30 2016 01:53
that site is awesome I just tried it and i think it will help me problem solve in the future where my mistakes are @moigithub
joel
@wabittman
May 30 2016 01:53

// Initialize these three variables
var a;
var b;
var c;

// Do not change code below this line

a = a + 1;
b = b + 5;
c = c + " String!";

a = 6;
b = 10;
c = c

KESHAV KUNDAL
@keshav929
May 30 2016 01:53
no problem @JonSnow08 try to figure out how it works , i mean your factorialize problem's code. try figuring it out on paper
joel
@wabittman
May 30 2016 01:54
Initialize the three variables a, b, and c with 5, 10, and "I am a" respectively so that they will not be undefined
KESHAV KUNDAL
@keshav929
May 30 2016 01:54
wish you luck @gbsimon87
Xavier Velez
@JonSnow08
May 30 2016 01:54
@gbsimon87 im at about the same time frame. I started with Khan academy but the community here makes all the difference
Moisés Man
@moigithub
May 30 2016 01:54
@wabittman if u have a variable named age
var age;
by default it dont have any value its undefined (so to speak)
soo if u wanna let say start with value 10
u do
var age = 10; <-- giving a starting value means initialize
Xavier Velez
@JonSnow08
May 30 2016 01:55
@keshav929 I used that thing @moigithub mentioned and it literally broke it down line for line for me
joel
@wabittman
May 30 2016 01:55
okay
Isaac Pak
@pak11273
May 30 2016 01:55
anyone know how to make an embedded youtube video autoloop(in an iframe)?
KESHAV KUNDAL
@keshav929
May 30 2016 01:56
yeah that actually does @JonSnow08
Simon Cordova
@gbsimon87
May 30 2016 01:56
cheers @keshav929
@JonSnow08 I tried khan and codecademy and udacity but seriously it's this community that make and breaks the environment
shwabbie
@shwabbie
May 30 2016 01:56
I'm stuck on Switch Statements...
Simon Cordova
@gbsimon87
May 30 2016 01:56
hey @shwabbie I just passed the switch statements maybe I can help you...
shwabbie
@shwabbie
May 30 2016 01:57
I think I just need to connect val to answer somehow...

function caseInSwitch(val) {
var answer = "";
// Only change code below this line

switch (answer) {
case 1:
console.log("alpha");
break;
case 2:
console.log("beta");
break;
case 3:
console.log("gamma");
break;
case 4:
console.log("delta");
break;
default:
console.log('default');
}
// Only change code above this line
return answer;
}

Nany
@NanyR
May 30 2016 01:57

var contacts = [
{
"firstName": "Akira",
"lastName": "Laine",
"number": "0543236543",
"likes": ["Pizza", "Coding", "Brownie Points"]
},
{
"firstName": "Harry",
"lastName": "Potter",
"number": "0994372684",
"likes": ["Hogwarts", "Magic", "Hagrid"]
},
{
"firstName": "Sherlock",
"lastName": "Holmes",
"number": "0487345643",
"likes": ["Intriguing Cases", "Violin"]
},
{
"firstName": "Kristian",
"lastName": "Vos",
"number": "unknown",
"likes": ["Javascript", "Gaming", "Foxes"]
}
];

function lookUpProfile(firstName, prop){
// Only change code below this line
for(var i= 0; i < contacts.length; i++){
while (firstName == contacts[i].firstName && contacts[i].hasOwnProperty(prop)) {
return contacts[i].prop;
}
if(firstName !== contacts[i].firstName){
return "No such contact";
}
else if(contacts[i].hasOwnProperty(prop)=== false){
return "No such property";
}
}
// Only change code above this line
}

// Change these values to test your function
lookUpProfile("Sherlock", "likes");

Diego Mayer
@Chrono79
May 30 2016 01:57
@shwabbie you shouldn't use console.log
Nany
@NanyR
May 30 2016 01:57
I cannot figure out what is wrong with my while loop its not working
shwabbie
@shwabbie
May 30 2016 01:58
return?
Moisés Man
@moigithub
May 30 2016 01:58
instead of console.log u should "assign" those values to the variable answer @shwabbie
Diego Mayer
@Chrono79
May 30 2016 01:58
@NanyR don't use another loop, with only the for loop is enough, look at what camperbot says for pasting code
Moisés Man
@moigithub
May 30 2016 01:59
@shwabbie and ur switch should NOT evaluate answer variable.. but
Simon Cordova
@gbsimon87
May 30 2016 01:59
Just like @moigithub stated, that was the only way I got it to work
Nany
@NanyR
May 30 2016 01:59
so instead of while just do an if statement?
Diego Mayer
@Chrono79
May 30 2016 02:00
help format
CamperBot
@camperbot
May 30 2016 02:00

:point_right: code formatting [wiki]

Multi line Code

```js ⇦ Type 3 backticks and then press [shift + enter ⏎] (type js or html or css)

<paste your code here>,
then press [shift + enter ⏎]

``` ⇦ Type 3 backticks, then press [enter ⏎]

Single line Code

This an inline `<paste code here>` code formatting with a single backtick() at _start_ and _end_ around thecode`.

See also: ☛ How to type Backticks | ☯ Compose Mode | ❄ Gitter Formatting Basics

:pencil: read more about code formatting on the FCC Wiki

Diego Mayer
@Chrono79
May 30 2016 02:00
@NanyR yes, but you have to fix it, and return "No such contact" only when you have looped over the whole contacts list
buiphuking
@buiphuking
May 30 2016 02:02
in html
onClick="window.location.href=window.location.href"
what is that mean guys ?????????
Asma
@asma8867
May 30 2016 02:03

// Setup
var collection = {
    2548: {
      album: "Slippery When Wet",
      artist: "Bon Jovi",
      tracks: [ 
        "Let It Rock", 
        "You Give Love a Bad Name" 
      ]
    },
    2468: {
      album: "1999",
      artist: "Prince",
      tracks: [ 
        "1999", 
        "Little Red Corvette" 
      ]
    },
    1245: {
      artist: "Robert Palmer",
      tracks: [ ]
    },
    5439: {
      album: "ABBA Gold"
    }
};
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));

// Only change code below this line
function updateRecords(id, prop, value) {

var test=collection.id;

  if (value!=="" && prop!=="tracks"){
    value=prop;
    if (prop=="tracks" && value!=="") {
    tracks.push("value");
  }
     else if (value===""){
    prop.delete;
  }
  }

  return collection;
}

// Alter values below to test your code
updateRecords(5439, "artist", "ABBA");
could you guys please help me?
shwabbie
@shwabbie
May 30 2016 02:05
@moigithub and @gbsimon87 ... Thank you both! I was so caught up on using Return or Console.log... that I forgot you could just assign it. Thanks!!
CamperBot
@camperbot
May 30 2016 02:05
shwabbie sends brownie points to @moigithub and @gbsimon87 :sparkles: :thumbsup: :sparkles:
:cookie: 201 | @gbsimon87 |http://www.freecodecamp.com/gbsimon87
:star2: 1289 | @moigithub |http://www.freecodecamp.com/moigithub
Simon Cordova
@gbsimon87
May 30 2016 02:06
Great to help!
Asma
@asma8867
May 30 2016 02:06

// Setup
var collection = {
    2548: {
      album: "Slippery When Wet",
      artist: "Bon Jovi",
      tracks: [ 
        "Let It Rock", 
        "You Give Love a Bad Name" 
      ]
    },
    2468: {
      album: "1999",
      artist: "Prince",
      tracks: [ 
        "1999", 
        "Little Red Corvette" 
      ]
    },
    1245: {
      artist: "Robert Palmer",
      tracks: [ ]
    },
    5439: {
      album: "ABBA Gold"
    }
};
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));

// Only change code below this line
function updateRecords(id, prop, value) {

var test=collection.id;

  if (value!=="" && prop!=="tracks"){
    value=prop;
    if (prop=="tracks" && value!=="") {
    tracks.push("value");
  }
     else if (value===""){
    prop.delete;
  }
  }

  return collection;
}

// Alter values below to test your code
updateRecords(5439, "artist", "ABBA");
is there here anyone help me with that?
Diego Mayer
@Chrono79
May 30 2016 02:06
@asma8867 you have to review all these challenges:
Accessing Objects Properties with the Dot Operator
Accessing Objects Properties with Bracket Notation
Accessing Objects Properties with Variables
Updating Object Properties
Add New Properties to a JavaScript Object
Delete Properties from a JavaScript Object
Isaac Pak
@pak11273
May 30 2016 02:07
@NanyR I think you can get rid of your first if statement, check with @Chrono79 though
Asma
@asma8867
May 30 2016 02:07

// Setup
var collection = {
    2548: {
      album: "Slippery When Wet",
      artist: "Bon Jovi",
      tracks: [ 
        "Let It Rock", 
        "You Give Love a Bad Name" 
      ]
    },
    2468: {
      album: "1999",
      artist: "Prince",
      tracks: [ 
        "1999", 
        "Little Red Corvette" 
      ]
    },
    1245: {
      artist: "Robert Palmer",
      tracks: [ ]
    },
    5439: {
      album: "ABBA Gold"
    }
};
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));

// Only change code below this line
function updateRecords(id, prop, value) {

var test=collection.id;

  if (value!=="" && prop!=="tracks"){
    value=prop;
    if (prop=="tracks" && value!=="") {
    tracks.push("value");
  }}

  if (value===""){
    delete collection.id.prop;
  }


  return collection;
}

// Alter values below to test your code
updateRecords(5439, "artist", "ABBA");
I changed it right now.
Justin Woodward
@jwoo92
May 30 2016 02:08
help roman numeral converter
CamperBot
@camperbot
May 30 2016 02:08

:point_right: algorithm roman numeral converter [wiki]

Algorithm Roman Numeral Converter

Problem Explanation:

  • You will create a program that converts an integer to a Roman Numeral.
:pencil: read more about algorithm roman numeral converter on the FCC Wiki
Diego Mayer
@Chrono79
May 30 2016 02:09
@asma8867 don't nest these 2 ifs:
  if (value!=="" && prop!=="tracks"){
    value=prop;
    if (prop=="tracks" && value!=="") {
    tracks.push("value");
  }}
Isaac Pak
@pak11273
May 30 2016 02:17
@NanyR oh i remember the challenge now. forget my last comment.
buiphuking
@buiphuking
May 30 2016 02:18
@Chrono79
can i have a chat with you, here is ok, or somewhere if i have your facebook or skype
Isaac Pak
@pak11273
May 30 2016 02:18
@NanyR I think your intial loop would work better if you changed !== to ==
@NanyR That way once you find a match for the contact you go on to try and find a match for the property
@NanyR that challenge is kinda hard. i can give you my solution if your spending too much time on it.
Diego Mayer
@Chrono79
May 30 2016 02:22
@buiphuking use chat privately
John
@tertiaryidentifier
May 30 2016 02:22
beginning to learn javascript objects is easier than I thought :)
DC
@dctor
May 30 2016 02:26
in Seek and Destroy, what's the function to be used in the .filter?
function destroyer(arr) {
  for (i=1; i<arguments.length; i++) { 
  return arguments[0].filter(arguments[i]);
}
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);
buiphuking
@buiphuking
May 30 2016 02:27
@Chrono79
how ?
Isaac Pak
@pak11273
May 30 2016 02:27
any thoughts on why this video doesn't autoloop?
<iframe frameborder="0" height="100%" width="100%" src="https://youtube.com/embed/n_dd3twgMs8?autoplay=1&loop=1&controls=0&showinfo=0&autohide=1">
  </iframe>
Diego Mayer
@Chrono79
May 30 2016 02:27
@buiphuking put your mouse pointer over my avatar
Isaac Pak
@pak11273
May 30 2016 02:27
@dctor you create it
@dctor from the mdn docs:
function isBigEnough(value) {
  return value >= 10;
}
var filtered = [12, 5, 8, 130, 44].filter(isBigEnough);
// filtered is [12, 130, 44]
@dctor filter uses a callback function for it's parameter, so as in this example, the function isBigEnough was created.
DC
@dctor
May 30 2016 02:30
@pak11273 i see...the function is to take the index of > 0 (1,2 in this case) value...how's that done?
Isaac Pak
@pak11273
May 30 2016 02:32
@dctor yeah, this challenge is a bit tricky. keep in mind that the argument being used is not an array
@dctor ([1, 2, 3, 1, 2, 3], 2, 3) is not an array
DC
@dctor
May 30 2016 02:33
its an arguments @pak11273
Isaac Pak
@pak11273
May 30 2016 02:33
@dctor yes
DC
@dctor
May 30 2016 02:33
@pak11273 and it has the same way of accessing its elements as array
Nany
@NanyR
May 30 2016 02:34
@pak11273 yes please! I can't figure it out. The first condition after the for loop is just not working , I tried with if statements, while loop...
DC
@dctor
May 30 2016 02:35
@pak11273 so this arguments - arg[0] = array arg[1]=2 and arg[3] = 3
Isaac Pak
@pak11273
May 30 2016 02:35
@NanyR i used 2 loops, but chronos said it could be done with just 1 loop. His solution is probably better, but I'll share mine.
DC
@dctor
May 30 2016 02:36
@pak11273 and i need a function to return values from arg1 and arg2...any hint? a loop?
Connor Hastey-Palindat
@cpalindat
May 30 2016 02:36

Can anyone take a look at my pen? I'm not sure if im approaching this api stuff properly,

https://codepen.io/cpalindat/pen/Vjwarw?editors=1010

Isaac Pak
@pak11273
May 30 2016 02:43
@dctor oops sorry i was in a private chat. let me see...
@dctor what challenge was this again?
DC
@dctor
May 30 2016 02:45
@pak11273 seek and destroy
Isaac Pak
@pak11273
May 30 2016 02:45
@dctor ah yes , of course
@dctor now i remember, in the mdn docs for arguments is one line that you should use
@dctor because you will want to change the arguments into an array...hint hint
DC
@dctor
May 30 2016 02:47
@pak11273 but that one line is for value > xx...in this case i need a function return the index number > 0...not the value
Christina
@cgraham74
May 30 2016 02:47
Anyone have a good grasp of Regex?
Isaac Pak
@pak11273
May 30 2016 02:48
@dctor your on the right track with your thinking. how you going to check that index number when your arguments are not an array?
DC
@dctor
May 30 2016 02:49
@pak11273 you access arguments the same way as array..like arg[0], arg[1]...etc
Christina
@cgraham74
May 30 2016 02:49
I am working on the Validate US telephone algorithm and I have them all passing but 3. (where the number only has one "(" or ")"
function telephoneCheck(str) {
  // Good luck!
  var result = /^[1]?\s?[(]?\d{3}\s?[)]?\s?[-]?\d{3}\s?[-]?\d{4}$/.test(str);

return result;


}

telephoneCheck("1 555)555-5555");
Isaac Pak
@pak11273
May 30 2016 02:50
@dctor okay so when you pass those arguments into your callback, it isn't going to work
DC
@dctor
May 30 2016 02:52
@pak11273 i can't find a way to pass arg[1] and arg[2] in the filter. the filter method needs a function...so i need a function to return values with index > 0
that's my thought
Douglas Hoang
@DouglasHoang
May 30 2016 02:52
Hey guys! I've been stuck on codepen loading my api for the weather app challenge. Since the api won't work when i put www. or http:// in front of it I have no clue how to make it so codepen goes to this address http://api.openweathermap.org/data/2.5/forecast/weather?lat=33&lon=-97&APPID=b21be656bf39c3aa3e806da3c45d059f
Isaac Pak
@pak11273
May 30 2016 02:53
@dctor yeah i was doing like you when i first tried it. Recall what indexOf() does...
Sudeep Narkar
@sudeepnarkar
May 30 2016 02:53

function getIndexToIns(arr, num) 
{
  // Find my place in this sorted array.
  arr.sort(function(a, b) {
  return a - b;
});
  //alert(arr);
  console.log("arr="+arr);
  var i;
  var index=0;

  for(i=0;i<arr.length;i++)
  {
    if(arr[i]<num&&i!==arr.length-1)
    {
      continue;
    }  
    else 
    {
      if(i===arr.length-1&&arr[i]<num)
      {
        index=i+1;  
      }
      else
      {  
      index=i;
      }  
      break;
    }

  }  


  return index;
}

getIndexToIns([40,60], 50);
My code is working but it is not optimized. I would appreciate if anyone can suggest any optimizations.
DC
@dctor
May 30 2016 02:53
@pak11273 i was trying indexOf but thought filter would be easier
Isaac Pak
@pak11273
May 30 2016 02:54
@dctor remember what indefOf(..) === -1; will do?
Sudeep Narkar
@sudeepnarkar
May 30 2016 02:54
This is for where do I belong
DC
@dctor
May 30 2016 02:55
@pak11273 yap that's not found value
Isaac Pak
@pak11273
May 30 2016 02:55
@pak11273 exactly. so look at what the callback function does for filter();
@dctor in the example it uses return value >= 10 and the result is a "filtered" array. What if you used the indexOf() ??
Asma
@asma8867
May 30 2016 02:57

// Setup
var collection = {
    2548: {
      album: "Slippery When Wet",
      artist: "Bon Jovi",
      tracks: [ 
        "Let It Rock", 
        "You Give Love a Bad Name" 
      ]
    },
    2468: {
      album: "1999",
      artist: "Prince",
      tracks: [ 
        "1999", 
        "Little Red Corvette" 
      ]
    },
    1245: {
      artist: "Robert Palmer",
      tracks: [ ]
    },
    5439: {
      album: "ABBA Gold"
    }
};
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));

// Only change code below this line
function updateRecords(id, prop, value) {


var test=collection.id;

  if (value!=="" && prop!=="tracks"){
    test.prop=value;
  }

    if (prop=="tracks" && value!=="") {
    tracks.push("value");
  }

  if (value===""){
    delete test.prop;
  }


  return collection;
}

// Alter values below to test your code
updateRecords(5439, "artist", "ABBA");
please some one help me with my code :(
DC
@dctor
May 30 2016 02:58
@pak11273 you mean use indexOf !== -1 in the callback function?
Diego Mayer
@Chrono79
May 30 2016 02:59
@asma8867 you can't use dot notation with vars, use bracket notation
have you reviewed the past challenges?
Isaac Pak
@pak11273
May 30 2016 02:59
@dctor yes, i think you have the right idea, but i think you need to see my solution now to make sense of what i'm talking about.
@dctor or do you want to keep trying it?
Asma
@asma8867
May 30 2016 03:01
@Chrono79 yope. I have reviewed them :(
DC
@dctor
May 30 2016 03:02
@pak11273 i am thinking indexOf....loop...filter()
Isaac Pak
@pak11273
May 30 2016 03:03
the callback function to filter automagically loops. no need to use a loop.
Diego Mayer
@Chrono79
May 30 2016 03:04
@asma8867 mmmm, first fix the dot notation where you can't use it
then, this is wrong: tracks.push("value");
Norvin Burrus
@ndburrus
May 30 2016 03:04
@asma8867 test.prop=value; this needs adjusting... to get to value you go through collection via id & prop (using brackets). 2 more: to push value - note that is is a value, not a string. also access it the same way as the previous statement. tracks.push("value"); & use the same for the delete operationdelete test.prop; :)
wSlitz
@wSlitz
May 30 2016 03:06
I'm on "Exact Change" algorithm and I can't find a way to return decimal with two digits after comma e.g. 0.50
If I use toFixed(2) I get string ("0.50"), parseInt removes zeros (0.5).
Any ideas?
Diego Mayer
@Chrono79
May 30 2016 03:06
@wSlitz I think you don't need to
wSlitz
@wSlitz
May 30 2016 03:06
Test fails, so I think I need
Diego Mayer
@Chrono79
May 30 2016 03:07
show your code and the failing test, you can pm it if it's too long
DC
@dctor
May 30 2016 03:07
@pak11273 let me see your function
Isaac Pak
@pak11273
May 30 2016 03:08
@dctor you understand you need an array to use filter right?
wSlitz
@wSlitz
May 30 2016 03:08
@Chrono79
function checkCashRegister(price, cash, cid) {
    var bills = [0.01, 0.05, 0.10, 0.25, 1, 5, 10, 20, 100];
    var changeArr = [];
    var change = cash - price;

    // calculate total amount of cash in the drawer
    var cidAmount = parseFloat(cid.reduce(function(a, b) {
        return a + b[1];
    }, 0).toFixed(2));
    if (change > cidAmount) {
        return "Insufficient Funds";
    }
    if (change === cidAmount) {
        return "Closed";
    }

    for (var i = bills.length - 1; i >= 0; i--) {
        if (change - bills[i] < 0) {
            continue;
        }
        var count = 0;
        while (change >= bills[i]) {
            change -= bills[i];
            count++;
            }
            if (bills[i] * count <= cid[i][1]) {
                changeArr.push(cid[i][0], (bills[i]*count));
        }
    }
    return changeArr;
}

checkCashRegister(19.50, 20.00, [["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.10], ["QUARTER", 4.25], ["ONE", 90.00], ["FIVE", 55.00], ["TEN", 20.00], ["TWENTY", 60.00], ["ONE HUNDRED", 100.00]]);
// should return [["QUARTER", 0.50]]
DC
@dctor
May 30 2016 03:09
@pak11273 that's right
Diego Mayer
@Chrono79
May 30 2016 03:09
@wSlitz you return this: [ 'QUARTER', 0.5 ] instead of [["QUARTER", 0.50]], see the double brackets?
Isaac Pak
@pak11273
May 30 2016 03:09
@dctor can you view your private chat?
Josh Lavely
@Azayzel
May 30 2016 03:10
@asma8867 you need your code in a for loop and access the id while in the loop test=collection.id[i]
Since there's many ids you need the code to run through each until it matches the argument being passed
DC
@dctor
May 30 2016 03:11
@pak11273 how to get there?
Diego Mayer
@Chrono79
May 30 2016 03:11
@Azayzel no, she (or he) doesn't need a loop in that challenge, if you look at collection, it's an object with objects inside, you can access them with id, you need an index when it's an array of objects
Isaac Pak
@pak11273
May 30 2016 03:11
@dctor hmm. ill just post here
function destroyer(arr) {

  var args = Array.prototype.slice.call(arguments);

  return arr.filter(removeArgs);

    function removeArgs(value) {
      return args.indexOf(value) === -1;
  }

}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
wSlitz
@wSlitz
May 30 2016 03:12
@Chrono79 Ups :) thanks
CamperBot
@camperbot
May 30 2016 03:12
wslitz sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:cookie: 937 | @chrono79 |http://www.freecodecamp.com/chrono79
Diego Mayer
@Chrono79
May 30 2016 03:12
@wSlitz no problem
Isaac Pak
@pak11273
May 30 2016 03:12
@dctor sorry if i couldn't explain that well.
@dctor the filter function makes this one relatively easy.
@dctor the first time i tried a loop to iterate through the arguments, but someone in chat showed me the indexOf() method which is way easier.
DC
@dctor
May 30 2016 03:15
@pak11273 hmmm...the 1st line is for making it into an array?
Isaac Pak
@pak11273
May 30 2016 03:15
@dctor yep
Josh Lavely
@Azayzel
May 30 2016 03:15
@asma8867 use bracket notation for your prop
DC
@dctor
May 30 2016 03:16
@pak11273 but the input arr is already an array
Isaac Pak
@pak11273
May 30 2016 03:16
@dctor no its not
@dctor ([1, 2, 3, 1, 2, 3], 2, 3) this is not an array
@dctor you treat it like an array with arguments
@dctor but it's not an array
@dctor do you use pythontutor?
@dctor run the code through that and it will show you clearly what's going on
@dctor that url is a godsend whoever gave that to me from here lol
DC
@dctor
May 30 2016 03:19
@pak11273 ok will do...can you explain function removArgs?
@pak11273 very cool...thanks
Isaac Pak
@pak11273
May 30 2016 03:22
@dctor yes that is the callback that sifts through the array from args as a filter to the arguments[0]. by using the indexOf function we can create the array that doesn't contain the values.
DC
@dctor
May 30 2016 03:22
@pak11273 thanks
CamperBot
@camperbot
May 30 2016 03:22
dctor sends brownie points to @pak11273 :sparkles: :thumbsup: :sparkles:
:cookie: 299 | @pak11273 |http://www.freecodecamp.com/pak11273
Isaac Pak
@pak11273
May 30 2016 03:22
@dctor np. i can't explain it well. but pythontutor explains it exactly! trust me
Freinet Brutus
@freinet12
May 30 2016 03:23

can anyone tell me what's wrong with my code? I'm working on the Nesting For Loops challenge. 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++){
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]]);

Isaac Pak
@pak11273
May 30 2016 03:29
@freinet12 your just missing one thing
@freinet12 think about this instruction 'multiplies the product variable by each number in the sub-arrays of arr'

@freinet12

product *=[i][j];

look at [i][j]. this is not referencing anything

@pak11273 this is though
arr[i][j]
DoctorSmiles
@DoctorSmiles
May 30 2016 03:35
Would anyone mind taking a look at what I might be doing wrong here? It's the largestOfFour algorithm, but for some reason all it's doing is posting the last number in each sub-array instead of the largest, and I can't figure out why.
for (i = 0; i < arr.length; i++) { 
      for (j = 0; j < arr[i].length; j++) {
        for (k = 1; k < arr[i].length; k++) {
               numSize = arr[i][j];
         numTest = arr[i][k];
        }
         if (numSize < numTest) {
           numSize = numTest;
         } 
            arr.splice(i, 1, numTest);  
        }

      }


    return arr;
Diego Mayer
@Chrono79
May 30 2016 03:36
@DoctorSmiles too many loops, try using 2 and if going with the 2 loops approach, you need a var to store the largest value and push that to another array
DoctorSmiles
@DoctorSmiles
May 30 2016 03:36
Ah, alright, thanks.
Isaac Pak
@pak11273
May 30 2016 03:38
@freinet12 sorry if i'm not explaining very well. i can show you my solution if you stuck.
Freinet Brutus
@freinet12
May 30 2016 03:39
@pak11273 that would be cool. I'm stuck on the multiplying part
Isaac Pak
@pak11273
May 30 2016 03:40

@freinet12
change this:

product *=[i][j];

to this:

product =  product * arr[i][j];
Isaac Pak
@pak11273
May 30 2016 03:45
@DoctorSmiles there is a Math function that you might want to check out. It will return the largest number of an array...
can someone tell me why this video isn't auto looping?
<iframe frameborder="0" height="100%" width="100%" src="https://youtube.com/embed/n_dd3twgMs8?autoplay=1&loop=1&controls=0&showinfo=0&autohide=1">
  </iframe>
loop=1 in the query should be all i need right?
Isaac Pak
@pak11273
May 30 2016 03:51
i guess it's break time :smile:
joel
@wabittman
May 30 2016 03:52

// Declarations
var StUdLyCapVaR;
var properCamelCase;
var TitleCaseOver;

// Assignments
STUDLYCAPVAR = 10;
PRoperCAmelCAse = "A String";
tITLEcASEoVER = 9000;

Instructions
Fix the variable declarations and assignments so their names use camelCase.1
i need help with the above
Isaac Pak
@pak11273
May 30 2016 03:53
@wabittman what was the challenge name to that?
joel
@wabittman
May 30 2016 03:53
Understanding Case Sensitivity in Variables
DJ
@qualitymanifest
May 30 2016 03:54

@pak11273 out of curiosity i checked out the embed docs for loop:

Note: This parameter has limited support in the AS3 player and in IFrame embeds, which could load either the AS3 or HTML5 player. Currently, the loop parameter only works in the AS3 player when used in conjunction with the playlist parameter. To loop a single video, set the loop parameter value to 1 and set the playlist parameter value to the same video ID already specified in the Player API URL

Kyle W Pilkinton
@tadake
May 30 2016 03:56
can anyone help me with my javascript? im on the pomodoro clock and i closed my browser without saving so i had to restart and now i cant get it too work. its probably something simple but i keep missing it
http://codepen.io/tadake/pen/VjZNON
Isaac Pak
@pak11273
May 30 2016 03:56
@qualitymanifest i put &loop=1 in my url...
@wabittman camel case is like this camelCase.
joel
@wabittman
May 30 2016 03:57
ok so lower case
cannelflow
@cannelflow
May 30 2016 03:57
Write variable names in Javascript in camelCase. In camelCase, 
multi-word variable names have the first word in lowercase and
 the first letter of each subsequent word is capitalized.
ex
var someVariable;
var anotherVariableName;
var thisVariableNameIsTooLong;
@wabittman
Isaac Pak
@pak11273
May 30 2016 03:57
@qualitymanifest hmmm so i have to put a playlist parameter too?
DJ
@qualitymanifest
May 30 2016 03:58
@pak11273 yeah thats what it sounds like, thats why i pasted that
Isaac Pak
@pak11273
May 30 2016 03:58
@wabittman everything but the inside words, those will be capitalized
@qualitymanifest i'll try it and see, thanks!
CamperBot
@camperbot
May 30 2016 03:58
pak11273 sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star2: 1180 | @qualitymanifest |http://www.freecodecamp.com/qualitymanifest
joel
@wabittman
May 30 2016 04:00
alright thanks @qualitymanifest
CamperBot
@camperbot
May 30 2016 04:00
wabittman sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star2: 1181 | @qualitymanifest |http://www.freecodecamp.com/qualitymanifest
DJ
@qualitymanifest
May 30 2016 04:00
@pak11273 i think those brownies were for you. tax
Isaac Pak
@pak11273
May 30 2016 04:01
@qualitymanifest lol, it's all good.
DJ
@qualitymanifest
May 30 2016 04:01
oh wow they fixed tax. thanks @pak11273
CamperBot
@camperbot
May 30 2016 04:01
qualitymanifest sends brownie points to @pak11273 :sparkles: :thumbsup: :sparkles:
:cookie: 300 | @pak11273 |http://www.freecodecamp.com/pak11273
Isaac Pak
@pak11273
May 30 2016 04:04
@qualitymanifest well, it will autoloop with a playlist id, but my video isn't in any playlist lol
Bryan
@Bryan1029
May 30 2016 04:07
Hey, can someone show me how to write a script that counts backwards from 100 to 1 using a for loop? I'm having trouble getting it to work
KESHAV KUNDAL
@keshav929
May 30 2016 04:09
<script>
for(var i = 100;i>=1;i--){}



</script>
in the for loop display the i variable at whichever place you want
in console using console.log , in document using document.writeln @Bryan1029
Christina
@cgraham74
May 30 2016 04:15
help Validate US Telephone Numbers
CamperBot
@camperbot
May 30 2016 04:15

:point_right: algorithm validate us telephone numbers [wiki]

Algorithm Validate US Telephone Numbers

Problem Explanation:

  • The task is not that hard to understand, implementing it is the hardest part. You have a to validate an US phone number. This means there is a certain amount of numbers required, while you don't need to put the country code, you will still need the area code and use one of the few formats allowed.
:pencil: read more about algorithm validate us telephone numbers on the FCC Wiki
Richard Viskovic
@DrMerkwurdigliebe
May 30 2016 04:16
help Check for Palindromes
CamperBot
@camperbot
May 30 2016 04:16

:point_right: algorithm check for palindromes [wiki]

Algorithm Check for Palindromes

Explanation:

Our goal for solving this problem is tidying up the string passed in, and checking whether it is in fact a palindrome.

  • If you are unsure of what a palindrome is, it is a word or phrase that when reversed spells the same thing forwards or backwards. A simple example is mom, when you reverse the letters, it spells the same thing! Another example of a palindrome is race car. When we take out anything that is not a character it becomes racecar which is the same spelled forwards or backwards!

Once we have determined whether it is a palindrome or not we want to return either true or false based on our findings.

:pencil: read more about algorithm check for palindromes on the FCC Wiki

Bryan
@Bryan1029
May 30 2016 04:17

@keshav929
this is what i've got, and for some reason it's counting down by 2 and not 1. Can you point out why?
var num;
for (num = 100; num >=1; num--)
{

document.write(num+"<br />");
num--;
}

Isaac Pak
@pak11273
May 30 2016 04:22
@Bryan1029 you are iterating num-- twice. just leave it in the for ( ... ) part
like this:
var num;
for (num = 100; num >=1; num--)
{
document.write(num+"<br />");
}
César
@ICesarI
May 30 2016 04:22
num = 100; num >=1; num--
Start with 100 and iterate while the num is bigger or equal to 1. Every iteration your are going to substract 1 (num--)
However, you are subtracting again (last statement)
Isaac Pak
@pak11273
May 30 2016 04:23
yeah. what @ICesarI said :)
alright, my brain is mush. time to watch some Overwatch gaming :) bbl
César
@ICesarI
May 30 2016 04:28
Or play...?
Good night @pak11273
Isaac Pak
@pak11273
May 30 2016 04:29
@ICesarI i just like to watch on twitch.tv, i don't play otherwise i'd get addicted to it lol. take it easy bro
César
@ICesarI
May 30 2016 04:30
That's why I'm avoiding Ark
carlos zaldana
@DarkNnerdgy
May 30 2016 04:38
can someone help me with a JavaScript assignment. i need to make a madlips game with this instructions but ive tried at it for three days and i cant figure it out

You will need to use string operators to build a new string, result, using the provided variables: myNoun, myAdjective, myVerb, and myAdverb.

You will also need to provide additional strings, which will not change, in between the provided words.

We have provided a framework for testing your results with different words. The tests will run your function with several different inputs to make sure all of the provided words appear in the output, as well as your extra strings.

wordBlanks("dog", "big", "ran", "quickly");
and it gives me this error : wordBlanks("dog", "big", "ran", "quickly") should contain all of the passed words separated by non-word characters (and any additional words in your madlib).
Chris Cullen
@123xylem
May 30 2016 04:43
Where art thou
help
Where art thou help
help Where art thou
CamperBot
@camperbot
May 30 2016 04:43

:point_right: algorithm where art thou [wiki]

Algorithm Where Art Thou

Problem Explanation

Write an algorithm that will take an array for the first argument and return an array with all the objects that matches all the properties and values in the Object passed as second parameter.

:pencil: read more about algorithm where art thou on the FCC Wiki

Chris Cullen
@123xylem
May 30 2016 05:11

function whereAreYou(collection, source) {
  // What's in a name?
  var arr = [];
  // Only change code below this line
  var target =source;

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

whereAreYou([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" });
How can i make my var target == the property of source - IE
"capulet"
I can say source.last
but that is hardcoded
Jack Lyons
@JackEdwardLyons
May 30 2016 05:13
Hi guys, how would i add in the "on keypress 13" code for when a user finds a selection from the drop down they can simply press enter and it will search
here's my pen
Markus Kiili
@Masd925
May 30 2016 05:14
@123xylem Object.keys(source) gives an array of property keys of source. You should iterate through it.
Chris Cullen
@123xylem
May 30 2016 05:14
doesnt that just give 0 1 2 etc? @Masd925
Markus Kiili
@Masd925
May 30 2016 05:15
@123xylem No, because source is not an array.
@123xylem For collection it would give something like [ '0', '1', '2' ]
Chris Cullen
@123xylem
May 30 2016 05:17
what is the difference with source and collection?
they both look like arrays to me
Markus Kiili
@Masd925
May 30 2016 05:18
@123xylem There are two arguments passed into the function, separated by comma:
[{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }]
{ last: "Capulet" }
Parameters collection and source hold them when the function in executed.
First is an array of objects, and second an object.
lyett
@lyett
May 30 2016 05:22
Hi, How can I get a string.fromCharCode to take a string Var? The code seems to work until I get to the return statement

function rot13(str) { 
  var unicodeToNum = ''; // Declare as a string

  for (var i = 0; i<str.length; i++){    
    unicodeToNum += str.charCodeAt(i)+13 +","; // Convert str to Unicode
  }

  unicodeToNum = unicodeToNum.substr(0, unicodeToNum.length-1); // Remove last comma from string

  return String.fromCharCode(unicodeToNum); 

}

// Change the inputs below to test
rot13("ABCD PBQR PNZC");
Chris Cullen
@123xylem
May 30 2016 05:22
@Masd925 so source is just one object and collection is a few objects.. makes sense.. But I wouldve thought source was an array of 1 object
Markus Kiili
@Masd925
May 30 2016 05:24
@123xylem The problem description and test cases say that there can be many properties on source.
Oleksandr Ryzhuk
@asilidanda
May 30 2016 05:26

Hi there!
`function nextInLine(arr, item) {
// Your code here

testArr.push(item);
var myVar = testArr.shift();

return myVar; // Change this line
}

// Test Setup
var testArr = [5,6,7,8,9];

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

Chris Cullen
@123xylem
May 30 2016 05:26
@Masd925 ok.. Well this is returning "last" var target =Object.keys(source);
is last a name or property?
Im getting confused with the terminology
Markus Kiili
@Masd925
May 30 2016 05:27
@123xylem It returns: [ 'last' ] which is an array of sources property keys.
Because there is only one key-value pair (property) in source: { last: "Capulet" }
Ramon Vizcarra
@ahandyman
May 30 2016 05:28
Is anyone working on profile Lookup? Let me know if you want to pair program
Chris Cullen
@123xylem
May 30 2016 05:32
@Masd925 ah so last is the key of the property in source?
Markus Kiili
@Masd925
May 30 2016 05:34
@123xylem No. Objects have properties that are key-value pairs. The collection and source are parameters of your function.
Chris Cullen
@123xylem
May 30 2016 05:35
sorry this is not sinking in quickly for me
what is capulet in source/
?
Markus Kiili
@Masd925
May 30 2016 05:36
@123xylem Property value.
Chris Cullen
@123xylem
May 30 2016 05:37
is last the property name?
Markus Kiili
@Masd925
May 30 2016 05:37
@123xylem Yes.
Chris Cullen
@123xylem
May 30 2016 05:37
ok that makes sense
so do I have to match both prop name and value or just value?
Markus Kiili
@Masd925
May 30 2016 05:39
@123xylem You loop through the property names (keys) and check that the values match.
Chris Cullen
@123xylem
May 30 2016 05:40
And then do the same for the property values (value pairs) ?
if the prop names are present
Markus Kiili
@Masd925
May 30 2016 05:42
@123xylem You should loop collection so you can test each object there. Then loop source's keys and check that the property values of the object and source are equal for all the source's keys.
@123xylem You can use simple for loops or array iterators like .filter() and .every().
Chris Cullen
@123xylem
May 30 2016 05:43
but the prop name and value are 2 different loops?
eg Object.keys(source) only gives the prop names
I dont know what gives the propvalues
Markus Kiili
@Masd925
May 30 2016 05:47
@123xylem On a loop like var keys=Object.keys(source); for (var i=0;i<keys.length;i++){...} keys[i] is a source key, and source[keys[i]] would be sources property value for the looped key.
Ramon Vizcarra
@ahandyman
May 30 2016 05:52
function lookUpProfile(firstName, prop){
// Only change code below this line

for (i = 0; i < contacts.length; i++){
    console.log(i);

    if(contacts[i].firstName === firstName && contacts[i][prop].hasOwnProperty) {        
        console.log(contacts[i][prop]);
    }
    else {
        console.log("No such contact");
    }
}
I'm trying to iterate through the array of objects. I used a for loop and checked each object with the argument. Only problem is I am printing out too much information...thoughts/suggestions?
I am using repl.it to work through the problem 'Profile Lookup'
Mimi
@mimi26
May 30 2016 05:53
@ahandyman working on the same checkpoint and really frustrated with it. I just don't feel like I know enough at this point to solve this :-(
Chris Cullen
@123xylem
May 30 2016 05:53
@Masd925 OK youve given me a lot of info, im just slow at processing it it seems :) so thanks
CamperBot
@camperbot
May 30 2016 05:53
123xylem sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 1660 | @masd925 |http://www.freecodecamp.com/masd925
Markus Kiili
@Masd925
May 30 2016 05:53
@ahandyman Your syntax for the property existence check is wrong.
Ramon Vizcarra
@ahandyman
May 30 2016 05:54
@mimi26 i felt the same way at first but if you take some time and use repl.it you can start to break it down
Mimi
@mimi26
May 30 2016 05:55
sorry, what is repl.it @ahandyman ?
Ramon Vizcarra
@ahandyman
May 30 2016 05:55
@mimi26 type a great resource try it then start with //console.log(contacts[0].firstName);
//console.log(contacts[0][prop]);
@mimi26 type it in the url
Evgeny Ladyzhenskiy
@Evgenylad
May 30 2016 05:56
1.jpg
Hi there!
I'm on the challenge 201 and can't understand why my code do not pass the test. Here it is:
Mimi
@mimi26
May 30 2016 05:57
not sure i'm understanding you @ahandyman , but I did find a few solutions online, and feel like I would never have figured it out on my own.
Markus Kiili
@Masd925
May 30 2016 05:58
@mimi26 https://repl.it is a site where you can test javascript code (better than in FCC editor)
Ramon Vizcarra
@ahandyman
May 30 2016 06:00
@mimi26 I've been using it to console.log everything it helps breakdown the problem allows you to see if you're heading in the right direction @Masd925 shared it with me and it has helped me it has also been a frustrating but a good kind because I feel like I can do more to solve the problem on my own
Mimi
@mimi26
May 30 2016 06:01
@Evgenylad I don't think you want par > 0 in order to return "Hole-in-one!"
thanks @ahandyman
CamperBot
@camperbot
May 30 2016 06:01
mimi26 sends brownie points to @ahandyman :sparkles: :thumbsup: :sparkles:
:cookie: 274 | @ahandyman |http://www.freecodecamp.com/ahandyman
Evgeny Ladyzhenskiy
@Evgenylad
May 30 2016 06:04
@mimi26
Don't pass without par > 0 also... Works in console but do not pass at FCC((
Chris Cullen
@123xylem
May 30 2016 06:04
help where art thou
CamperBot
@camperbot
May 30 2016 06:04

:point_right: algorithm where art thou [wiki]

Algorithm Where Art Thou

Problem Explanation

Write an algorithm that will take an array for the first argument and return an array with all the objects that matches all the properties and values in the Object passed as second parameter.

:pencil: read more about algorithm where art thou on the FCC Wiki

Mimi
@mimi26
May 30 2016 06:06
Here's what I got @Evgenylad . I was stuck on this for a long time, but my error was much dumber
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   {
        return "Go Home!";
      }


  // Only change code above this line
}

// Change these values to test
golfScore(4, 1);
Saurabh06
@Saurabh06
May 30 2016 06:07
Please help me how to create Interface in java-script or any substitute for same.
kirbyedy
@kirbyedy
May 30 2016 06:08
@Saurabh06 what are you trying to do ?
Evgeny Ladyzhenskiy
@Evgenylad
May 30 2016 06:10
Thank you! @mimi26 ! I missed "!" at "Hole-in-one" string.
CamperBot
@camperbot
May 30 2016 06:10
evgenylad sends brownie points to @mimi26 :sparkles: :thumbsup: :sparkles:
:cookie: 229 | @mimi26 |http://www.freecodecamp.com/mimi26
Saurabh06
@Saurabh06
May 30 2016 06:10
Hello @kirbyedy i am trying to make workflow for test-script for angularjs application using protractor. so that i will extend that interface for every module.
Mimi
@mimi26
May 30 2016 06:11
@Evgenylad I had the letter o capital instead of lower case lol
Saparbekov Azat
@Deathstroke97
May 30 2016 06:14
hi everyone
is there anyone who can help me with basic javascript?
Manoj Kumar
@kumarmj
May 30 2016 06:16
I got some problem with wikipedia viewer. What I am trying was to get list of pages than extracting 5 sentences but I got problem with ajax. Have a look: http://codepen.io/theami_mj/pen/KMKPvZ
Saparbekov Azat
@Deathstroke97
May 30 2016 06:16
myStr should have the escape sequences for backslash tab tab carriage-return new-line separated by spaces
var myStr="";
Ramon Vizcarra
@ahandyman
May 30 2016 06:18
@Masd925 in the 'profile lookup' problem is a for loop the best way to go? cleaned it up a bit to see my work. Problem I'm facing now: printing everytime a loop is run. Trying to print out once for success after all test are done OR once after all test fail... should I be thinking about iterating through the array of objects differently
for (i = 0; i < contacts.length; i++){
    console.log(i);
    if(contacts[i].firstName === firstName) {
        console.log(contacts[i][prop]);

    }
    else {
        console.log ("No such contact");
    }
}
kirbyedy
@kirbyedy
May 30 2016 06:19
@nithmanoj what does this mean ? apfrom: $("#txt").val(),
dennis-noah
@dennis-noah
May 30 2016 06:19
Hi guys, how are you? I don't get a task
Markus Kiili
@Masd925
May 30 2016 06:19
@ahandyman You can use for loop or an array iterator like .reduce(). If you use for loop, the simplest structure is two nested if clauses inside the loop block. One for firstname check and second for property existence check.
dennis-noah
@dennis-noah
May 30 2016 06:19

this is the question:

You are given a JSON object representing (a small part of) your record collection. Each album is identified by a unique id number and has several properties. Not all albums have complete information.

Write a function which takes an id, a property (prop), and a value.

For the given id in collection:

If value is non-blank (value !== "") and prop is not "tracks" then update or set the value for the prop.

If the prop is "tracks" and value is non-blank, push the value onto the end of the tracks array.

If value is blank, delete that prop.

Always return the entire collection object.

this is my approach:

// Setup
var collection = {
2548: {
album: "Slippery When Wet",
artist: "Bon Jovi",
tracks: [
"Let It Rock",
"You Give Love a Bad Name"
]
},
2468: {
album: "1999",
artist: "Prince",
tracks: [
"1999",
"Little Red Corvette"
]
},
1245: {
artist: "Robert Palmer",
tracks: [ ]
},
5439: {
album: "ABBA Gold"
}
};
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));

// Only change code below this line
function updateRecords(id, prop, value) {
if (value !== "" && prop !== "tracks"){
value = prop;
}
else if (prop == "tracks" && value !== ""){
tracks.join(value);
}
else if (value == ""){
delete collection[prop];
}

return collection;
}

// Alter values below to test your code
updateRecords(5439, "artist", "ABBA");

Markus Kiili
@Masd925
May 30 2016 06:20
@dennis-noah You are not accessing collection properly. Figure out how to access a particular record with given id first.
Manoj Kumar
@kumarmj
May 30 2016 06:22
@kirbyedy It must be that I want #txt text pasted there
dennis-noah
@dennis-noah
May 30 2016 06:22
collection[id][prop]
dennis-noah
@dennis-noah
May 30 2016 06:23
@Masd925 collection[id][prop] something like that?
Markus Kiili
@Masd925
May 30 2016 06:23
@dennis-noah Yes.
@dennis-noah Use it on the if blocks.
dennis-noah
@dennis-noah
May 30 2016 06:23
@Masd925 how?
@Masd925 ahh
Markus Kiili
@Masd925
May 30 2016 06:24
@dennis-noah Assign or push or delete depending on the case.
dennis-noah
@dennis-noah
May 30 2016 06:24
@Masd925 if (collection[id][value] !== "" && collectuin[id][prop] !== "tracks") something like that?
Markus Kiili
@Masd925
May 30 2016 06:25
@dennis-noah No, you test value and prop, and on if blocks you access collection.
dennis-noah
@dennis-noah
May 30 2016 06:25
@Masd925 sorry I am not following.. what is wrong with my if? Is this better?: if (value !== "" && prop !== "tracks"){
Markus Kiili
@Masd925
May 30 2016 06:27
@dennis-noah Yes, you test the user input, not collection property values.
dennis-noah
@dennis-noah
May 30 2016 06:28
@Masd925 Okay, that's what I already had. so where do I need to include the collection bracket otherwise? something like that?: tracks join collection[id][value];
@Masd925 tracks = collection[id][value].join; ?
Markus Kiili
@Masd925
May 30 2016 06:30
@dennis-noah On all of the cases, you access the property of the record with the given id, and either assign, push, or delete.
@dennis-noah On the first case when prop is not tracks, figure out what you assign and where.
dennis-noah
@dennis-noah
May 30 2016 06:31
@Masd925 and what about the 2nd case?
Markus Kiili
@Masd925
May 30 2016 06:31
@dennis-noah Then the property value happens to be an array and you push the value to the array.
@dennis-noah On the third case you delete the property.
dennis-noah
@dennis-noah
May 30 2016 06:32
@Masd925 Okay, thank you!!
CamperBot
@camperbot
May 30 2016 06:32
dennis-noah sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 1661 | @masd925 |http://www.freecodecamp.com/masd925
dennis-noah
@dennis-noah
May 30 2016 06:32
@Masd925 Appreciate your help and that you are trying to explain the think steps I need to take instead of just giving me the solution
Markus Kiili
@Masd925
May 30 2016 06:33
@dennis-noah You're wellcome.
dennis-noah
@dennis-noah
May 30 2016 06:34
@Masd925 collection[id][value].push(tracks); is the logic right but the syntax wrong?
KESHAV KUNDAL
@keshav929
May 30 2016 06:34
http://codepen.io/keshav929/pen/JKjBoj?editors=1100 check this guys and let me know of how is it ?
Markus Kiili
@Masd925
May 30 2016 06:35
@dennis-noah Syntax is fine, but think what to push and where.
Thieu van Dijk
@Thieuvandijk
May 30 2016 06:46
Good Morning
Is there someone out there who can help me with the use of Api's in Javascript
I want to use an api in my random quotes machine.....
KESHAV KUNDAL
@keshav929
May 30 2016 06:51
@bryan try removing that num-- from the for block , you dont have to decreement it twice , as for loop's third part does that for you once everytime ..
dennis-noah
@dennis-noah
May 30 2016 06:54

@Masd925 hey, for the first condition: if value is non blank and prop is not "Tracks" then update or set the value for the prop:

if (value !== "" && prop !== "tracks"){
collection[id][value] = prop;
}

@Masd925 is the way I am trying to update the value wrong?
Markus Kiili
@Masd925
May 30 2016 06:55
@dennis-noah prop holds the property key to access.
dennis-noah
@dennis-noah
May 30 2016 06:55
@Masd925 Thank you!!
CamperBot
@camperbot
May 30 2016 06:55
dennis-noah sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:warning: dennis-noah already gave masd925 points
dennis-noah
@dennis-noah
May 30 2016 06:56
@Masd925 Everything works now :D
Markus Kiili
@Masd925
May 30 2016 06:56
@dennis-noah Great!
Tia Holiday
@tlholiday
May 30 2016 07:04
On the "Increment a Number with JavaScript" challenge; can someone help me find the solution? SUPER confused where the "++" even goes.
Reggie
@ReggieSibley
May 30 2016 07:05
sure
Markus Kiili
@Masd925
May 30 2016 07:05
@tlholiday x=x+1 is the same as x++. It increments x by 1.
Reggie
@ReggieSibley
May 30 2016 07:05

var myVar = 87;

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

this is how it should look @tlholiday
so myVar++ is the same as writing myVar = myVar + 1
the ++ just adds the value 1 to your designated variable
Tia Holiday
@tlholiday
May 30 2016 07:07
Oh I had to get rid of the first line...damn. That makes snese now. Thanks for helping to contextualize it though. Appreciate it @ReggieSibley & @Masd925
CamperBot
@camperbot
May 30 2016 07:07
tlholiday sends brownie points to @reggiesibley and @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 1662 | @masd925 |http://www.freecodecamp.com/masd925
:cookie: 180 | @reggiesibley |http://www.freecodecamp.com/reggiesibley
Reggie
@ReggieSibley
May 30 2016 07:08
no problem!
Charles Bertrand PRISO
@valpryz
May 30 2016 07:16

please i want to activate the arrow you see on the right of this site http://accentcom.agency/ but it doesn't work please what's wrong with my code? ``` $(document).ready(function(){

var lst_liens;

function nomPage(theUrl){
var tab = theUrl.split("/") ;
var nomPage = tab.pop() ;
nomPage = tab.pop() ;
return nomPage ;
}

function chargeMenu(){
var menu = document.getElementById('menu-main-navigation') ;
var enfants = menu.children ;
var nbItems = menu.children.length ;
var lien ;

lst_liens = new Array() ;
for(var i = 0; i < nbItems; i++){
lien = enfants[i].children[0].getAttribute("href") ;
lst_liens.push(lien) ;
}
}

function nextPage(){
chargeMenu() ;
for( var i = 0; i < lst_liens.length; i++ ){
if ( nomPage(window.location.href) == nomPage(lst_liens[i]) ) {
alert(lst_liens[(i+1)%lst_liens.length]) ;
}
}
}

function prevPage(){
chargeMenu() ;
for( var i = 0; i < lst_liens.length; i++ ){
if ( nomPage(window.location.href) == nomPage(lst_liens[i]) ) {
alert(lst_liens[(i-1)%lst_liens.length]) ;
}
}
}
});
```

Jack Lyons
@JackEdwardLyons
May 30 2016 07:16
hey guys anyone wanna pair up for the roman numerals bonfire challenge?
Shusil Banjade
@shusil123
May 30 2016 07:22

function truncateString(str, num) {
  // Clear out that junk in your trunk
  if (num>3) {
    str = str.slice(0, num-3) + "...";
  }

  else {
    str = str.slice (0, num) + "...";
  }

  return str;
}

truncateString("A-tisket a-tasket A green and yellow basket", 11);
Truncate the string. What's wrong with this??

The 3rd and 4th challenges are quite strange:

truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length) should return "A-tisket a-tasket A green and yellow basket".
truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length + 2) should return "A-tisket a-tasket A green and yellow basket".

Joseph Sepp Lin
@Joseph-Sepp-Lin
May 30 2016 07:24
hello, everyone! can anyone give me an example of how to use the escape sequences?
um, definitely not like this...
var myStr = "\\backslash \ttab \ttab \rcarriage-return \nnew-line"
kirbyedy
@kirbyedy
May 30 2016 07:27
@Joseph-Sepp-Lin did you check the table on the left in the instructions ?
Joseph Sepp Lin
@Joseph-Sepp-Lin
May 30 2016 07:33
@kirbyedy oh, ive got it now.
Charles Bertrand PRISO
@valpryz
May 30 2016 07:56
@all nobody to help me?
PatrickMonks
@PatrickMonks
May 30 2016 07:56
Anyone complete the golf code challenge in javascript?
not sure what is being asked
Charles Bertrand PRISO
@valpryz
May 30 2016 07:57

my problem please i want to activate the arrow you see on the right of this site http://accentcom.agency/ but it doesn't work please what's wrong with my code? ```
$(document).ready(function(){

var lst_liens;

function nomPage(theUrl){
var tab = theUrl.split("/") ;
var nomPage = tab.pop() ;
nomPage = tab.pop() ;
return nomPage ;
}

function chargeMenu(){
var menu = document.getElementById('menu-main-navigation') ;
var enfants = menu.children ;
var nbItems = menu.children.length ;
var lien ;

lst_liens = new Array() ;
for(var i = 0; i < nbItems; i++){
lien = enfants[i].children[0].getAttribute("href") ;
lst_liens.push(lien) ;
}
}

function nextPage(){
chargeMenu() ;
for( var i = 0; i < lst_liens.length; i++ ){
if ( nomPage(window.location.href) == nomPage(lst_liens[i]) ) {
alert(lst_liens[(i+1)%lst_liens.length]) ;
}
}
}

function prevPage(){
chargeMenu() ;
for( var i = 0; i < lst_liens.length; i++ ){
if ( nomPage(window.location.href) == nomPage(lst_liens[i]) ) {
alert(lst_liens[(i-1)%lst_liens.length]) ;
}
}
}
});
```

Cong Rui
@guchangchu
May 30 2016 07:58
@PatrickMonks

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!";
                }


  // Only change code above this line
}

// Change these values to test
golfScore(5, 4);
arych
@arych
May 30 2016 07:59
hello
Evgeny Ladyzhenskiy
@Evgenylad
May 30 2016 08:04
2.jpg
Now I'm stuck at 208. Same thing. My code works but can't pass the test.
Rob
@safuya
May 30 2016 08:05
@Evgenylad Try without the \" in there
@Evgenylad You only need the text inside the quotes :)
Evgeny Ladyzhenskiy
@Evgenylad
May 30 2016 08:06
@Safuya That case I'have the text without quotes and it also do not work(((
Thanks @Safuya. After your recommendation now it works without quotes. Magic!
CamperBot
@camperbot
May 30 2016 08:08
evgenylad sends brownie points to @safuya :sparkles: :thumbsup: :sparkles:
:cookie: 230 | @safuya |http://www.freecodecamp.com/safuya
Jack Lyons
@JackEdwardLyons
May 30 2016 08:19
hey guuys, could someone please point me in the right direction with my code?
function convertToRoman(num) {
  var result = "";
  var numerals = [ 
    { value: 1, numeral: "I" },
    { value: 4, numeral: "IV" },
    { value: 5, numeral: "V" },
    { value: 9, numeral: "IX" },
    { value: 10, numeral: "X"},
    { value: 50, numeral: "L" },
    { value: 100, numeral: "C"},
    { value: 500, numeral: "D"},
    { value: 1000, numeral: "M" },
  ];

  numerals.forEach(function(item) {
   for (num; num >= item.value; num -= item.value) {
      result += item.numeral;
    }
  });

  return result;
}

convertToRoman(5);
it returns IIIII :(
Loïc Touzard
@LoicTouzard
May 30 2016 08:28
convertToRoman is called with parameter 5.
You arrive in the function and forEach numerals.
First iteration of forEach you have the { value: 1, numeral: "I" } item.
arriving in the for loop (which loops while 5 in greater than item.value which value is 1), so this condition is true you go into the loop
5 becomes 5-1 => 4
and result becomes "I"
next iteration : 4 is still greater than the first item which value is 1
So 4 becomes 4-1 => 3
And result becoms "II"
And so on until num = 0
@JackEdwardLyons see answer above
@JackEdwardLyons Instead of start trying with the lowest value, try with the greatest. So you can loop over numerals beginning by the end instead of the forEach. Or fill numerals beginning with the greatest value
Ankur sharma
@ankur1163
May 30 2016 08:32
can someone explain me
this exercise
Everything Be True
Check if the predicate (second argument) is truthy on all elements of a collection (first argument).
what is truthy?
Blauelf
@Blauelf
May 30 2016 08:33
Truthy is everything that Boolean(value) returns true for. These are the values that trigger if, for example.
Loïc Touzard
@LoicTouzard
May 30 2016 08:34
hiehuehue
@hiehuehue
May 30 2016 08:34
Can someone explain BOOHOO what are we suppossed to return?
Blauelf
@Blauelf
May 30 2016 08:35
@hiehuehue Return true if the input is a boolean primitive, else false. I think the easiest way is to either test for one of the two possible values of boolean, or using the typeof operator.
Ankur sharma
@ankur1163
May 30 2016 08:35
ok @Blauelf and @LoicTouzard
Loïc Touzard
@LoicTouzard
May 30 2016 08:35
null as boolean is false @hiehuehue
@hiehuehue But i guess your function shall return null as it's the given parameter
Blauelf
@Blauelf
May 30 2016 08:37
@LoicTouzard There one is not meant to coerce to boolean, but test whether input is a boolean primitive. So both true and false should make you return true, but for 1, null, or "foo", it should return false.
Loïc Touzard
@LoicTouzard
May 30 2016 08:38
ohh right
@Blauelf Sorry I didn't read the subject ^^'
hiehuehue
@hiehuehue
May 30 2016 08:39
are only true and false only boolean primitives @Blauelf
i meant to ask for what values of x typeof x is boolean
Blauelf
@Blauelf
May 30 2016 08:42
boolean primitives are only true and false, as undefined is of type "undefined" (I think SQL uses it as a third value of boolean)
So we have two values we can easily test for (use === for comparison without coercion), or we have the typeof operator.
hiehuehue
@hiehuehue
May 30 2016 08:43
thanks @Blauelf
CamperBot
@camperbot
May 30 2016 08:43
hiehuehue sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star2: 1901 | @blauelf |http://www.freecodecamp.com/blauelf
Ankur sharma
@ankur1163
May 30 2016 08:45
everything be true exercise
this code is wrong

function truthCheck(collection, pre) {
  // Is everyone being true?

  if (collection.hasOwnProperty('pre'))
    {
      if(collection.pre)
      {
        return true;
      }
      else{
        return false;
      }
    }

  //return pre;
}

truthCheck([{"user": "Tinky-Winky", "sex": "male"}, {"user": "Dipsy", "sex": "male"}, {"user": "Laa-Laa", "sex": "female"}, {"user": "Po", "sex": "female"}], "sex");
i am checking hasownproperty , if it is true , i am checking collection.pre
Markus Kiili
@Masd925
May 30 2016 08:48
@ankur1163 The dot notation only works if the property key string is a valid JS identifier (for example "12" and "lives left" are not) and you write the key after the dot: var cat={clothes:"pants", "lives left":3}; cat.clothes; //returns "pants". Bracket notation works with keys that can be arbitrary strings cat["lives left"]; //returns 3, variables var key="clothes"; cat[key]; //returns "pants", or expressions cat["lives"+" "+"left"]; //returns 3.
So .pre is wrong here. It looks for property key "pre".
Blauelf
@Blauelf
May 30 2016 08:49
@ankur1163 collection is an array, you need to iterate that (either with a for-loop, or some implicit looping like every)
Ankur sharma
@ankur1163
May 30 2016 08:51
ahh ok. got it thanks @Masd925 and @Blauelf
CamperBot
@camperbot
May 30 2016 08:51
ankur1163 sends brownie points to @masd925 and @blauelf :sparkles: :thumbsup: :sparkles:
:star2: 1902 | @blauelf |http://www.freecodecamp.com/blauelf
:star2: 1663 | @masd925 |http://www.freecodecamp.com/masd925
Revitalizm
@Revitalizm
May 30 2016 09:07
Hi guys, can you please advise on why the following statement is wrong?
[code] var myStr = "backslash \ tab \t tab \t carriage-return \r new-line \n"; [code]
Loïc Touzard
@LoicTouzard
May 30 2016 09:11
What do you mean ?
Ankur sharma
@ankur1163
May 30 2016 09:12
can you tell me why it is returning true instead of false

function truthCheck(collection, pre) {
  // Is everyone being true?

 if (typeof pre === 'string') {
        for (var i = 0; i < collection.length; i++) {
            if (!collection[i].hasOwnProperty(pre)) {
                return false;
            }
        }
    } else if (typeof pre === 'object') {
        var propertyList = Object.getOwnPropertyNames(pre);

        for (var k = 0; k < propertyList.length; k++) {
            for (var j = 0; k < collection.length; j++) {
                if (!collection[j].hasOwnProperty(propertyList[k]) || collection[j][propertyList[k]] != pre[propertyList[k]]) {
                    return false;
                }
            }
        }
    }
    return true;
  //return pre;
}

truthCheck([{"user": "Tinky-Winky", "sex": "male", "age": 0}, {"user": "Dipsy", "sex": "male", "age": 3}, {"user": "Laa-Laa", "sex": "female", "age": 5}, {"user": "Po", "sex": "female", "age": 4}], "age");
Revitalizm
@Revitalizm
May 30 2016 09:12
I insert this in the training and receive this answer "myStr should have the escape sequences for backslash tab tab carriage-return new-line separated by spaces"
UtkarshShukla7
@UtkarshShukla7
May 30 2016 09:12
@Revitalizm
var myStr = "\\ \t  \t \r \n";
Revitalizm
@Revitalizm
May 30 2016 09:14
still saying I'm wrong..
blob
Loïc Touzard
@LoicTouzard
May 30 2016 09:15
var myStr = "\\ \t \t \r \n";
wasn't there an extra space betweens the tabs ?
UtkarshShukla7
@UtkarshShukla7
May 30 2016 09:16
@Revitalizm check out the spacings
eswestra
@eswestra
May 30 2016 09:16

function updateRecords(id, prop, value) {
var album = collection[id];
if(value !== "" && prop != 'tracks'){
album[prop] = value;
}
if(prop == "tracks" && value !== ""){
album[tracks].push(value);
}
else{
delete album[prop];
}

return collection;
}

what is worng with this code
Revitalizm
@Revitalizm
May 30 2016 09:16
yep! I had a spare space.. Thanks a lot guys :)
Loïc Touzard
@LoicTouzard
May 30 2016 09:16
@Revitalizm you're welcome
@eswestra What is collection ?
Markus Kiili
@Masd925
May 30 2016 09:18
@eswestra Put quotes on album["tracks"] <-
eswestra
@eswestra
May 30 2016 09:19
wow so stupid thanks @Masd925
CamperBot
@camperbot
May 30 2016 09:19
eswestra sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 1664 | @masd925 |http://www.freecodecamp.com/masd925
eswestra
@eswestra
May 30 2016 09:20
actually, i'm still get thihs error now:
After updateRecords(5439, "artist", "ABBA"), artist should be "ABBA"
@Masd925

var collectionCopy = JSON.parse(JSON.stringify(collection));

// Only change code below this line
function updateRecords(id, prop, value) {
var album = collection[id];
if(value !== "" && prop != 'tracks'){
album[prop] = value;
}
if(prop == "tracks" && value !== ""){
album.tracks.push(value);
}
else{
delete album[prop];
}

return collection;
}

Markus Kiili
@Masd925
May 30 2016 09:21
@eswestra Try else if on the second instead of if.
Leow Wei Xiang
@boyboi86
May 30 2016 09:21
hi all, please kindly assist. My code doesn't seem to run. Neither is the console.log showing anything.
eswestra
@eswestra
May 30 2016 09:22
@Masd925 perfect thanks again
CamperBot
@camperbot
May 30 2016 09:22
eswestra sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:warning: eswestra already gave masd925 points
help someone?
CamperBot
@camperbot
May 30 2016 09:23
no wiki entry for: someone
Keone Martin
@Athaman
May 30 2016 09:25
@boyboi86 when did it stop working? Which part in particular isn't working?
Leow Wei Xiang
@boyboi86
May 30 2016 09:27
@Athaman eh, basically I tried to run AJAX, the error is mainly with the final function when I try to trigger $each. but they won't recognize player().
Thompson Ike
@hubhubace
May 30 2016 09:27
hi guys
please help
i get error
js
var newArr = [];
for(var i=0; i<arr.length; ++i) {           
  var maximum = -Infinity;                  
  for(var j=0; j<arr[i].length; ++j)        
    if(arr[i][j] > maximum)                 
      maximum = arr[i][j];                  
  newArr.push(maximum);                     
}
largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Leow Wei Xiang
@boyboi86
May 30 2016 09:28
@Athaman so I tried to include the entire code into Ajax success{}. it recognize but did nothing. This was the problem.
Thompson Ike
@hubhubace
May 30 2016 09:28
says arr is not defined
Leow Wei Xiang
@boyboi86
May 30 2016 09:28
console.log return nothing
Keone Martin
@Athaman
May 30 2016 09:28
@hubhubace the variable is defined as newArr
change your i<arr.length to i < newArr.length and same for the j
herochua
@herochua
May 30 2016 09:29

Hi all, I'm at the weather app but I keep getting a 404 error when I use $getJSON anyone able to help?
"""
navigator.geolocation.getCurrentPosition(showLocation);

function showLocation(pos) {
var x = pos.coords.latitude;
var y = pos.coords.longitude;
console.log(x, y);
$.getJSON("api.openweathermap.org/data/2.5/weather?lat=" + x + "&lon=" + y + "&APPID=cf3cd2f768fbe813c3e549fc5b66fc8f", function(JSON) {
console.log(JSON);
})
};
"""

Leow Wei Xiang
@boyboi86
May 30 2016 09:29
help?
CamperBot
@camperbot
May 30 2016 09:29

CamperBot

Hi, I'm CamperBot! I can help you in this chatroom :smile:

Basic Commands:

  • find TOPIC find all entries about topic. e.g. find js
  • wiki TOPIC show contents of topic page
  • thanks @username send brownie points to another user
  • about @username shows info on that user
  • Algorithm BONFIRENAME info on a Algorithm

meet CamperBot in FreeCodeCamp/camperbotPlayground

:pencil: read more about camperbot on the FCC Wiki

herochua
@herochua
May 30 2016 09:29

Hi all, I'm at the weather app but I keep getting a 404 error when I use $getJSON anyone able to help?
'''
navigator.geolocation.getCurrentPosition(showLocation);

function showLocation(pos) {
var x = pos.coords.latitude;
var y = pos.coords.longitude;
console.log(x, y);
$.getJSON("api.openweathermap.org/data/2.5/weather?lat=" + x + "&lon=" + y + "&APPID=cf3cd2f768fbe813c3e549fc5b66fc8f", function(JSON) {
console.log(JSON);
})
};
'''

Hi all, I'm at the weather app but I keep getting a 404 error when I use $getJSON anyone able to help? Sorry for formatting fail
navigator.geolocation.getCurrentPosition(showLocation);

function showLocation(pos) {
  var x = pos.coords.latitude;
  var y = pos.coords.longitude;
  console.log(x, y);
  $.getJSON("api.openweathermap.org/data/2.5/weather?lat=" + x + "&lon=" + y + "&APPID=cf3cd2f768fbe813c3e549fc5b66fc8f", function(JSON) {
    console.log(JSON);
  })
};
Keone Martin
@Athaman
May 30 2016 09:30
@boyboi86 sorry, I'm not really good with ajax and stuff. maybe try asking in helpfrontend instead? they have a more active group on this sort of question.
Coy Sanders
@coymeetsworld
May 30 2016 09:31
you need to specify the protocol in your api call @herochua, put in http:// at the beginning
Thompson Ike
@hubhubace
May 30 2016 09:31
@Athaman yes thanks
CamperBot
@camperbot
May 30 2016 09:31
hubhubace sends brownie points to @athaman :sparkles: :thumbsup: :sparkles:
:cookie: 437 | @athaman |http://www.freecodecamp.com/athaman
Leow Wei Xiang
@boyboi86
May 30 2016 09:31
@Athaman thanks anyways
CamperBot
@camperbot
May 30 2016 09:31
boyboi86 sends brownie points to @athaman :sparkles: :thumbsup: :sparkles:
:cookie: 438 | @athaman |http://www.freecodecamp.com/athaman
Keone Martin
@Athaman
May 30 2016 09:31
No worries :)
herochua
@herochua
May 30 2016 09:32
@coymeetsworld Thanks! But now I'm getting an ERR_CONNECTION_REFUSED error
CamperBot
@camperbot
May 30 2016 09:32
herochua sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:cookie: 988 | @coymeetsworld |http://www.freecodecamp.com/coymeetsworld
Coy Sanders
@coymeetsworld
May 30 2016 09:34
can you post your codepen @herochua ?
Coy Sanders
@coymeetsworld
May 30 2016 09:34
not https, http
Loïc Touzard
@LoicTouzard
May 30 2016 09:35
Coy Sanders