These are chat archives for FreeCodeCamp/Help

17th
Aug 2015
Marie Pelletier
@Marie000
Aug 17 2015 00:00
thanks coira! I think you saved me a few hours of struggling on my own.
oops. I mean thanks @Coira
CamperBot
@camperbot
Aug 17 2015 00:00
marie000 sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
Coira Ellison
@Coira
Aug 17 2015 00:00
np, it's doubly frustrating if the site isn't working
CamperBot
@camperbot
Aug 17 2015 00:00
:star: 157 | @coira | http://www.freecodecamp.com/coira
Felipe Rodrigues
@feliperdius
Aug 17 2015 00:01
to check if the array is empty in javascript just use: if(array.length > 0)
Coira Ellison
@Coira
Aug 17 2015 00:01
i can't wait until fcc implement sending real brownies!
Marie Pelletier
@Marie000
Aug 17 2015 00:02
you would deserve some :-)
Coira Ellison
@Coira
Aug 17 2015 00:02
i think we all would for dealing with javascripts "quirks" :p
ok, it's 1am here, i'd better go, night all
Shaun Hutchins
@shaun10
Aug 17 2015 00:07
hello all
has anyone successfully configured settings for running free code camp locally?
I got everything installed but having problems with local sign in
Cordoba84
@fcordoba84
Aug 17 2015 00:16
hi to u guys /gals is 31 to old to learn to code?
thanks @feliperdius @erratadei
CamperBot
@camperbot
Aug 17 2015 00:17
fcordoba84 sends brownie points to @feliperdius and @erratadei :sparkles: :thumbsup: :sparkles:
:star: 33 | @feliperdius | http://www.freecodecamp.com/feliperdius
Marc Davenport
@oneate7
Aug 17 2015 00:18
@fcordoba84 I sure hope not... I'm almost 35 ;-)
Chris LaFave
@chrislafave
Aug 17 2015 00:18
@shaun10 Do you mean testing your JS? Myself, I paste my code into http://fiddlesalad.com/javascript/ and the results show up live (if you have results going to "console.log" too)
Cordoba84
@fcordoba84
Aug 17 2015 00:18
jajaja
Chris LaFave
@chrislafave
Aug 17 2015 00:21
BTW, I'm most likely waiting until Monday to get anything done on fCC. It's still pretty screwed up (but I know they're diligently working to get it up to speed asap).
Shaun Hutchins
@shaun10
Aug 17 2015 00:22
@chrislafave no I mean logging in remotely
when running server locally
I have FCC running on my lapto
just having problems with the .env config and logging in
Chris LaFave
@chrislafave
Aug 17 2015 00:23
Oh okay. I'm not at that level yet.
Shaun Hutchins
@shaun10
Aug 17 2015 00:24
no worries
Rome wasn’t built in a day
gabazine
@gabazine
Aug 17 2015 00:32
wow so much lag today
Steven Young
@ShelbyGT
Aug 17 2015 00:33
hmmm gives green check marks but wont advance to the next lesson
Jesse
@jctm30
Aug 17 2015 00:38
@ShelbyGT it takes couple seconds even maybe one minute
@ShelbyGT i just complete the lesson, click submit, and wait
Steven Young
@ShelbyGT
Aug 17 2015 00:38
nvm its the "upgrade-lag"
gabazine
@gabazine
Aug 17 2015 00:38
This message was deleted
Chris LaFave
@chrislafave
Aug 17 2015 00:39
Someone please reassure me that the challenge map will be restored to reflect our actual progress. I was at "Object Oriented and Functional Programming" but my map is a f'ing mess now.
Steven Young
@ShelbyGT
Aug 17 2015 00:41
new content @chrislafave
gabazine
@gabazine
Aug 17 2015 00:42
or just redo everything lol, should be a pro at previous stuff by now :)
Cordoba84
@fcordoba84
Aug 17 2015 00:42
@chrislafave i think they did mention all progress may be lost
Chris LaFave
@chrislafave
Aug 17 2015 00:44
They did not say that. They said that if you do work during a couple-hour window, it could be lost. They've been assuring us that our work is safe. But the map isn't instilling confidence in that.
I love FCC but I'll still be mad if they fuck off a month's work.
gabazine
@gabazine
Aug 17 2015 00:45
@chrislafave what couple-hour windows?
inkcode
@inkcode
Aug 17 2015 00:45
@Coira thanks
CamperBot
@camperbot
Aug 17 2015 00:45
aviral235 sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
inkcode
@inkcode
Aug 17 2015 00:45
you.made.my.day.
CamperBot
@camperbot
Aug 17 2015 00:45
:star: 158 | @coira | http://www.freecodecamp.com/coira
inkcode
@inkcode
Aug 17 2015 00:45
what solution you gave upon tweaking
worked perfectly
:D
THANKS thanks thanks if the nearest dunkin or krispy kremes does online orders can i send you donuts :D
Max
@MaxRubyDev
Aug 17 2015 01:01
Hi, I'm on Waypoint: Use a CSS Class to Style an Element -- Is there supposed to be a text editor window displaying there? I can't see it, and also nothing happens when I click on the green "Go to my next challenge" button. I'm using an iPad. Is that the problem?
Oh @ShelbyGT it looks like we may be having the same problem (?)
Max
@MaxRubyDev
Aug 17 2015 01:08
Ok, reading through the most recent comments above it appears FCC is broken. Hopefully it's only temporary!
Steven Young
@ShelbyGT
Aug 17 2015 01:08
@MaxRubyDev NO,,,its the "upgrade-lag"
click the button and just wait a few
vbobjee
@vbobjee
Aug 17 2015 01:13

I am working on Bonfire:Make a person. If the 6 methods are the only ways to communicate with the constructor, can i still have local variables inside the constructor?

If I create a setFirstName method, I need a variable to store the the firstname so the getFirstName method could return that variable when called. But that local variable will be created for every instance. Is that ok in terms of memory management? Can somebody please explain?

Max
@MaxRubyDev
Aug 17 2015 01:20
Ok thanks @ShelbyGT but I keep getting the error message "opps! Something went wrong. Please try again later" (and yes, it's spelled "opps" there).
CamperBot
@camperbot
Aug 17 2015 01:20
maxrubydev sends brownie points to @shelbygt :sparkles: :thumbsup: :sparkles:
:star: 95 | @shelbygt | http://www.freecodecamp.com/shelbygt
Steven Young
@ShelbyGT
Aug 17 2015 01:26
I just ran into the first lesson that says im done but doesnt save in the progression map
lol,,I have done it like three times
Jason McKenna
@Jason-McKenna
Aug 17 2015 01:29
Hey guys... any of you having trouble with yer completed waypoints and stuff no longer displaying as completed? Is it just part of the bugs going on right now during this update? I had a whole ton of em done - all the way up to the first bonfire - and now none of the JS stuff is showing as completed etc. Hmm...
Joris Labie
@labiej
Aug 17 2015 01:30
@Jason-McKenna its kinda buggy atm. During the update some stuff broke
The data isn't lost though
So it should be back by tomorrow
Jason McKenna
@Jason-McKenna
Aug 17 2015 01:31
okay cool ;) as long as it pops back up at some point. I'll go back and hit up some of the new content in the meantime. Thx bud!
Steven Young
@ShelbyGT
Aug 17 2015 01:31
@Jason-McKenna thats new content and no more codeacadamy
Joris Labie
@labiej
Aug 17 2015 01:31
Oops, misread a little
@Jason-McKenna you should be all set to do the first bonfires. But some new content is in there.
Its expanded and should be even better now
Jason McKenna
@Jason-McKenna
Aug 17 2015 01:32
cool! I'll check it out... I guess the more practice - the better anyhow. ;) I'll wait a day or so tho - just so I know what is new and what isn't kinda confusing at the moment.
Tim
@timkellogg
Aug 17 2015 01:33
Anyone have idea how to handle audio? I'm stuck on the Simon game. Web Audio API looks incredibly difficult to set up.
Max
@MaxRubyDev
Aug 17 2015 01:34
Ok folks it did eventually start working for me. Good luck.
Rex Schrader
@SaintPeter
Aug 17 2015 01:37
@timkellogg Audio it trivial to set up. You just need an <audio> element. With jQuery it's as simple as $('.audioClass').play();
Tim
@timkellogg
Aug 17 2015 01:38
Yeah, but it won't play twice in a row in chrome. It only plays once.
Rex Schrader
@SaintPeter
Aug 17 2015 01:39
@timkellogg Humm, I didn't have any trouble with it on my Pomodoro timer. It won't play a second time if the clip is not done playing, I think.
Tim
@timkellogg
Aug 17 2015 01:39
It fill fire on the "click" event but I won't know how to simulate a computer clicking it twice
Rex Schrader
@SaintPeter
Aug 17 2015 01:40
I'm betting you can set up an event to fire when the audio completes
Tim
@timkellogg
Aug 17 2015 01:40
How do I check for that? This is one time where I wish JavaScript wasn't async!
Rex Schrader
@SaintPeter
Aug 17 2015 01:41
@timkellog Yeah, you can set up something to fire on the 'ended' event. I'm thinking it would look something like this:
$('.audioControl').on('ended', audioEndedCallbackFunction);
@timkellogg Here Is what I imagine: Have an array with a list of sounds to play. Have the 'ended' callback automatically check the array to see what is next on the list and trigger it to play, maybe coupled with the animation.
Tim
@timkellogg
Aug 17 2015 01:42
Great, thanks - I will try this approach. I hadn't thought of checking for that.
Rex Schrader
@SaintPeter
Aug 17 2015 01:42
@timkellogg np
Tim
@timkellogg
Aug 17 2015 01:42
Ok, I did set up a queue of sounds. Thanks again!
Rex Schrader
@SaintPeter
Aug 17 2015 01:42
@timkellogg I still need to go back and write my own :D
@timkellogg BTW, for Zipline specific help: https://gitter.im/FreeCodeCamp/HelpZiplines
Tim
@timkellogg
Aug 17 2015 01:44
Thanks for the link - I didn't see that. Still getting use to gitter .
Ginna
@Desiderata33
Aug 17 2015 01:45
Hi can someone please help me with Bonfire: Check for Palindromes
Rex Schrader
@SaintPeter
Aug 17 2015 01:45
@timkellogg Yeah - there is a list of channels on the Wiki
wiki official free
CamperBot
@camperbot
Aug 17 2015 01:46

:point_right: official free code camp chat rooms [wiki]

The following are our official chat rooms.

Please note that all chat rooms listed here are publicly accessible and indexed by search engines, so only share email addresses or other sensitive information in private messages.

Chat Room Description
FreeCodeCamp our main chat room - hang out and chat about life and learning to code
Help get help with our Waypoint challenges from your fellow campers
HelpZiplines get help with our Zipline challenges from your fellow campers
HelpBonfires get help with our Bonfire challenges from your fellow campers
HelpBasejumps get help with our Basejump challenges from your fellow campers
NonprofitProjects get help with your Nonprofit Projects from your fellow campers
CodingJobs chat about the process of getting a coding job, such as portfolios, networking, and interviewing
YouCanDoThis learning to code is hard - share your feelings and get moral support here
News chat about stories trending on Camper News
LetsPair find fellow campers to pair program with using Screen Hero
TeamViewer find fellow campers who use Linux and pair program using Team Viewer
PairProgrammingWomen this women-only chat room helps women pair program with other women if they so desire
40PlusDevs campers who are over 40+ years old can chat here if they so desire
LiveCoding chat about streaming webdev and gamedev on Twitch.tv and LiveCoding.tv

:pencil: read more about official free code camp chat rooms on the FCC Wiki

Rex Schrader
@SaintPeter
Aug 17 2015 01:46
@Desiderata33 Sure
dan
@jedeye726
Aug 17 2015 02:27
hey can someone gimme a hand with one of these way point lessons?
Chad Kreutzer
@ChadKreutzer
Aug 17 2015 02:29
@jedeye726 Perhaps. which one?
dan
@jedeye726
Aug 17 2015 02:29
Nest your text field in a form element. Add the action="/submit-cat-photo" attribute to this form element.
Chad Kreutzer
@ChadKreutzer
Aug 17 2015 02:32
What are you having issues with?
dan
@jedeye726
Aug 17 2015 02:34
nesting the text field into the form element
<form action="/submit-cat-photo input type="text" placeholder="cat photo URL"</form>
Chad Kreutzer
@ChadKreutzer
Aug 17 2015 02:35
okay. lets see your code.
ah. there it is.
you are missing a ">" after ...URL"
oh wait nvm
try closing after subit-cat-photo.
then enclosing input type....URL" in brackets
Deepanshu Kaushik
@daksh844
Aug 17 2015 02:38
Hi Guys, can you pleae help me out - all my progress has vanished in the jQuery section which I just finished. Is this due to the mogration being done?
and moreover do I have to start all over again if nothing happens
dan
@jedeye726
Aug 17 2015 02:39
ok
Chad Kreutzer
@ChadKreutzer
Aug 17 2015 02:39
<form action="/submit-cat-photo">
<input type="text" placeholder="cat photo URL">
</form>
@daksh844 I'm pretty sure that's the problem, and I don't know.
Mohamed A. Farouk
@captainmoha
Aug 17 2015 02:45
This message was deleted
@SaintPeter Could you please take a look at my code for "where art thou ?" ?
Rex Schrader
@SaintPeter
Aug 17 2015 02:46
@captainmoha Sure, lay it on me
dan
@jedeye726
Aug 17 2015 02:46
thanks man that was it
Chad Kreutzer
@ChadKreutzer
Aug 17 2015 02:46
No Prob
Mohamed A. Farouk
@captainmoha
Aug 17 2015 02:47
function where(collection, source) {
    // What's in a name?
    var arr = [];

    for (var i = 0; i < collection.length; i++) {
        var currentObj = collection[i];
        var keys = Object.keys(currentObj);
        for (var j = 0; j < keys.length; j++) {
            var val = currentObj[keys[j]];
            if (val === source[keys[j]]) {
                arr.push(currentObj);
            }
        }
    }
    return arr;
}
Rex Schrader
@SaintPeter
Aug 17 2015 02:48
@captainmoha ok, taking a look - does it work?
Mohamed A. Farouk
@captainmoha
Aug 17 2015 02:48
I think it's working but is there a simpler way ?
Chad Kreutzer
@ChadKreutzer
Aug 17 2015 02:49
This was my solution:
function where(collection, source) {
    var arr = [];
    // What's in a name?

    for (i = 0; i < collection.length; i++) {
        for (var prop in collection[i]){
            if (collection[i][prop] === source[Object.keys(source)]) {
                arr.push(collection[i]);
            }
        }
    }
    return arr;
}
Rex Schrader
@SaintPeter
Aug 17 2015 02:49
That's about the size of it.
@captainmoha What @ChadKreutzer did, with the for..in loop make the code a bit cleaner
Chad Kreutzer
@ChadKreutzer
Aug 17 2015 02:50
although since playing with functional programming, I've been going back trying to redo them as functional programs.
Rex Schrader
@SaintPeter
Aug 17 2015 02:50
@ChadKreutzer Yeah, it's good practice.
Mohamed A. Farouk
@captainmoha
Aug 17 2015 02:51
@SaintPeter @ChadKreutzer Thanks :smile:
CamperBot
@camperbot
Aug 17 2015 02:51
captainmoha sends brownie points to @saintpeter and @chadkreutzer :sparkles: :thumbsup: :sparkles:
api offline
:star: 155 | @chadkreutzer | http://www.freecodecamp.com/chadkreutzer
Rex Schrader
@SaintPeter
Aug 17 2015 02:51
@captainmoha I would say what you have there is a solid first start. After you complete the functional programming waypoints, go back and give the Bonfires another try - it's a great way to cement the FP learning
Chad Kreutzer
@ChadKreutzer
Aug 17 2015 02:51
in fact I'm gonna go play with that one right now. I'll be back with the results.
Mohamed A. Farouk
@captainmoha
Aug 17 2015 02:52
@SaintPeter I'm looking forward to starting FP I really like the compactness and cleanliness of its code.
Rex Schrader
@SaintPeter
Aug 17 2015 02:53
@captainmoha Yeah, then you'll love FP
Mohamed A. Farouk
@captainmoha
Aug 17 2015 02:53
@SaintPeter Awesome :smile:
Joris Labie
@labiej
Aug 17 2015 02:58
Question, is the code from solved waypoints saved in any way for us to check back? Or are there plans related to this?
Rex Schrader
@SaintPeter
Aug 17 2015 03:02
@labiej Your Bonfire code is saved and used to be posted to your profile. Currently it is hidden. I am not aware of plans to save the waypoint code otherwise.
Joris Labie
@labiej
Aug 17 2015 03:03
Hmm I'll try to think of a proposal for us as a camper to access our own code
Rex Schrader
@SaintPeter
Aug 17 2015 03:03
I think it's a well understood request
and will probably become a priority as soon as everyone starts complaining about it :D
Joris Labie
@labiej
Aug 17 2015 03:04
What if whenever camperbot gives a summary there's a link to e.g. freecodecamp.com/solved/bonfire-xx
This link shows your own solutions if they exist
Rex Schrader
@SaintPeter
Aug 17 2015 03:05
Sure, that'd be one way. I was thinking something like freecodecamp.com/<profilename>/bonfires for the old bonfire list
Joris Labie
@labiej
Aug 17 2015 03:06
Could work as well. I think the important part is to keep it private. I could see myself looking up answers if I was stuck and nobody was available to help.
Rex Schrader
@SaintPeter
Aug 17 2015 03:07
I think that's why they removed them from everyone's profiles
Although I know some folks used to to "check" their code - see alternate methods of doing it, or just sanity check.
Personally, when I'm helping folks on the /Help channel, I was refering to my own solutions daily
Joris Labie
@labiej
Aug 17 2015 03:08
Don't we all?
Robert
@rc242
Aug 17 2015 03:09
Nope. Some of my solutions are junk.
Joris Labie
@labiej
Aug 17 2015 03:10
I fix those whenever I see them :-)
Rex Schrader
@SaintPeter
Aug 17 2015 03:10
@rc242 Well, if you can't be a good example you might as well serve as a horrible warning :D
Robert
@rc242
Aug 17 2015 03:11
@SaintPeter I'm not sure how to take that. I'm both honored, but insulted at the same time. I think I'll go back to my twitch api.. which I've been trying to perfect for way too long.
Chad Kreutzer
@ChadKreutzer
Aug 17 2015 03:12
I work through everything in visual studio then copy/paste it into the bonfire. that way I have it all on my local machine.
Joris Labie
@labiej
Aug 17 2015 03:12
ah twitch, the one that learned me to use hasOwnProperty more often
Rafael J. Rodriguez
@Rafase282
Aug 17 2015 03:12
I use repl.it and my text editor
and push it to my repo
Joris Labie
@labiej
Aug 17 2015 03:12
<--- lazy af
Rafael J. Rodriguez
@Rafase282
Aug 17 2015 03:12
that way even if my computer goes nuts I still have it ;-)
Rex Schrader
@SaintPeter
Aug 17 2015 03:12
@rc242 Haha - all in good fun. ;) I know what you mean, though, some of my early code makes me wince. I think it's important to embrace our past failings. We need to move away from the myth of the genius programmers. We are human, we are failable, we can learn and improve.
Rafael J. Rodriguez
@Rafase282
Aug 17 2015 03:13
Just make sure to hide the bad code from teh begining form your github when applying for jobs ;-)
Robert
@rc242
Aug 17 2015 03:14
pull everything, make new acct, push everything
Joris Labie
@labiej
Aug 17 2015 03:18
Parenting done right: https://youtu.be/y8mzDvpKzfY
Robert
@rc242
Aug 17 2015 03:18
mah god, this inconsistent width.
Joris Labie
@labiej
Aug 17 2015 03:18
And with that I'm gonna lay my head down
Rockpile
@rock-pile
Aug 17 2015 03:22
i feel like with some of these bonfires its too easy to google and just get the answer from stackoverflow...
Rex Schrader
@SaintPeter
Aug 17 2015 03:23
Takes a bit of self dicipline not to do that, I guess
Robert
@rc242
Aug 17 2015 03:24
@camgoodman Going to stackoverflow isn't really the problem. copying the code is the problem.
Chad Kreutzer
@ChadKreutzer
Aug 17 2015 03:31
@camgoodman Yeah, I try to avoid going there unless I'm really stuck. I find that http://www.w3schools.com/jsref/ has been a bit easier to understand than the mozilla docs that are linked from the lessons.
Rex Schrader
@SaintPeter
Aug 17 2015 03:32
@ChadKreutzer I find the w3schools to be way too light on details. I prefer the MDN docs - you definitely need to learn how to read those.
Robert
@rc242
Aug 17 2015 03:33
@SaintPeter :+1:
Chad Kreutzer
@ChadKreutzer
Aug 17 2015 03:34
@SaintPeter I usually read em both. but sometimes the way that the w2schools put's it just clicks better for my mind and then I go back to the MDN doc and it makes sense.
Tommy Izen
@TommyIzen
Aug 17 2015 03:42
Why am I getting unexpected token?
function findLongestWord(str) 
{
  str = str.split();
  for (str[0] < str[i]; str[i++])
    {
      return str.length;
    }

}

findLongestWord('The quick brown fox jumped over the lazy dog');
Robert
@rc242
Aug 17 2015 03:42
@TommyIzen Your for loop.
it only has two "arguments"
Tommy Izen
@TommyIzen
Aug 17 2015 03:43
oh
thanks
Now I get i is not defined
```
Bill
@kirah1314
Aug 17 2015 03:45
@TommyIzen you might be missing var i = 0; in the for loop
Tommy Izen
@TommyIzen
Aug 17 2015 03:45
function findLongestWord(str) 
{
  str = str.split();
  for (str = str[0]; str < str[i]; str[i++])
    {
      return str.length;
    }

}

findLongestWord('The quick brown fox jumped over the lazy dog');
oh okay that helps
thanks
@kirah1314
Tommy Izen
@TommyIzen
Aug 17 2015 03:50
function findLongestWord(str) 
{
  str = str.split();
  for (var i = 0; str < str[i]; str[i++])
    {
      return str.length;
    }

}

findLongestWord('The quick brown fox jumped over the lazy dog');
undefined
:(
this must be the dumbest code posted here all day
Robert
@rc242
Aug 17 2015 03:53
@TommyIzen You have a conditional that doesn't really make a lot of sense. It's checking if str is less than str[i].
Tommy Izen
@TommyIzen
Aug 17 2015 03:53
yeah, I'm guessing at how to compare the split array indexes
Kurt Johnson
@pompan129
Aug 17 2015 03:54
str is now an array after split. it always has the same length. reference the elements in the array. str[i].length. for(var = =0; i < str.length; i++)
Robert
@rc242
Aug 17 2015 03:54
@TommyIzen Well, it doesn't make sense in the application of your code.
Tommy Izen
@TommyIzen
Aug 17 2015 03:54
so I can loop to the biggest word
Robert
@rc242
Aug 17 2015 03:54
:sigh:
Marc Davenport
@oneate7
Aug 17 2015 03:54
@TommyIzen - You have the right idea, but move the str[i] to the inside of the loop, and just refer to i in the loop declaration.
Robert
@rc242
Aug 17 2015 03:54
@TommyIzen Sorry, not directed to you. You're looping sorta correctly.
Kurt Johnson
@pompan129
Aug 17 2015 03:54
sorry (var i = 0; i < str.length; i++))
Tommy Izen
@TommyIzen
Aug 17 2015 03:54
lol okay
i was like what'd I do??
thanks @oneate7 and @pompan129
CamperBot
@camperbot
Aug 17 2015 03:55
tommyizen sends brownie points to @oneate7 and @pompan129 :sparkles: :thumbsup: :sparkles:
:star: 145 | @oneate7 | http://www.freecodecamp.com/oneate7
Robert
@rc242
Aug 17 2015 03:57
@TommyIzen In the for loop, the conditional is when you want to end the for-loop. When you use that with strings, you're checking equality of the strings.
Tommy Izen
@TommyIzen
Aug 17 2015 03:58
okay thanks @rc242
CamperBot
@camperbot
Aug 17 2015 03:58
tommyizen sends brownie points to @rc242 :sparkles: :thumbsup: :sparkles:
:star: 149 | @rc242 | http://www.freecodecamp.com/rc242
Robert
@rc242
Aug 17 2015 03:58
@TommyIzen For example, "Foo" > "Bar will return true because "B" comes before "F" if you were to alphabetize the strings.
...of course, i think that may be more with the unicodes rather than alphabetized. just so happens that it works out for the English alphabet at least.
Jeremy "Ibi-Wan" Kent "...obi"
@ibiwan
Aug 17 2015 04:03
I think each individual alphabet is alphabetized. No guaranteed results if you mix and match
Tommy Izen
@TommyIzen
Aug 17 2015 04:05
Well, it's looping now. Only it's just looping to the first index and stopping.
function findLongestWord(str) 
{
  str = str.split(" ");
  for (var i = 0; i < str.length; i++)
    {
      console.log(str[i]);
      return str[i].length;
    }

}

findLongestWord('The quick brown fox jumped over the lazy dog');
console.log() prints out The
Robert
@rc242
Aug 17 2015 04:07
@TommyIzen When you use "return", you're immediately leaving your function. Perhaps you want to visit every element to see if they're the longest prior to leaving the function.
Tommy Izen
@TommyIzen
Aug 17 2015 04:08
haha
sick burn
yes you're right
thank you :)
for real, thank you everyone
Jeremy "Ibi-Wan" Kent "...obi"
@ibiwan
Aug 17 2015 04:11
sometimes the sickest burns are simple truth
Tommy Izen
@TommyIzen
Aug 17 2015 04:15
spoken like a true master of the force
Kolloom
@Kolloom
Aug 17 2015 04:17
i have zero idea on how to start the first zipline
Tommy Izen
@TommyIzen
Aug 17 2015 04:21
Well now it's looping correctly, and I'm using .length on i in the console log
function findLongestWord(str) 
{
  str = str.split(" ");
  for (var i = 0; i < str.length; i++)
    {
      console.log(str[i].length);
    }
  console.log(str);
}

findLongestWord('The quick brown fox jumped over the lazy dog');
just need to figure out how to make it stop on the largest array index
Jeremy "Ibi-Wan" Kent "...obi"
@ibiwan
Aug 17 2015 04:24
don't stop... keep going because you won't know which is the largest until you've checked all of them
just keep track of the longest as you go
Bill
@kirah1314
Aug 17 2015 04:28
@TommyIzen consider using an if statement to check for the longest word
your current codes just loop through str and it doesn't check for anything
Rockpile
@rock-pile
Aug 17 2015 04:46
@TommyIzen what would happen if you used another var to keep track of the largest word length?
what would that look like
Hans van Riet
@hansinla
Aug 17 2015 04:59
@Kolloom What is the first zipline again?
Kolloom
@Kolloom
Aug 17 2015 05:28
personal profolio
@hansinla
Bree Phillips
@Breezydayz
Aug 17 2015 05:29
Hello all! Need help, please! New coder here, am working on adding a border to an img. I have two class attributes in the CSS style, I can only get one or the other to affect the img. How do I list them to get both to work. Have tried many ways, none working. I have had a lot of strange bugs tonight; is this another?
Kolloom
@Kolloom
Aug 17 2015 05:30
the code the code show me the code!
wiki format
CamperBot
@camperbot
Aug 17 2015 05:31

:point_right: code formatting [wiki]

Inline code

This an inline `<paste code here>` code formatting with a single backtick(`) at start and end around the code.

Code Block

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

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

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

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

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

Bree Phillips
@Breezydayz
Aug 17 2015 05:31
OK, give me a sec.
<img class="thick-green-border"class="smaller-image" src="https://bit.ly/fcc-relaxing-cat"> Have tried with and without the second "class", neither works
Kolloom
@Kolloom
Aug 17 2015 05:32
you shouldn't seperate class attribute like that
do class='attribute1 attribute2' (seperate by space)
single quote or double quote doesn't matters here
Hans van Riet
@hansinla
Aug 17 2015 05:33
<img class="thick-green-border smaller-image" src="https://bit.ly/fcc-relaxing-cat">
Bree Phillips
@Breezydayz
Aug 17 2015 05:34
Thnks, but as stated, I tried that, but will try again. I think I separated the two attributes with ""!
YAYYYYY!! Only been trying for 2 hours!
Thanks again! Got it now!
Hans van Riet
@hansinla
Aug 17 2015 05:36
@Breezydayz Don’t worry, this syntax will become second nature to you very soon.
Bree Phillips
@Breezydayz
Aug 17 2015 05:36
I hope so...
George Tsoukatos
@Gts0uk
Aug 17 2015 05:43
JAVASCRIPT WAYPOINTS DON'T WORK!!!!!
JAVASCRIPT WAYPOINTS DON'T WORK!!!!!
Bree Phillips
@Breezydayz
Aug 17 2015 05:49
My challenges will not progress and I keep losing the one I just did! Okay for now, learning by repetition not to separate the attributes! would eventually like to move on however...thanks again for the clarification @Kolloom
CamperBot
@camperbot
Aug 17 2015 05:49
breezydayz sends brownie points to @kolloom :sparkles: :thumbsup: :sparkles:
Chad Kreutzer
@ChadKreutzer
Aug 17 2015 06:10
@SaintPeter bam! Where Art Thou? functional version
function where(collection, source) {
    var arr = collection.filter(function (obj) {
        return obj[Object.keys(source)] === source[Object.keys(source)];
    });
    return arr;
}
Chad Kreutzer
@ChadKreutzer
Aug 17 2015 06:17
Even more streamlined:
function where(collection, source) {
    return collection.filter(function (obj) {
        return obj[Object.keys(source)] === source[Object.keys(source)];
    });
}
Chad Kreutzer
@ChadKreutzer
Aug 17 2015 06:23
it's not a lot shorter, but it isn't looping. Although I'm not 100% sure using the source inside the filter is supposed to be part of the functional paradigm...?
Mohamed A. Farouk
@captainmoha
Aug 17 2015 06:53
@ChadKreutzer Nice!
Chad Kreutzer
@ChadKreutzer
Aug 17 2015 06:57
@captainmoha thanks. I've been trying to get my mind wrapped around the whole functional thing by re doing previous bonfires.
CamperBot
@camperbot
Aug 17 2015 06:57
chadkreutzer sends brownie points to @captainmoha :sparkles: :thumbsup: :sparkles:
:star: 107 | @captainmoha | http://www.freecodecamp.com/captainmoha
Matthew Barber
@Honno
Aug 17 2015 07:23
How can I make jquery completely wait until my getjson request is done?
got a function which is called that does .getJSON, want that to finish, then return a value
Vlad Zamfirescu
@vzamfirescu
Aug 17 2015 08:55
@Honno You could use a promises library to first wait for a response and then move on with your code
@Honno Also, you could wrap your request in an AJAX call and write the next step in the .success() callback
Aleksandr Ignatyev
@vigntom2708
Aug 17 2015 09:04
@Honno You need synchronous requests. Use $.ajax and set async setting to false. http://api.jquery.com/jquery.ajax/
Matthew Barber
@Honno
Aug 17 2015 09:13
Hey @vzamfirescu & @vigntom2708, in the end I just called the next function which used the data recieved in the callback
@vigntom2708 async false is decrapated in chrome now, so thought it wasn't best practice
Harry Gill
@mygnu
Aug 17 2015 10:17
Hi all, this might be just a silly question, does the number in the top right corner means anything apart form the number of challenges you have completed?
Aleksandar B.
@aleksandar-b
Aug 17 2015 10:29
Does anyone have a problem of unlocking profile via Github link?
Roy
@CruelCoin
Aug 17 2015 10:41
@mygnu Also how many points you get for submitting articles here: http://www.freecodecamp.com/news
@mygnu Not sure if it also shows points earned through brownie points
Prashanth
@dgprashanth
Aug 17 2015 10:52
Guys, I need some help
I'm on this challenge : Waypoint: Target the Parent of an Element Using jQuery
And my background color for the left-well is showing up as red, but the challenge does not get completed regardless
Leander Van Reeth
@reneald
Aug 17 2015 10:53
@dgprashanth yeah I'm on the same challenge and have the same problem
Prashanth
@dgprashanth
Aug 17 2015 10:54
Oh damn
Harry Gill
@mygnu
Aug 17 2015 10:56
thanks @CruelCoin
CamperBot
@camperbot
Aug 17 2015 10:56
mygnu sends brownie points to @cruelcoin :sparkles: :thumbsup: :sparkles:
:star: 149 | @cruelcoin | http://www.freecodecamp.com/cruelcoin
Chocobowings
@chocobowings
Aug 17 2015 10:57
@reneald I can help you with that
Prashanth
@dgprashanth
Aug 17 2015 10:57
@reneald I figured out the problem!
Chocobowings
@chocobowings
Aug 17 2015 10:57
@dgprashanth Awesome !
Leander Van Reeth
@reneald
Aug 17 2015 10:58
I haven't figured it out yet...
Prashanth
@dgprashanth
Aug 17 2015 10:58
@reneald The tag says "left-well has to be changed"
@reneald whereas, it should say "target1" has to be changed
I believe this is a bug that should say target1, but instead says left-well
so when you change it to target1, challenge will be completed.
Leander Van Reeth
@reneald
Aug 17 2015 10:59
my code is $("#target1").parent().css("background-color", "red)";
Prashanth
@dgprashanth
Aug 17 2015 10:59
Yes, now that should work. Same worked for me
Check the quotes near the end of the statement friend
It says "....."red)";
Leander Van Reeth
@reneald
Aug 17 2015 11:00
wow, thanks @dgprashanth !
CamperBot
@camperbot
Aug 17 2015 11:00
reneald sends brownie points to @dgprashanth :sparkles: :thumbsup: :sparkles:
:star: 160 | @dgprashanth | http://www.freecodecamp.com/dgprashanth
Leander Van Reeth
@reneald
Aug 17 2015 11:00
devil's in the details :-)
Prashanth
@dgprashanth
Aug 17 2015 11:00
Haha yeah it surely is the case with this programming stuff :)
Okay, let's move on ahead @reneald :D
Leander Van Reeth
@reneald
Aug 17 2015 11:01
haha, I think I'm going to grab a lunch first @dgprashanth
Prashanth
@dgprashanth
Aug 17 2015 11:02
@reneald Haha +1
:+1:
ronaldnicol89
@ronaldnicol89
Aug 17 2015 12:11
i need help with .pop()
Vlad Zamfirescu
@vzamfirescu
Aug 17 2015 12:19
@ronaldnicol89 What do you need help with regarding .pop()?
Sudeepto
@Sudeepto
Aug 17 2015 12:38
@SaintPeter Hey I want you to check my code for an exercise. PM me when you are online :smile:
Mufaddal B
@invinciblemuffi
Aug 17 2015 12:42
On this step: waypoint-give-your-javascript-slot-machine-some-stylish-images, it gives me this error, Use the provided code three times. One for each slot.
This is d code that i have written: $(S('.slot')0).html('<img src=" '+ images[slotOne-1] +' ">');
$(S('.slot')1).html('<img src=" '+ images[slotTwo-2] +' ">');
$(S('.slot')symphonycms/symphony-2#2024).html('<img src=" '+ images[slotThree-3] +' ">');
$(S('.slot')0).html('<img src="' + images[slotOne-1] + '">');
$(S('.slot')1).html('<img src="' + images[slotTwo-1] + '">');
$(S('.slot')2).html('<img src="' + images[slotThree-1] + '">');
still shows the same error: Use the provided code three times.
Matthew Barber
@Honno
Aug 17 2015 13:07

how could I make a bootstrap btn stay focused when clicked, using jquery?
e.g.

$(".btn").click(function() {
  $(this).focus();
});

Doesn't work tho

flota113
@flota113
Aug 17 2015 13:39
@Honno focused or activated?
ahh..I looked at the time, probably You solved it alredy :D
Ben McMahon
@benmcmahon100
Aug 17 2015 13:54
@invinciblemuffi you should have square brackets around those numbers
rayner-villalba-coderoad-com
@rayner-villalba-coderoad-com
Aug 17 2015 14:10
@Honno I think your browser is not able to respond quickly enough, so you need to add a small delay between when the live function is entered something like this:
$(".btn").click(function() { setTimeout(function () { $(this).focus(); }, 100); });
CamperBot
@camperbot
Aug 17 2015 14:11
:bulb: to format code use backticks! ``` more info
Giorgio Giuliani
@gigiuliani
Aug 17 2015 14:12
HEllo Campers what happened to the list of challenges??
How do we have to move?
Does anybody knows whether we will receive a mail or something regarding the new course format?
Lucas Vorsteveld
@Lucashv
Aug 17 2015 14:13
@gigiuliani I don't know about getting mail but they added some new lessons and re arranged some stuff
Mohamed A. Farouk
@captainmoha
Aug 17 2015 14:14
@gigiuliani https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/August-2015-Improvements You can read about the new stuff here.
Joris Labie
@labiej
Aug 17 2015 14:17
They added a lot of stuff. Made 'in-house' courses for JS etc.
And I'm sure a mail will follow once the smoke has cleared
Giorgio Giuliani
@gigiuliani
Aug 17 2015 14:20
ok thanks anyway!
Omar Negron
@onegronm
Aug 17 2015 15:12
Anyone having issues with the slot machine problem? The first item is never completed "Use the provided code three times. One for each slot" even though I have. http://www.freecodecamp.com/challenges/waypoint-give-your-javascript-slot-machine-some-stylish-images
Javier
@jalonso087
Aug 17 2015 15:21
Anyone else having problems with the waypoint: Use Hex Code to Color Elements Blue?
its not recognizing the hex value i'm putting in
Jearson Gomez
@jayGorio
Aug 17 2015 15:33
Good day. Anyone tried to solved Bonfire:check for palindromes?Im really having hard time getting the right answer
function palindrome(str) {
var cstr = str.toLowerCase().replace(/[^a-zA-Z0-9]+/g,'');
return true;
}
palindrome("eye");
Can somebody suggest what is missing here?
Joris Labie
@labiej
Aug 17 2015 15:36
You aren't checking if it's a palindrome
You always return true.
Jearson Gomez
@jayGorio
Aug 17 2015 15:37
a yeah i forgot to include if condition. Ill be modifying it and let you know the result
Jesse
@azor-ahai
Aug 17 2015 16:24
<li>
                                <a href="#" target="_blank" class="btn btn-default btn-lg "><i class="fa fa-github fa-fw"></i> <span class="network-name">Github</span></a>
                            </li>
could someone help in in figuring out why the icon is not showing up on the button
Steven Young
@ShelbyGT
Aug 17 2015 16:29
@gigiuliani we had an upgrade yesterday,,we are no longer linked to codeacadamy for like doing the jquery also some of your holes are new content,,,you dont HAVE to redue what you have already done thru codeacadmy but its not bad to go back and refresh
Rex Schrader
@SaintPeter
Aug 17 2015 16:36
@ChadKreutzer Haha, awesome! I need to be able to grant titles: 'FP Master'
codecampgirl
@codecampgirl
Aug 17 2015 16:38
@jalonso087 worked for me. Can you be more specific as to what you typed in?
Javier
@jalonso087
Aug 17 2015 16:40
<style>
  body {
    background-color: #0000ff;
  }
</style>
@codecampgirl
i dont think im missing anything
@codecampgirl got it. it wanted caps on the Fs
codecampgirl
@codecampgirl
Aug 17 2015 16:42
@jalonso087 use uppercase letters for the waypoint and it will work.
Javier
@jalonso087
Aug 17 2015 16:42
thank you @codecampgirl
CamperBot
@camperbot
Aug 17 2015 16:42
jalonso087 sends brownie points to @codecampgirl :sparkles: :thumbsup: :sparkles:
codecampgirl
@codecampgirl
Aug 17 2015 16:43
@codecampgirl Great, @jalonso087 . I had the same issue. Lowercase letters are perfectly fine, though. Just not for the codecamp waypoints.
Luis Felipe López G.
@luishendrix92
Aug 17 2015 16:47
Uppercase, lowercase, shouldn't matter. Open an issue on Github so they change it soon :P
Davis
@ajdavis56
Aug 17 2015 16:49
could someone explain to me what it means to convert a character to it's corresponding HTML entity?
Bill
@kirah1314
Aug 17 2015 16:53
@ajdavis56 that bonfire could use more explanation but basically change & to &amp;
Davis
@ajdavis56
Aug 17 2015 16:57
@kirah1314 I'm pretty sure i did that but it keeps failing the tests.
Bill
@kirah1314
Aug 17 2015 16:57
ok, care to share your codes?
I can help take a look
Davis
@ajdavis56
Aug 17 2015 16:58
thanks.
well here's the jist of what i'm trying to accomplish:
myStr.replace(/&/g,"&(amp|AMP|#x00026|#38);" );
i'm assuming this is the way to go. please correct me if i'm wrong.
Bill
@kirah1314
Aug 17 2015 16:59
you just need to replace() &, &amp;
Davis
@ajdavis56
Aug 17 2015 16:59
so basiaclly replace & with any one of the entities?
now i feel so stupid.
Bill
@kirah1314
Aug 17 2015 17:00
yeah just one of them, they're all different entities :thumbsup:
Davis
@ajdavis56
Aug 17 2015 17:01
thanks!
Bill
@kirah1314
Aug 17 2015 17:02
@ajdavis56 you're welcome, keep it up and no worries! That bonfire could use more explanation, I didn't even understand what it was asking for the first time too
I just saw change & to &
Davis
@ajdavis56
Aug 17 2015 17:03
I see. thanks again. :)
is there a cached version of this website that I can work on?
Rex Schrader
@SaintPeter
Aug 17 2015 17:24
@kirah1314 Note that you can always make modifications to the bonfire text and submit a pull request - the whole site is on GitHub
Bill
@kirah1314
Aug 17 2015 17:25
@SaintPeter that's great to hear, I'll check it out thanks!
CamperBot
@camperbot
Aug 17 2015 17:25
kirah1314 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 193 | @saintpeter | http://www.freecodecamp.com/saintpeter
Jerry Robles
@jerryrobles
Aug 17 2015 18:00
can anyone help me out with the pairwise bonfire?
CamperBot
@camperbot
Aug 17 2015 18:00
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Jerry Robles
@jerryrobles
Aug 17 2015 18:01
I've been stuck on it for several days, and I could use some direction
Matt Yamamoto
@MattYamamoto
Aug 17 2015 18:01
what are you stuck on?
Jerry Robles
@jerryrobles
Aug 17 2015 18:02
trying to reduce it down to the array of indexes
Matt Yamamoto
@MattYamamoto
Aug 17 2015 18:02
let's see what you have so far.
Jerry Robles
@jerryrobles
Aug 17 2015 18:03
function pairwise(arr, arg) {
  var newArr = [];

  var test = function(prev, curr, index, array){
    if(prev + curr=== arg){
      return index;
    }
  };

  return Array.prototype.reduce(test, 0);

}

pairwise([1,4,2,3,0,5], 7);
sorry, it didn't all paste for some reason, there it goes now
John Nieves
@karn09
Aug 17 2015 18:08
bonfire pairwise
CamperBot
@camperbot
Aug 17 2015 18:08

:fire:Bonfire: Pairwise :link:

function pairwise(arr, arg) {
  return arg;
}

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

Return the sum of all indices of elements of 'arr' that can be paired with one other element to form a sum that equals the value in the second argument 'arg'. If multiple sums are possible, return the smallest sum. Once an element has been used, it cannot be reused to pair with another.

more info:  bf details | bf links | hint

softeg
@softeg
Aug 17 2015 18:08

PLZ i need help to pass all tests in bonfire us postal with regex

function telephoneCheck(str) {
  // Good luck!
  re = /([(]\d{3}[)]|\d{3})[-\s]?\d{3}[-\s]?\d{4}|1[\s-]?[(]?\d{3}[)]?[-\s]?\d{3}[-\s]?\d{4}/g;
  return re.test(str);
}


telephoneCheck("555-555-5555");

this test 2 (757) 622-7382 don't pass ?
how i can foce to begin only with 1 ? when i use ^ and $ the regex don't work

CamperBot
@camperbot
Aug 17 2015 18:08
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Matt Yamamoto
@MattYamamoto
Aug 17 2015 18:10
@jerryrobles I'm not sure that reduce is what you want. for example, in the array you have, 4 and 3 sum to 7; however, they are not sequential indicies. I believe that reduce traverses the array sequentially.
Jerry Robles
@jerryrobles
Aug 17 2015 18:12
I probably need to have an inner and outer for loop to traverse them separately to compare all the indices
Matt Yamamoto
@MattYamamoto
Aug 17 2015 18:13
I think something along those lines is what you're looking for. Hmm, I remember that when I solved this one I didn't use reduce... although I'm noticing that that is where you are pointed by the help links. I did help somebody a while back solve this one with a reduce function, so it is possible. I'll have to give it a go that way too.
Cordoba84
@fcordoba84
Aug 17 2015 18:18
hi i need some help with a challenge
Try giving your form, which now has the id attribute of cat-photo-form, a green background.

<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

<style>
.red-text {
color: red;
}
#cat-photo-element { background-color: green; }>

h2 {
font-family: Lobster, Monospace;
}

p {
font-size: 16px;
font-family: Monospace;
}

.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
border-radius: 50%;
}

.smaller-image {
width: 100px;
}
.gray-background {
background-color: gray
}
</style>

<h2 class="red-text">CatPhotoApp</h2>

<p>Click here for <a href="#">cat photos</a>.</p>

<a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>

<div class="gray-background">
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
</div>

<form action="/submit-cat-photo" id="cat-photo-form">
<label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>

michaelmenace
@michaelmenace
Aug 17 2015 18:23
@fcordoba84 try adding within the style tags

cat-photo-form {background-color: green;}

Cordoba84
@fcordoba84
Aug 17 2015 18:25
missing this
michaelmenace
@michaelmenace
Aug 17 2015 18:25
remove the > after your curly bracket
Cordoba84
@fcordoba84
Aug 17 2015 18:25
Your form element should have the background-color of green.
michaelmenace
@michaelmenace
Aug 17 2015 18:26
or directly target the form
Cordoba84
@fcordoba84
Aug 17 2015 18:26
did it no result @michaelmenace @michaelmenace
how
michaelmenace
@michaelmenace
Aug 17 2015 18:26
form {property: value ;}
Cordoba84
@fcordoba84
Aug 17 2015 18:26
on style?
Jerry Robles
@jerryrobles
Aug 17 2015 18:27
@MattYamamoto I checked the hint, it helped a lot, I'm getting pretty familiar with the use of reduce, but I don't think it can be applied to the original array. There has to be an additional array derived from that which only contains index values
michaelmenace
@michaelmenace
Aug 17 2015 18:27
Inside the style tags
Cordoba84
@fcordoba84
Aug 17 2015 18:28
nope property highlighted
Kolloom
@Kolloom
Aug 17 2015 18:29
@softeg could you explain your regex?
michaelmenace
@michaelmenace
Aug 17 2015 18:31
@fcordoba84 you put cat-photo-element not cat-photo-form
the id of the form is cat-photo-form
softeg
@softeg
Aug 17 2015 18:31
@Kolloom I need with this regex to validate telephone number US
Matt Yamamoto
@MattYamamoto
Aug 17 2015 18:32
@jerryrobles sorry, gitter just crashed on me...weird. Anyway, that is how I origially soved it (I think), I had an array to hold the indicies and then I summed those at the end. But I think I used 2 loops to accomplish that. I just did it using reduce though, and it works fine. I have a loop inside the reduce function, so maybe try that?
I think the tricky part is figuring out how to avoid counting an index twice.
Cordoba84
@fcordoba84
Aug 17 2015 18:33
dammit ur right no wonder lol thanks @michaelmenace
CamperBot
@camperbot
Aug 17 2015 18:33
fcordoba84 sends brownie points to @michaelmenace :sparkles: :thumbsup: :sparkles:
Jerry Robles
@jerryrobles
Aug 17 2015 18:35
@MattYamamoto yeah i think when comparing to values, you have to check to see if either index is already in the new array, and you also have to make sure you're not comparing a value to itself
the hint uses like 4 conditionals in that if statement, I'm sure it can be structured other ways too
Matt Yamamoto
@MattYamamoto
Aug 17 2015 18:36
yup... does that give you some direction to go in?
Jerry Robles
@jerryrobles
Aug 17 2015 18:36
yes it does, thanks a lot!
I think once I get that array locked down, the reduce should be pretty straight forward
Matt Yamamoto
@MattYamamoto
Aug 17 2015 18:37
I think so too. good luck!
Anna Presnyakova
@chiffenok
Aug 17 2015 18:46
hi I have an question with bonfire Sum All Numbers in a Range
bonfire Sum All Numbers in a Range
CamperBot
@camperbot
Aug 17 2015 18:46

:fire:Bonfire: Sum All Numbers in a Range :link:

function sumAll(arr) {
  return(1);
}

sumAll([1, 4]);

We'll pass you an array of two numbers. Return the sum of those two numbers and all numbers between them.

more info:  bf details | bf links | hint

Kolloom
@Kolloom
Aug 17 2015 18:46
@soteg why use | operators?
gipsi
@gipsi
Aug 17 2015 18:47
Can anyone help me understand why my waypoint challenge map has gone back 1? (I had just got past loopy loops on codecademy and was about to do dragonslayer game!) All progress on my profile seems to be lost. I can see waypoints have changed.. do I just have to start again?
Bogdan Uifalean
@bogdanuifalean
Aug 17 2015 18:47
Already asked this in the main chat, but does anybody know when we will get back our solutions for the bonfires? I know they will no longer be visible to others, but we should still be able to see them.
Anna Presnyakova
@chiffenok
Aug 17 2015 18:47
fcc suggest to use reduce function, but I can get why do we need it and what it actually does
Matt Yamamoto
@MattYamamoto
Aug 17 2015 18:51
@chiffenok did you read the mdn page on reduce?
Kolloom
@Kolloom
Aug 17 2015 18:52
there's a 1 after the | operator, not sure if you want that @softeg
Anna Presnyakova
@chiffenok
Aug 17 2015 18:52
@MattYamamoto yeap
Matt Yamamoto
@MattYamamoto
Aug 17 2015 18:52
okay, had to ask first.
Bill
@kirah1314
Aug 17 2015 18:52
@gipsi I think you should probably just move forward. The waypoint challenges are to prepare for future challenges, if you got it then the knowledge is more useful than the 1 extra point on your profile. FCC is trying to fix all the issues now but it might take a few days to fix everything
softeg
@softeg
Aug 17 2015 18:54
@Kolloom i use the | to use Or i want to select number like 555-555-5555 or 1 555-555-5555
Bill
@kirah1314
Aug 17 2015 18:54
@gipsi you can always go back and claim that 1 point after FCC fix all the issues :)
Bogdan Uifalean
@bogdanuifalean
Aug 17 2015 18:55
@chiffenok if you don't mind watching a short video, this explains reduce really well https://www.youtube.com/watch?v=Wl98eZpkp-c
@chiffenok also the other videos in the series are really good
gipsi
@gipsi
Aug 17 2015 18:58
@kira1314 ok thanks, I mean't to say back to day one like I just started ;)
CamperBot
@camperbot
Aug 17 2015 18:58
gipsi sends brownie points to @kira1314 :sparkles: :thumbsup: :sparkles:
Matt Yamamoto
@MattYamamoto
Aug 17 2015 18:58
@chiffenok basically it goes through an array one value at a time and applies the callback function you provide.... at the same time it keep track of a running value that is returned by each callback (that is the previous value). but I agree with @bogdanuifalean , wathcing it in action is probably the best way to get a handle on it.
Anna Presnyakova
@chiffenok
Aug 17 2015 18:59
@MattYamamoto @bogdanuifalean thank you
CamperBot
@camperbot
Aug 17 2015 18:59
chiffenok sends brownie points to @mattyamamoto and @bogdanuifalean :sparkles: :thumbsup: :sparkles:
:star: 191 | @bogdanuifalean | http://www.freecodecamp.com/bogdanuifalean
:star: 182 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Kolloom
@Kolloom
Aug 17 2015 19:00
I wouldn't use | here since 555-555-5555 appears in both end @softeg
dormouss
@dormouss
Aug 17 2015 19:02
For the bonfire Where Art Thou, I think I missed a javascript lesson. Are there any FCC lessons that related to this particular challenge?
Kolloom
@Kolloom
Aug 17 2015 19:04
also your regex validiate phone number begins with -1 as true @softeg
take a look at the tests case at the left bottom of the page
dormouss
@dormouss
Aug 17 2015 19:06
I'm not grokking the key pairs part, I think.
Matt Yamamoto
@MattYamamoto
Aug 17 2015 19:08
@dormouss just like an array value could be obtained by index number, ex: arr1, so can an object's property's be obtained by key value using dot notation: obj.key
claytongentry
@claytongentry
Aug 17 2015 19:08
Anybody pretty solid with Node MVC structure?
flota113
@flota113
Aug 17 2015 19:09
or bracket notation obj[key]
claytongentry
@claytongentry
Aug 17 2015 19:09
I have a high-level question.
Matt Yamamoto
@MattYamamoto
Aug 17 2015 19:10
@dormouss whoops, that should have read arr[1]
Feners4
@Feners4
Aug 17 2015 19:10
how can i get this to get an number and count ten numbers from that one for ex:
if input is 1, output will be "2 then 3 then 4 then 5 then 6 then 7 then 8 then 9 then 10 then 11"
function countUp(start) {
    for(var i = start; i <= 10; i++){
        var answer_array = "";
        var answer = i + " then";
        answer_array += answer;
        console.log(answer_array);
    }
michaelmenace
@michaelmenace
Aug 17 2015 19:11
In Waypoint: Target a Specific Child of an Element Using jQuery why do you target the class=target rather than the parent class=well?
flota113
@flota113
Aug 17 2015 19:11
for(var i =start; i <= start+10; i++)
notice i <= start+10 ;)
Feners4
@Feners4
Aug 17 2015 19:12
@flota113 ahh! silly me lol
thanks
flota113
@flota113
Aug 17 2015 19:12
no problem ;)
Feners4
@Feners4
Aug 17 2015 19:13
@flota113 btw i havent been able to get my result all in one line..
how could I do this?
flota113
@flota113
Aug 17 2015 19:13
console.log will always produce a line per call
Kolloom
@Kolloom
Aug 17 2015 19:13
@Feners4 add all the string at once and output it
flota113
@flota113
Aug 17 2015 19:13
do you want a tip or straight forward solution?
So @Kolloom already gave You a tip :D
Feners4
@Feners4
Aug 17 2015 19:14
@Kolloom this is what I want to do..
flota113
@flota113
Aug 17 2015 19:15
put console.log out of loop ;)
Feners4
@Feners4
Aug 17 2015 19:16
@flota113 jmmm i cant get this to work
Matt Yamamoto
@MattYamamoto
Aug 17 2015 19:16
@Feners4 , and you have your answer_array defined inside the for loop...so every time the loop runs it is starting empty
Feners4
@Feners4
Aug 17 2015 19:16
@MattYamamoto aahhh yeah
let me fix that
dormouss
@dormouss
Aug 17 2015 19:17
thanks @MattYamamoto
CamperBot
@camperbot
Aug 17 2015 19:17
dormouss sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 183 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Matt Yamamoto
@MattYamamoto
Aug 17 2015 19:17
you're welcome
Mohamed A. Farouk
@captainmoha
Aug 17 2015 19:18
bonfire destroyer
CamperBot
@camperbot
Aug 17 2015 19:18
Sorry, can't find a bonfire called destroyer. [ Check the map? ]
Mohamed A. Farouk
@captainmoha
Aug 17 2015 19:18
bonfire seek and destroy
CamperBot
@camperbot
Aug 17 2015 19:18

:fire:Bonfire: Seek and Destroy :link:

function destroyer(arr) {
  // Remove all the values
  return arr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);

You will be provided with an initial array (the first argument in the destroyer function), followed by one or more arguments. Remove all elements from the initial array that are of the same value as these arguments.

more info:  bf details | bf links | hint

Mohamed A. Farouk
@captainmoha
Aug 17 2015 19:18
bf details
CamperBot
@camperbot
Aug 17 2015 19:18

:fire:Bonfire: Seek and Destroy :link:

function destroyer(arr) {
  // Remove all the values
  return arr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
You will be provided with an initial array (the first argument in the destroyer function), followed by one or more arguments. Remove all elements from the initial array that are of the same value as these arguments.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
Mohamed A. Farouk
@captainmoha
Aug 17 2015 19:19
This message was deleted
CamperBot
@camperbot
Aug 17 2015 19:19
:bulb: to format code use backticks! ``` more info
Mohamed A. Farouk
@captainmoha
Aug 17 2015 19:20
I just solved this like this
/*  You will be provided with an initial array (the first argument in the destroyer function),
 followed by one or more arguments. Remove all elements from the initial array that are of the same value as these arguments. */

function destroyer(arr) {
    // get arguments
    var args = Array.prototype.slice.call(arguments, 1);
    // copy array
    var cpArr = arr.slice();
    // loop elements
    for (var elt = 0; elt < arr.length; elt++) {
        // loop args
        for (var arg = 0; arg < args.length; arg++) {
            if (arr[elt] === args[arg]) {
                // remove matches
                cpArr.splice(cpArr.indexOf(arr[elt]), 1);
            }
        }
    }
    return cpArr;
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);
I wanna know how it could be done with filter though
anyone ?
Jerry Robles
@jerryrobles
Aug 17 2015 19:22
@captainmoha create an additional array with the second 2 args, and use it to filter out the initial array
This message was deleted
Mohamed A. Farouk
@captainmoha
Aug 17 2015 19:27
@jerryrobles filter takes a callback function I'm a little unsure about this area. I tried doing it but couldn't.
Feners4
@Feners4
Aug 17 2015 19:29

if im using
´´´
function countUp(start) {
var answer_array = "";
for(var i = start + 1; i <= start + 10; i++){
var answer = i + " then ";
answer_array += answer;
}
if(answer_array)
console.log(answer_array)

}
```
to get x then x then x then x (x being a number) how can I delete the then the dipslyas at the end ?

Jerry Robles
@jerryrobles
Aug 17 2015 19:29
@ captainmoha The callback simply needs to check if the current element is in the additional array, try something like
return arr.filter(function(a){
  if(newArr.indexOf(a) !== -1){
    return a;
   });
}
Mohamed A. Farouk
@captainmoha
Aug 17 2015 19:30
@jerryrobles YES that's it :smile: the -1!
@jerryrobles Thanks so much.
CamperBot
@camperbot
Aug 17 2015 19:30
captainmoha sends brownie points to @jerryrobles :sparkles: :thumbsup: :sparkles:
:star: 166 | @jerryrobles | http://www.freecodecamp.com/jerryrobles
Feners4
@Feners4
Aug 17 2015 19:30
maybe with splice?
Kolloom
@Kolloom
Aug 17 2015 19:31
slotOne = Math.floor(Math.random() * (3 - 1 + 1) + 1);
slotTwo = Math.floor(Math.random() * (3 - 1 + 1) + 1);
slotThree = Math.floor(Math.random() * (3 - 1 + 1) + 1);
if i use this expression like this , does it yields 3 different results?
Jerry Robles
@jerryrobles
Aug 17 2015 19:32
don't even need splice, if the callback is false, the element is filtered out
@Feners4 open your code block with ```
Feners4
@Feners4
Aug 17 2015 19:34
I solved it, thanks anyways!
Jerry Robles
@jerryrobles
Aug 17 2015 19:37
@Kolloom what are you trying to do?
Kolloom
@Kolloom
Aug 17 2015 19:39
need 3 random numbers stored in 3 different variables
Jerry Robles
@jerryrobles
Aug 17 2015 19:40
does the range have to be 0-4?
well they will definitely be random, but they may not always be different from each other considering you have such a narrow range
softeg
@softeg
Aug 17 2015 19:41
@Kolloom PLZ help me how i can fix it ?
Jerry Robles
@jerryrobles
Aug 17 2015 19:44
looks like there is a parenthesis out of place
I think it should be
slotOne = Math.floor(Math.random() * (3 - 1 + 1)) + 1 ;
Kolloom
@Kolloom
Aug 17 2015 19:46
it's some magic formula to get a random number within the range
Jerry Robles
@jerryrobles
Aug 17 2015 19:46
check the 4th example
Kolloom
@Kolloom
Aug 17 2015 19:47
oh oops
thanks @jerryrobles
CamperBot
@camperbot
Aug 17 2015 19:47
kolloom sends brownie points to @jerryrobles :sparkles: :thumbsup: :sparkles:
:star: 167 | @jerryrobles | http://www.freecodecamp.com/jerryrobles
Kolloom
@Kolloom
Aug 17 2015 19:48

take a look at the requirement of the bonfire

Your job is to validate or reject the US phone number based on any combination of the formats provided above. The area code is required. If the country code is provided, you must confirm that the country code is "1". Return true if the string is a valid US phone number; otherwise false.

Kolloom
@Kolloom
Aug 17 2015 19:58
there are two types of phone number here: numbers with country code(11 digits), numbers without(10 digits).
your first half of the regex ignored whether the phone number begins with country code other than 1, extract all the digits first then validate
would be much easier this way
@softeg
Justin Dieter
@JDieter12
Aug 17 2015 20:01
Anyone good with CSS? I'm having an issue. I'm creating a simple, basic login page for a project. Just "username" and "password" forms with a submit button. I created an image that I want the form to lay on top of. I've tried some different combinations of positioning, leaving everything basic, z-power(? Lol) and some other things. I spent about 4 hours trying to get the forms on top of the image, but nothing. I've got it fairly close right now with changing margin but the form is behind the photo. I'm lost. Does the placement of the image tag, within the HTML document matter? I need halp!!
Tati
@Tati1701
Aug 17 2015 20:05
Hey people, I just logged in to FreeCodeCamp and several 'steps' are now missing on the 'map'. Has anybody had the same issue? Is there a way to fix it?
I looked in the 'history' of my browser and tried to access the last lesson I was in, and FreeCodeCamp can't find the URL :/
@Tati1701 they added new challenges. I just went back and did them.
Justin Dieter
@JDieter12
Aug 17 2015 20:08
So @dting , just put the background image into the containers CSS, not in the HTML?
Roger Nattkemper
@RogerNattkemper
Aug 17 2015 20:09
I'm hoping this stupid simple, I'm missing "Missing ) after argument list".
But I can't see it at all
<script>
$(document).ready(function() {
$("#target1").css("color", "red");
$("#target1").prop("disabled", true);
$("#target4").remove();
$("#target2").appendTo("#right-well");
$("#target5").clone().appendTo("#left-well");
$("#target1").parent().css("background-color", "red")
});
</script>
Tati
@Tati1701
Aug 17 2015 20:10
Ok, thank you @JDieter12
CamperBot
@camperbot
Aug 17 2015 20:10
tati1701 sends brownie points to @jdieter12 :sparkles: :thumbsup: :sparkles:
:star: 114 | @jdieter12 | http://www.freecodecamp.com/jdieter12
Roger Nattkemper
@RogerNattkemper
Aug 17 2015 20:14
(Adding the missing ; didn't change anything)
vaidap
@vaidap
Aug 17 2015 20:18
@RogerNattkemper a few people have the same problem including me, reported it as a bug! :)
Steven Young
@ShelbyGT
Aug 17 2015 20:18
This message was deleted
Roger Nattkemper
@RogerNattkemper
Aug 17 2015 20:19
Thank you @vaidap, I'll skip it then.
Peter Daily
@thepeted
Aug 17 2015 20:19
checking I’m not going mad… is this lesson bugged? http://www.freecodecamp.com/challenges/waypoint-manipulate-arrays-with-shift
trying myArray.shift();
Steven Young
@ShelbyGT
Aug 17 2015 20:20

<style>
body {
background-color: black;
font-family: Monospace;
color: green;
}
</style>

<h1>Hello World!</h1>thats the original code,,here is what i changed,,<style>
body {
background-color: black;
font-family: Monospace;
color: pink;
}
</style>

<h1 class="pink-text">Hello World!</h1>,,,it allows me to move on,,but how is it overridding the original if all I did was add a class and change the wording in the body

Rex Schrader
@SaintPeter
Aug 17 2015 20:20
@thepeted I just tried it and it worked fine.
Peter Daily
@thepeted
Aug 17 2015 20:21
@SaintPeter - mine fails this test:
```
assert((function(d){if(d === 'John' && typeof(myRemoved) === 'string'){return(true);}else{return(false);}})(myRemoved), 'myRemoved should contain "John"');myRemoved should contain “John”
vaidap
@vaidap
Aug 17 2015 20:21
@thepeted yup it works fine. look at how shift was used before!
Peter Daily
@thepeted
Aug 17 2015 20:21
OK hang on...
vaidap
@vaidap
Aug 17 2015 20:21
was it written by itself?
Peter Daily
@thepeted
Aug 17 2015 20:22
gotcha…. been a long day :-)
vaidap
@vaidap
Aug 17 2015 20:23
haha, no worries ;)
Rex Schrader
@SaintPeter
Aug 17 2015 20:23
@ShelbyGT which waypoint is that?
Steven Young
@ShelbyGT
Aug 17 2015 20:23
@SaintPeter Waypoint: Prioritize One Style Over Another
Rex Schrader
@SaintPeter
Aug 17 2015 20:25

@ShelbyGT Ok, yeah, that was not quite right. Here is what the instructions say:
Create a CSS class called pink-text that gives an element the color pink.

Give your h1 element the class of pink-text.

@ShelbyGT You did the second part, but not the first. You need to create a class called ".pink-text" that changes the color attribute.
@ShelbyGT Don't modify the body class, add an additional class.
@ShelbyGT You can click "reset" to go back to the default code.
Steven Young
@ShelbyGT
Aug 17 2015 20:27
@SaintPeter ok i think i got it now thanks
CamperBot
@camperbot
Aug 17 2015 20:27
shelbygt sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 195 | @saintpeter | http://www.freecodecamp.com/saintpeter
ShafM
@ShafM
Aug 17 2015 20:31
Hi guys I need some help on Waypoint: Make Dead Links using the Hash Symbol
vaidap
@vaidap
Aug 17 2015 20:31
do tell! :)
Rex Schrader
@SaintPeter
Aug 17 2015 20:34
@ShafM Lay it on us :D
ShafM
@ShafM
Aug 17 2015 20:34
I'm not sure where to put the hash sybmbol
Steven Young
@ShelbyGT
Aug 17 2015 20:35
@SaintPeter i think i have the first line of then first part but not sure how to write the second line
vaidap
@vaidap
Aug 17 2015 20:35
where you put the link before! @ShafM
Rex Schrader
@SaintPeter
Aug 17 2015 20:35
@ShelbyGT Why me what you've got so far.
wiki format
CamperBot
@camperbot
Aug 17 2015 20:35

:point_right: code formatting [wiki]

Inline code

This an inline `<paste code here>` code formatting with a single backtick(`) at start and end around the code.

Code Block

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

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

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

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

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

Steven Young
@ShelbyGT
Aug 17 2015 20:36
This message was deleted
CamperBot
@camperbot
Aug 17 2015 20:36
:bulb: to format code use backticks! ``` more info
Steven Young
@ShelbyGT
Aug 17 2015 20:38
This message was deleted
CamperBot
@camperbot
Aug 17 2015 20:38
:bulb: to format code use backticks! ``` more info
vaidap
@vaidap
Aug 17 2015 20:38
@ShelbyGT ` are not the same a quote marks! :) i access it with the alt and the µ button but might be different for your keyboard
Derek Frankel
@TuvyaYis
Aug 17 2015 20:40
hey was FCC just updated with a new map? i didn't get any emails about it.
Steven Young
@ShelbyGT
Aug 17 2015 20:42
<style>
  body {
    background-color: black;
    font-family: Monospace;
    color: green;
    ."pink-text" {
    "text-color: pink;"
  }
  }
</style>
<h1 class="pink-text">Hello World!</h1>
@TuvyaYis yes,,,It's the upgrade...one,, we are no longer linked to codeacadamy,,two some of the "holes " in you waypionts are new content. For more info. check out the wiki:https://github.com/freecodecamp/freecodecamp/wiki/august-2015-improvements
Rex Schrader
@SaintPeter
Aug 17 2015 20:43
@ShelbyGT No quotes around .pink-text in your class definition
@ShelbyGT And none in the style portion either
@ShelbyGT It's just:
.pink-text {
   color: pink;
}
@ShelbyGT and it's color, not text-color
vaidap
@vaidap
Aug 17 2015 20:44
is it just me or are the FFC-only jquery and javascript courses so incredibly easier than the codeacademy ones? i guess they just cover the very basics, while CA goes into more detail
Rex Schrader
@SaintPeter
Aug 17 2015 20:44
@ShelbyGT AND . . you need to do the new class outside the curly braces of the prior style
Steven Young
@ShelbyGT
Aug 17 2015 20:46
does spacing matter
@SaintPeter and thanks alot it works
CamperBot
@camperbot
Aug 17 2015 20:47
shelbygt sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
Rex Schrader
@SaintPeter
Aug 17 2015 20:47
@ShelbyGT spacing generally does not matter
@ShelbyGT except, for example, you must have the dot before the class name, no spaces
Steven Young
@ShelbyGT
Aug 17 2015 20:48
@SaintPeter ok thanks
CamperBot
@camperbot
Aug 17 2015 20:48
shelbygt sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
jameswlytle
@jameswlytle
Aug 17 2015 20:51
This message was deleted
working on the way point Target the Parent of an Element Using jQuery. I have added what I am pretty certain is the correct statement to complete the request, but it is not accepting it as the correct answer. could this possibly be a bug to report?
Steven Young
@ShelbyGT
Aug 17 2015 20:59
isnt it bad coding to leave the old stuff in your code,, example:
   color: green;
  }
  #orange-text {
    color: orange;
  }
  .pink-text {
    color: pink;
  }
  .blue-text {
    color: blue;
  }
     .white-text {
    color: white;
  }
inother words why override,,why not just change it
Rex Schrader
@SaintPeter
Aug 17 2015 21:00
@jameswlytle There is a known bug with that one. Go ahead and skip it.
jameswlytle
@jameswlytle
Aug 17 2015 21:01
@SaintPeter Okay. thanks! Just wanted to make sure I hadn't misunderstood or made a mistake in my code! :)
CamperBot
@camperbot
Aug 17 2015 21:01
jameswlytle sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 196 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Aug 17 2015 21:02
@ShelbyGT Yes and no - These are really simplified examples intended to show you how the different types of styles interact. There are some really good reasons to override existing styles that come with more complex HTML.
@ShelbyGT For example, imagine that you have a generic p setting to set all your text one color, but then you want one word in the middle of the p to be a different color? You need to know how to apply styles to change the color of just that one word. Also, as you'll see later, there are selectors that work on every nth object - same thing. And it's not just color, there are literally hundreds of CSS attributes that can be changed or overridden.
Steven Young
@ShelbyGT
Aug 17 2015 21:05
ahhhh ok thanks @SaintPeter ,,makes more sense now
CamperBot
@camperbot
Aug 17 2015 21:05
shelbygt sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
Ayo
@ayondot
Aug 17 2015 21:20
hello guys, i can't find my solutions to the bonfires i've completed. Anyone with the same issue?
John Schaub
@desmoquak
Aug 17 2015 21:21

how do i Use an ID Attribute to Style an Element?}
.gray-background {
background-color: gray
}
.form {background-color="green"}
</style>

<h2 class="red-text">CatPhotoApp</h2>

<p>Click here for <a href="#">cat photos</a>.</p>

<a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>

<div class="gray-background">
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
</div>

<form action="/submit-cat-photo" id="cat-photo-form">

Matthew Barber
@Honno
Aug 17 2015 21:25
Why does this stop working after I click it twice?
  $("#temp-type-query").click(function() {
    if($("#temp-type-target").text() === "farenheit") {
      $("#temp-type-target").text("celsius");
      $("#temp-query").text(celsius);
    } else {
      $("#temp-type-target").text("fahrenheit");
      $("#temp-query").text(fahrenheit);
    }
  });
Nothing changes
So it goes celsius on first click, then fahrenheit, then nothing changes
Peter Daily
@thepeted
Aug 17 2015 21:26
@ayondot I read somewhere that they have removed that functionality, but there will be an api in the future to access them
i;ll try and find the link to that
Donny van Walsem
@Donneh
Aug 17 2015 21:26

I'm at the waypoint where i need to generate a random integer within a range, i finished it, but i don't really understand it.

return(Math.floor(Math.random() * (max - min +1)) + min);

How does it know what max and min are?

nevermind im a huge idiot, they are defined right above it. Forget i said anything.
Logan Tegman
@ltegman
Aug 17 2015 21:27
@Honno There's a mispelling in your text you're inserting, so it fails the check once that happens
Matthew Barber
@Honno
Aug 17 2015 21:29
@ltegman Oh lmao, thanks!
CamperBot
@camperbot
Aug 17 2015 21:29
honno sends brownie points to @ltegman :sparkles: :thumbsup: :sparkles:
:star: 168 | @ltegman | http://www.freecodecamp.com/ltegman
Ayo
@ayondot
Aug 17 2015 21:32
@thepeted thanks
CamperBot
@camperbot
Aug 17 2015 21:32
ayondot sends brownie points to @thepeted :sparkles: :thumbsup: :sparkles:
:star: 244 | @thepeted | http://www.freecodecamp.com/thepeted
Peter Daily
@thepeted
Aug 17 2015 21:33
@ayondot its a shame really, I fpund it helpful (and satisfying) to look back over them
Logan Tegman
@ltegman
Aug 17 2015 21:37
@thepeted It was also nice to use as a reference point for helping people on here sometimes. If I didn't remember how a particular challenge worked it was nice to refresh my memory before trying to point someone in the right direction, instead of starting from the ground up.
Ayo
@ayondot
Aug 17 2015 21:43
@thepeted and @ltegman exactly!!!
Peter Daily
@thepeted
Aug 17 2015 21:53
@ltegman @ayondot - this got me thinking… Google cache
Ayo
@ayondot
Aug 17 2015 21:54
lol
Peter Daily
@thepeted
Aug 17 2015 21:54
@ltegman @ayondot just rescued mine by searching freecodecamp portfolio [myusername] and then clicking the arrow next to the result to get the cached version :-)
Logan Tegman
@ltegman
Aug 17 2015 21:55
@thepeted Mine only has my first couple days of sulutions, none of my later work :/
Peter Daily
@thepeted
Aug 17 2015 21:56
:’(
mine was cached on 13th August - did all mine a while ago
Ayo
@ayondot
Aug 17 2015 21:57
@thepeted @ltegman how do i get mine
Peter Daily
@thepeted
Aug 17 2015 21:57
@ltegman you’ll have to do them again :-D
Logan Tegman
@ltegman
Aug 17 2015 21:58
@thepeted Once the API is up I'll have to make a solution viewer :D
Peter Daily
@thepeted
Aug 17 2015 21:58
@ayondot if you google your profile/portfolio, and click the little arrow next to the link on the google search results, then you should be able to access the latest cached version that google holds
@ltegman - patented that idea right now for us hehe
@ltegman could be cool that - let people upvote the best solutions ala codewars
Logan Tegman
@ltegman
Aug 17 2015 22:00
@thepeted Yeah, that actually sounds like a real fun idea -- I bet you someone beats me to it though :P
Peter Daily
@thepeted
Aug 17 2015 22:01
@ltegman hehe theres a challenge for you!
Ayo
@ayondot
Aug 17 2015 22:03
@thepeted thanks, but i couldn't retrieve all
Peter Daily
@thepeted
Aug 17 2015 22:04
@ayondot ack - yeah it doesn’t cache all that often
Reese
@justoutherecoding
Aug 17 2015 22:18
How do I get help with a specific Waypoint? When I click 'take me to help room' nothing happens. How do I share the problem?
Rex Schrader
@SaintPeter
Aug 17 2015 22:18
@justoutherecoding Here is fine.
wiki format
CamperBot
@camperbot
Aug 17 2015 22:18

:point_right: code formatting [wiki]

Inline code

This an inline `<paste code here>` code formatting with a single backtick(`) at start and end around the code.

Code Block

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

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

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

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

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

Rex Schrader
@SaintPeter
Aug 17 2015 22:19
@justoutherecoding Use the above instructions to help post the relevent part of your code.
Reese
@justoutherecoding
Aug 17 2015 22:19
Thanks
```<style>
body {
background-color: black;
color: green;
font-family: Monospace;
<h1>Hello World</h1>
}
</style>
CamperBot
@camperbot
Aug 17 2015 22:20
:bulb: to format code use backticks! ``` more info
Reese
@justoutherecoding
Aug 17 2015 22:21
This message was deleted
Rex Schrader
@SaintPeter
Aug 17 2015 22:21
Backticks before and after
You can delete or edit your prior messages
@justoutherecoding ok, I can see the problem from here. You have your HTML inside your Style. HTML goes below the <style> tags
Reese
@justoutherecoding
Aug 17 2015 22:23
Oh ok Thanks! I don't like the way the help feature is set up now...before you could just hit the help button and it would copy/paste the lesson.
Rex Schrader
@SaintPeter
Aug 17 2015 22:24
@justoutherecoding Humm, there may be a bug. Which spcific waypoint was this?
Reese
@justoutherecoding
Aug 17 2015 22:25
Waypoint: Inherit Styles from the Body Element
DTing
@dting
Aug 17 2015 22:25
find
CamperBot
@camperbot
Aug 17 2015 22:25

find undefined

more enteries:
undefined

DTing
@dting
Aug 17 2015 22:25
find inherit
CamperBot
@camperbot
Aug 17 2015 22:25
find inherit
nothing found
Rex Schrader
@SaintPeter
Aug 17 2015 22:26
@justoutherecoding ok, wow, that's double broken. The link doesn't work and the link is wrong.
Reese
@justoutherecoding
Aug 17 2015 22:28
@saadanerdetbare posted the correct link.
dc
@dcsan
Aug 17 2015 22:28
thanks @SaintPeter for no particular reason
CamperBot
@camperbot
Aug 17 2015 22:28
dcsan sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 197 | @saintpeter | http://www.freecodecamp.com/saintpeter
dc
@dcsan
Aug 17 2015 22:28
i wanted to be the #200th :)
thanks @SaintPeter
CamperBot
@camperbot
Aug 17 2015 22:28
dcsan sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
dc
@dcsan
Aug 17 2015 22:29
but i can't send it twice together :)
Rex Schrader
@SaintPeter
Aug 17 2015 22:29
@dcsan Hey, if you want to th ank me, do it in the HelpZiplines room - I'm getting lots of th anks over there, but no credit ;)
Jakob Dahl
@saadanerdetbare
Aug 17 2015 22:30
i just checked the Waypoint: Inherit Styles from the Body Element. It seems fine
M Used
@mildused
Aug 17 2015 22:31
Can someone help me in Calculus? Blehh
Rex Schrader
@SaintPeter
Aug 17 2015 22:32
@mildused Does Khan Academy have a chat room?
M Used
@mildused
Aug 17 2015 22:33
@SaintPeter I doubt it
PenggunaPHP
@penggunaphp
Aug 17 2015 22:53
Objective: Build a CodePen.io app that successfully reverse-engineers this: http://codepen.io/ThiagoFerreir4/full/eNMxEp. <<< I don't understand with this task...Can explain to me?
Rex Schrader
@SaintPeter
Aug 17 2015 22:53
@penggunaphp Yeah, you need to make your own portfolio website.
Bill
@kirah1314
Aug 17 2015 22:54
@penggunaphp make an exact same site
Rex Schrader
@SaintPeter
Aug 17 2015 22:54
@penggunaphp When they say "reverse engineer" they really just mean "Make your own version"
PenggunaPHP
@penggunaphp
Aug 17 2015 22:54
Ok thanks...:)
CamperBot
@camperbot
Aug 17 2015 22:54
if you want to thank someone, put an @ before their name!
Rex Schrader
@SaintPeter
Aug 17 2015 22:54
@penggunaphp The don't mean copy it exactly, although that is an option. Be creative, use what you've learned.
PenggunaPHP
@penggunaphp
Aug 17 2015 22:55
@SaintPeter @kirah1314 Thanks :)
CamperBot
@camperbot
Aug 17 2015 22:55
penggunaphp sends brownie points to @saintpeter and @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 146 | @kirah1314 | http://www.freecodecamp.com/kirah1314
:star: 200 | @saintpeter | http://www.freecodecamp.com/saintpeter
Donny van Walsem
@Donneh
Aug 17 2015 22:55
function palindrome(str) {
  // Good luck!;
  // str = str.toLowerCase();
  // console.log(str);
  str = str.replace('/\s/g', '');
  console.log(str);
  return true;
}



palindrome("Eye af");
Why doesn't this remove the space?
Rex Schrader
@SaintPeter
Aug 17 2015 22:56
@Donneh Because you don't need to put single quotes around a regular expression. the / / marks are the delimiters.
Donny van Walsem
@Donneh
Aug 17 2015 22:56
@SaintPeter Oh it's that simple. Thank you!
CamperBot
@camperbot
Aug 17 2015 22:56
donneh sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 201 | @saintpeter | http://www.freecodecamp.com/saintpeter
Donavin Northrup
@dnorthrupva
Aug 17 2015 23:02
Not really an FCC question persay, but any Mac experts? I got a question.
DTing
@dting
Aug 17 2015 23:04
@dnorthrupva I use a mac. I wouldn't say I'm an expert. What's up?
Donavin Northrup
@dnorthrupva
Aug 17 2015 23:04
Is there anyway to ‘zoom in’ on a picture easily? I’m still getting used to all the new TrackPad features. Or is it like Windows and I just have to “Open in New Tab” and Zoom the page?
(A picture on a website) @dting
I feel like there was a two-finger pull like on a phone, but can’t find it in the manual.
DTing
@dting
Aug 17 2015 23:07
hmm. i havent used my macbook in a while lemme pull it out. I'm usually on my iMac.
Donavin Northrup
@dnorthrupva
Aug 17 2015 23:07
iMac might work the same…? Probably not, actually unless you use the trackpad.
Young Lee
@young92117
Aug 17 2015 23:08
I think you can zoom like just like what you do in the phone...
DTing
@dting
Aug 17 2015 23:08
ya i dont use a track pad on my imac
PenggunaPHP
@penggunaphp
Aug 17 2015 23:09
i can't see user portfolio.. why?
Young Lee
@young92117
Aug 17 2015 23:10
touch the trackpad with two finger to pinch (e.g thumb and index finger) and spread the finger a part .. just like what you do in the phone..
DTing
@dting
Aug 17 2015 23:11
@dnorthrupva ya pinch zoom seems to just work on my macbook.
in chrome and safari
Donavin Northrup
@dnorthrupva
Aug 17 2015 23:14
Works on websites @dting ? I seem to have issues on the most of the mouse commands, haha. Fat fingers maybe.
DTing
@dting
Aug 17 2015 23:15
ya seems to work fine for me on websites or images.
Jelani Thompson
@JelaniThompson
Aug 17 2015 23:18
Hey guys, is there a better alternative for calling functions than this?
Danny Fritz
@dannyfritz
Aug 17 2015 23:19
@JelaniThompson you can find the DOM object in JS and attach it that way.
putting js and css in HTML is generally frowned on
@JelaniThompson the second example on your link shows this
Donavin Northrup
@dnorthrupva
Aug 17 2015 23:20
@dting You’re right, thanks for the help. If I use two diff index fingers it works great.
CamperBot
@camperbot
Aug 17 2015 23:20
dnorthrupva sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
Jelani Thompson
@JelaniThompson
Aug 17 2015 23:20
Oh awesome, thanks @dannyfritz
CamperBot
@camperbot
Aug 17 2015 23:20
:star: 289 | @dting | http://www.freecodecamp.com/dting
jelanithompson sends brownie points to @dannyfritz :sparkles: :thumbsup: :sparkles:
:star: 77 | @dannyfritz | http://www.freecodecamp.com/dannyfritz
Jelani Thompson
@JelaniThompson
Aug 17 2015 23:20
That's a lot of Karma lol
The human equivalent to stackOverflow XD
DTing
@dting
Aug 17 2015 23:21
I think thats mostly from just finishing all the material. That might be the first tanks i've gotten.
CamperBot
@camperbot
Aug 17 2015 23:21
if you want to thank someone, put an @ before their name!
Jelani Thompson
@JelaniThompson
Aug 17 2015 23:22
lol
Hmm, I tried using .on, but does anyone know why this isn't printing the emote to the screen?
Danny Fritz
@dannyfritz
Aug 17 2015 23:23
what do stars do?
Jelani Thompson
@JelaniThompson
Aug 17 2015 23:24
You'll be able to see the code if you click the "Edit on Codepen" link
@dannyfritz Oh, I'm not sure haha
Rex Schrader
@SaintPeter
Aug 17 2015 23:25
wiki brownie
CamperBot
@camperbot
Aug 17 2015 23:25

:point_right: brownie points [wiki]

The number beside your picture on Free Code Camp tells you how many Brownie Points you have.

A user profile picture next to a with Brownie Points score

There are three ways you can get Brownie Points:

  1. Complete challenges - you get one point per challenge you complete
  2. Post relevant links on Camper News - you get 1 point for posting a link, and another point for each upvote your link gets
  3. Help other campers in chat - each time you help another camper and they thank you (by typing "thanks @yourname"), you will get a point

Brownie Points help you look like the kind of person who codes a lot, shares relevant links, and helps people.

They also add to your Streak.
:pencil: read more about brownie points on the FCC Wiki

Danny Fritz
@dannyfritz
Aug 17 2015 23:26
@JelaniThompson you create a function called checkCharacter. but does it ever get called?
Brian Daub
@briandaub
Aug 17 2015 23:34
What happened to Free Code Camp?
All of the waypoints, bonfires, ziplines, and base jumps are gone. All of the originally completed sections now have more work to do in them. None of the codecademy work that I have completed is counting towards anything. When were these changes made? And why cant I find any info on it anywhere?
Rex Schrader
@SaintPeter
Aug 17 2015 23:38
wiki 2015
CamperBot
@camperbot
Aug 17 2015 23:38

:point_right: august 2015 improvements [wiki]

We're super slow today. Sorry for the inconvenience. We are working to fix this as fast as possible.

In short, we switched to Loopback.js, and they have a faulty Mongo connection that only shows up at scale. We're fixing it, and will commit the fix back to Loopback.js as well.

In the meantime, we invite you to:

WIP

:pencil: read more about august 2015 improvements on the FCC Wiki

Rex Schrader
@SaintPeter
Aug 17 2015 23:38
@codeJunkie01 More detail on the Wiki. If you've lost progress, don't fret.
Brian Daub
@briandaub
Aug 17 2015 23:39
Awesome! Thanks for that! @SaintPeter
CamperBot
@camperbot
Aug 17 2015 23:39
codejunkie01 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 203 | @saintpeter | http://www.freecodecamp.com/saintpeter
Jelani Thompson
@JelaniThompson
Aug 17 2015 23:42
I think I coded it right
Still confused as to why it isn't appearing though
//Making a program that copies memes to your clipboard
//Look for Clipboard.js on GitHub

var dictionary = {
  "gimme": "༼ つ ◕_◕ ༽つ",
  "umadbro": "¯\_(ツ)_/¯",
  "lenny": "( ͡° ͜ʖ ͡°)"
}

function checkCharacter() {
  //Assign $ascii_box variable to ascii-box element
  var $ascii_box = document.getElementById("ascii-box");

  //Update value of $ascii_box_value everytime the text field changes
  $ascii_box.on("input", function() {
    var $ascii_box_value = $ascii_box.val();
    checkCharacter();
  });

  //Check if value in text box is equal to a name in the dictionary object
  //If equal, print the emote to the screen
  if (dictionary.hasOwnProperty($ascii_box_value)) {
    document.write(dictionary[$ascii_box_value]);
  }
}
Danny Fritz
@dannyfritz
Aug 17 2015 23:42
@JelaniThompson i see you define the function checkCharacter but when do you call it?
Jelani Thompson
@JelaniThompson
Aug 17 2015 23:43
Here
  $ascii_box.on("input", function() {
    var $ascii_box_value = $ascii_box.val();
    checkCharacter();
  });
Danny Fritz
@dannyfritz
Aug 17 2015 23:43
you call it inside the function?
Jelani Thompson
@JelaniThompson
Aug 17 2015 23:43
Oops
Lol
Danny Fritz
@dannyfritz
Aug 17 2015 23:43
but when does the function first get called?
Chris LaFave
@chrislafave
Aug 17 2015 23:45
<script>$(document).ready(function() { });

</script>


<!-- You shouldn't need to modify code below this line -->
I've gone back to fill in the gaps in my challenges presented by the recent update. I'm on "Waypoint: Learn how Script Tags and Document Ready Work" and it wont accept the line shown at the top, giving the following:
Close your $(document).ready(function() {
function with });.
Is there something wrong or is this a bug? WTF? I've tried many permutations: outside the closing script element, inside, etc.
Rex Schrader
@SaintPeter
Aug 17 2015 23:48
@chrislafave Let me take a look
Jelani Thompson
@JelaniThompson
Aug 17 2015 23:49
@dannyfritz Even when I call it outside of the function, it still doesn't work
I honestly have no idea what the issue could be lo
l
Rex Schrader
@SaintPeter
Aug 17 2015 23:50
@chrislafave Ok, the problme is that you need to have the }); on a line by itself. just put a CR in there and you're good.
Danny Fritz
@dannyfritz
Aug 17 2015 23:50
@JelaniThompson i'm thinking it errors. i don't think DomElement has a method for on
Chris LaFave
@chrislafave
Aug 17 2015 23:50
@SaintPeter Okay I figured it out. I put the </script> at the very bottom of all the code and it worked. :)
Jelani Thompson
@JelaniThompson
Aug 17 2015 23:50
I'm using jQuery
Rex Schrader
@SaintPeter
Aug 17 2015 23:50
@chrislafave That's not correct.
Chris LaFave
@chrislafave
Aug 17 2015 23:50
@SaintPeter Oh yes, you're right. I also moved that.
Rex Schrader
@SaintPeter
Aug 17 2015 23:51
@chrislafave Yeah, the script tag can't have other HTML elements in it.
Chris LaFave
@chrislafave
Aug 17 2015 23:52
<script>$(document).ready(function() { 
  });

<!-- You shouldn't need to modify code below this line -->

<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">

                               [SNIP]
5</button>
        <button class="btn btn-default target" id="target6">#target6</button>
      </div>
    </div>
  </div>
</div>


</script>
Danny Fritz
@dannyfritz
Aug 17 2015 23:52
@JelaniThompson if you want it to be a JQuery object you'll have to do a JQuery selector with $() instead of document.getElementById
Chris LaFave
@chrislafave
Aug 17 2015 23:53
It's happy with it like that. I took out the extra crap in the middle.
Rex Schrader
@SaintPeter
Aug 17 2015 23:53
@chrislafave Yeah, that's very wrong, from an HTML perspective.
@chrislafave I just confirmed: The test requires that the closing braces be on their own line.
Jelani Thompson
@JelaniThompson
Aug 17 2015 23:55
But whenever I do that, it sparks more erros
errors
Uncaught ReferenceError: $ascii_box_value is not defined
That was my initial plan, but it seemed to not work
DTing
@dting
Aug 17 2015 23:58

@JelaniThompson

  //Check if value in text box is equal to a name in the dictionary object
  //If equal, print the emote to the screen
  if (dictionary.hasOwnProperty($ascii_box_value)) {
    document.write(dictionary[$ascii_box_value]);
  }

This part of the code doesn't have access to the $ascii_box_value variable. That is declared in the callback function for on input.