These are chat archives for FreeCodeCamp/Help

12th
Oct 2015
Jordan Robertson
@Jordanson
Oct 12 2015 00:00
yeah that would be cool @gratschultz2013 and i agree with you. I feel like there isn't enough conceptual learning but maybe it's a bit too early to say.
Kari Schendel
@firefaded
Oct 12 2015 00:01
blob
noobstar
@namsir
Oct 12 2015 00:03
@firefaded you already did add engines = 4
Jordan Robertson
@Jordanson
Oct 12 2015 00:03

```var Car = function() {
this.wheels = 4;
};

// Only change code below this line.
var myCar = new Car
myCar.engines = 1;```

noobstar
@namsir
Oct 12 2015 00:03
^^^^^
@firefaded take var mycar = function() { this.engines = 4; }; off
Jordan Robertson
@Jordanson
Oct 12 2015 00:04

ughhhhhhh ```var Car = function() {
this.wheels = 4;
};

// Only change code below this line.
var myCar = new Car
myCar.engines = 1;
```

noobstar
@namsir
Oct 12 2015 00:04
replace it with myCar.engines = 4;
Jordan Robertson
@Jordanson
Oct 12 2015 00:05

wth ```var Car = function() {
this.wheels = 4;
};

// Only change code below this line.
var myCar = new Car
myCar.engines = 1;
```

noobstar
@namsir
Oct 12 2015 00:05
``` first
don't put anything before it
Jordan Robertson
@Jordanson
Oct 12 2015 00:05

```var Car = function() {
this.wheels = 4;
};

// Only change code below this line.
var myCar = new Car
myCar.engines = 1;
```

noobstar
@namsir
Oct 12 2015 00:05
you didn't hit enter?
``` and hit enter to enter coding mode
Jordan Robertson
@Jordanson
Oct 12 2015 00:06
sorry wasn't an issue before idk what i am doing wrong lol.
noobstar
@namsir
Oct 12 2015 00:06
hit ctrl + enter to send in
Jordan Robertson
@Jordanson
Oct 12 2015 00:06

```var Car = function() {
this.wheels = 4;
};

// Only change code below this line.
var myCar = new Car
myCar.engines = 1;
```

wtf
screw it
Kari Schendel
@firefaded
Oct 12 2015 00:06
Thanks! I've been stuck on that for hours. I didn't realize that it was just adding the engines as myCar.engines
CamperBot
@camperbot
Oct 12 2015 00:06
if you want to thank someone, put an @ before their name!
Reggie
@Reggie01
Oct 12 2015 00:07
help formatting
CamperBot
@camperbot
Oct 12 2015 00:07

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

``` ⇦ Type 3 backticks and 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

Kari Schendel
@firefaded
Oct 12 2015 00:08
@namsir @Jordanson Thanks!
CamperBot
@camperbot
Oct 12 2015 00:08
firefaded sends brownie points to @namsir and @jordanson :sparkles: :thumbsup: :sparkles:
:star: 174 | @jordanson | http://www.freecodecamp.com/jordanson
:star: 229 | @namsir | http://www.freecodecamp.com/namsir
Jordan Robertson
@Jordanson
Oct 12 2015 00:09
ahhhhh i see lol idk how i forgot
noobstar
@namsir
Oct 12 2015 00:09
ok.
Jordan Robertson
@Jordanson
Oct 12 2015 00:09
yeah do you understand it @firefaded?
noobstar
@namsir
Oct 12 2015 00:09
probably not...because you gave him the code without explain it.
Jordan Robertson
@Jordanson
Oct 12 2015 00:10
true but it helps to be able to look at the correct code. sometimes an understanding can be reached
Kari Schendel
@firefaded
Oct 12 2015 00:11
Yeah, I understand it now. Seeing how it is supposed to be done makes more sense. The instructions did not give an example on how it should be done and the previous waypoint didn't deal with it either.
noobstar
@namsir
Oct 12 2015 00:12
@firefaded you must know how to construct an object and how to add properties into it.
Jordan Robertson
@Jordanson
Oct 12 2015 00:13
what part are you at @namsir
noobstar
@namsir
Oct 12 2015 00:13
bonfire sum all primes
CamperBot
@camperbot
Oct 12 2015 00:13

:fire:Bonfire: Sum All Primes :link:

function sumPrimes(num) {
  return num;
}

sumPrimes(10);

Sum all the prime numbers up to and including the provided number.

more info:  bf details | bf links | hint

noobstar
@namsir
Oct 12 2015 00:13
you?
Jordan Robertson
@Jordanson
Oct 12 2015 00:14
bonfire Factorialize a Number
CamperBot
@camperbot
Oct 12 2015 00:14
Sorry, can't find a bonfire called factorialize a number . [ Check the map? ]
Kari Schendel
@firefaded
Oct 12 2015 00:14
I'm slowly getting the hang of constructing objects and adding properties to it.
noobstar
@namsir
Oct 12 2015 00:14
that should be fun :)
@firefaded search google or youtube about function constructor
Jordan Robertson
@Jordanson
Oct 12 2015 00:15
the first one made me want to blow my head off. you think that is common?
noobstar
@namsir
Oct 12 2015 00:15
@Jordanson very :) some of the prev challenges took hours to solve.
@Jordanson the key point is if you are able to solve it yourself without looking other's codes.
Kari Schendel
@firefaded
Oct 12 2015 00:16
@namsir good idea
Jordan Robertson
@Jordanson
Oct 12 2015 00:16
ok good that makes me feel a bit better. how do you feel about your javascript skills so far?
noobstar
@namsir
Oct 12 2015 00:17
@Jordanson i'm a beginner bro....only a few months so far.
i just keep doing it and doing it until i get good at it.
i'll take any free education for programming.
web it is.
Jordan Robertson
@Jordanson
Oct 12 2015 00:18
i get you m8. i need to quit crying lol
noobstar
@namsir
Oct 12 2015 00:19
i'm also practicing my skills at bento.io
:)
and codeacademy
Garrett Schultz
@garettschultz
Oct 12 2015 00:38
same here guys. Im spending more time complaining and i shouldnt be. I just have no idea where to start though. For example: In the Bonfire, Check for palindrome, I have no idea what to even start with. Thats my issue and have no idea how to even start or what to even search for to try and figure it out.
noobstar
@namsir
Oct 12 2015 00:39
bonfire palindrome
CamperBot
@camperbot
Oct 12 2015 00:39

:fire:Bonfire: Check for Palindromes :link:

function palindrome(str) {
  // Good luck!
  return true;
}



palindrome("eye");

Return true if the given string is a palindrome. Otherwise, return false.

more info:  bf details | bf links | hint

noobstar
@namsir
Oct 12 2015 00:40
@gratschultz2013 the easiest way to do this is to learn regular expression first.
Jason Wood
@catapixel
Oct 12 2015 00:40
@gratschultz2013 I always start with reading through the "helpful links" in the case of palindrome they are: String.replace()
String.toLowerCase()
Garrett Schultz
@garettschultz
Oct 12 2015 00:41
@namsir how am i suppose to know what regular expression means without learning it in the begining tutorials?
Jason Wood
@catapixel
Oct 12 2015 00:41
bf links
noobstar
@namsir
Oct 12 2015 00:41
@gratschultz2013 search youtube for regular expression
Garrett Schultz
@garettschultz
Oct 12 2015 00:42
ok i wil but see thats the thing i am talking about. How would a beginner know that? How would we know where to start or how to start writing a solution to something like this?
noobstar
@namsir
Oct 12 2015 00:43
@gratschultz2013 there are multiple ways of solving a problem.
@gratschultz2013 first you need to know what is it asking for.
@gratschultz2013 ask yourself that question. write it down on a piece of paper. try to figure it out by hand and apply the same concept but with codes
@gratschultz2013 do you know what a palindrome is?
Garrett Schultz
@garettschultz
Oct 12 2015 00:44
ok for example heres the solution for Factorialize A Number: ```
function factorialize(num) {
  if (num === 0 || num == 1) { return 1; }
  return num * factorialize(num-1);
}

factorialize(5);
noobstar
@namsir
Oct 12 2015 00:45
@gratschultz2013 you did that ?
Garrett Schultz
@garettschultz
Oct 12 2015 00:45
how would a beginner like me know how to write that? Or how would we know where to even start?
noobstar
@namsir
Oct 12 2015 00:45
@gratschultz2013 or you look online for result
first you need to know a basic building blocks of a programming language such as javascript.
if then, for loop, while loop.......etc
Garrett Schultz
@garettschultz
Oct 12 2015 00:46
its the solution on github, but thats why im wondering how would i know when to use the pipes and how would i know to use an (if) statement? Or better off, how would i even know how to write the if statement
noobstar
@namsir
Oct 12 2015 00:46
then learn about functions that the language already provided to you.
if you don't know how to write if then statement. GOOGLE for it.
Garrett Schultz
@garettschultz
Oct 12 2015 00:47
I did! I did all the tutorials here on FCC but they dont give you enough practice with them to be able to get it embedded in your head.
noobstar
@namsir
Oct 12 2015 00:47
or go on youtube search for javascript if then.
fcc challenges give you hints and helpful links.
click on those links and start reading.
Garrett Schultz
@garettschultz
Oct 12 2015 00:48
Thats my question how would a beginner know that the solution requires an (if) statement?
noobstar
@namsir
Oct 12 2015 00:48
if you know what an if then statement is, then your brain will start kick in.....ahhhhh so to solve this i need to use if then statement.
Garrett Schultz
@garettschultz
Oct 12 2015 00:49
so where can i go to get ALOT of practice on each basic concept of JS? because codeacademy is the same as FCC, it spends 1 page on it and goes to the next thing so that wont help.
noobstar
@namsir
Oct 12 2015 00:50
you can't practice if you don't know anything about javascript.
Garrett Schultz
@garettschultz
Oct 12 2015 00:50
your not answering any of my questions @namsir
noobstar
@namsir
Oct 12 2015 00:50
you will need to learn on your own like many people here......
Garrett Schultz
@garettschultz
Oct 12 2015 00:51
You are assuming that I have not done a single thing with javascript yet,; but i have been trying to learn it everyday for the last month now
noobstar
@namsir
Oct 12 2015 00:51
you said you did all the tutorials on FCC... you should be able to lay out an if then statement.
then what are you stuck on?
we could give you guidance and lead you to the right path.
Garrett Schultz
@garettschultz
Oct 12 2015 00:52
since FCC and codeacademy only spend 1 page on each concept, I end up forgetting how to do it the second I leave the page and go onto the next thing.
Jordan Robertson
@Jordanson
Oct 12 2015 00:52
function factorialize(num) {
  return num;
}

factorialize(5);
function factorialize(num) {
var product = 1*2*3*4*5
return product
}
factorialize(10);
function factorialize(num) {
var fac2 = 1*2*3*4*5*6*7*8*9*10
return fac2
}
how do i reach the solution lol? when i do the fac10 i get a check for that but the one for fac5 goes away.
noobstar
@namsir
Oct 12 2015 00:52
then go back and clear out the code. start it again.
@Jordanson you have many functions with the same name. function should have unique name for itself.
Garrett Schultz
@garettschultz
Oct 12 2015 00:54
@namsir do you think this is normal with alot of beginners? TO be absolutely confused how to do it? Or how to even go about it? Or am I the only one here?
noobstar
@namsir
Oct 12 2015 00:54
from what i see, you are overwriting factorialize function.
@gratschultz2013 absolutely.
@gratschultz2013 you couldn't get more normal than that :)
Jordan Robertson
@Jordanson
Oct 12 2015 00:55
the name of them is "factorialize" right? so i should do factorialize1 , factorialize2, etc..?
noobstar
@namsir
Oct 12 2015 00:55
@Jordanson yes :)
Garrett Schultz
@garettschultz
Oct 12 2015 00:55
So do you think with time, and with practicing the basic concepts everyday, I will eventually get it to where itll become 2nd nature? Like riding a bike?
noobstar
@namsir
Oct 12 2015 00:55
@gratschultz2013 hell to the yeah brother.
Garrett Schultz
@garettschultz
Oct 12 2015 00:56
Thank you @namsir, @NobisPete.
CamperBot
@camperbot
Oct 12 2015 00:56
gratschultz2013 sends brownie points to @namsir and @nobispete :sparkles: :thumbsup: :sparkles:
:star: 24 | @nobispete | http://www.freecodecamp.com/nobispete
:star: 230 | @namsir | http://www.freecodecamp.com/namsir
Jason
@Jauble
Oct 12 2015 00:56
Hey @namsir. I added some js, commented out the old js, saved, and refreshed, but it's still showing the old js and isn't showing what I added. I'm using sublime text. Any ideas?
noobstar
@namsir
Oct 12 2015 00:56
@gratschultz2013 i do research, i keep practicing, i do stuff over and over again until it becomes second nature to me.
Jordan Robertson
@Jordanson
Oct 12 2015 00:56
thanks @namsir and i felt like i am overwriting but thats the only way i know without looking elsewhere but i should do some digging
CamperBot
@camperbot
Oct 12 2015 00:56
jordanson sends brownie points to @namsir :sparkles: :thumbsup: :sparkles:
:star: 231 | @namsir | http://www.freecodecamp.com/namsir
Garrett Schultz
@garettschultz
Oct 12 2015 00:57
I have also read the Javascript definitive guide 6th edidtion as it says its for beginners but I think they are a little off on that lol.
noobstar
@namsir
Oct 12 2015 00:57
@Jauble how did you commented out the old js?
Jason
@Jauble
Oct 12 2015 00:57
/ /
NobisPete
@NobisPete
Oct 12 2015 00:57
@gratschultz2013 Those helped me alot...I notice I can do tutorials forever, and not retain....But if I do just a Lil bit every day of building my own...it all comes together...In other words I think you can read all the books in the world...but unless you apply, its all foggy (at least for me)
Jason
@Jauble
Oct 12 2015 00:57
oops /**/
Garrett Schultz
@garettschultz
Oct 12 2015 00:58
where can I use basic concepts of js to build something? To see the js in action that I write?
noobstar
@namsir
Oct 12 2015 00:58
@Jauble make sure you are refreshing the same page.
Rex Schrader
@SaintPeter
Oct 12 2015 00:58
@gratschultz2013 Have you gotten to the Bonfires yet?
@gratschultz2013 If so, there are a couple of websites that have coding problems
find games
CamperBot
@camperbot
Oct 12 2015 00:59
find games
nothing found
Jordan Robertson
@Jordanson
Oct 12 2015 01:00
help Bonfire: Factorialize a Number
CamperBot
@camperbot
Oct 12 2015 01:00
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
noobstar
@namsir
Oct 12 2015 01:00
without the colins
Garrett Schultz
@garettschultz
Oct 12 2015 01:00
@SaintPeter yes, but i will have to redo them. I will have to redo all off the javasctipt areas because I forget everything the second I leave the page. I have honestly just looked at solutions to every problem because I did not understand how to do it.
Jordan Robertson
@Jordanson
Oct 12 2015 01:00
help Bonfire Factorialize a Number
CamperBot
@camperbot
Oct 12 2015 01:00

:point_right: bonfire factorialize a number [wiki]

The problem

Return the factorial of the provided integer. If the integer is represented with the letter n, a factorial is the product of all positive integers less than or equal to n.

Factorials are often represented with the shorthand notation n!

For example: 5! = 1 * 2 * 3 * 4 * 5 = 120f

:pencil: read more about bonfire factorialize a number on the FCC Wiki

Jordan Robertson
@Jordanson
Oct 12 2015 01:00
thanks
CamperBot
@camperbot
Oct 12 2015 01:00
if you want to thank someone, put an @ before their name!
noobstar
@namsir
Oct 12 2015 01:01
@gratschultz2013 to make you feel better...i don't remember any of the challenges that i did.
Rex Schrader
@SaintPeter
Oct 12 2015 01:01
@gratschultz2013 Ah, yeah, you probably should. If you get those down and are looking for more practice, you can try these sites:
http://www.codewars.com/dashboard, https://www.hackerrank.com/domains
noobstar
@namsir
Oct 12 2015 01:01
@gratschultz2013 but i remember 1 thing.....a solution to that challenge :D
Rex Schrader
@SaintPeter
Oct 12 2015 01:02
@gratschultz2013 If you need help working through the bonfires, this is the place. The trick will be attempting them with a "clean slate" mindset.
CamperBot
@camperbot
Oct 12 2015 01:02
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Garrett Schultz
@garettschultz
Oct 12 2015 01:03
I just want to be able to learn javascript fluently so I can make my Linux machine useful
noobstar
@namsir
Oct 12 2015 01:03
@gratschultz2013 if you put enough time into it, you will :)
Rex Schrader
@SaintPeter
Oct 12 2015 01:03
@gratschultz2013 Here is a list of resources
wiki js resorces
CamperBot
@camperbot
Oct 12 2015 01:04
no wiki entry for: js resorces
:pencil: click here to create one now!after creating your page type update to reload it here
Rex Schrader
@SaintPeter
Oct 12 2015 01:04
wiki js resources
Garrett Schultz
@garettschultz
Oct 12 2015 01:04
@SaintPeter what is codewars? and does hackerrank help with javascript stuff?
Rex Schrader
@SaintPeter
Oct 12 2015 01:04
@gratschultz2013 They are basically code practice sites. They are like Bonfires, for fun
noobstar
@namsir
Oct 12 2015 01:04
@SaintPeter codewars is pretty awesome :D thanks bro
CamperBot
@camperbot
Oct 12 2015 01:04
namsir sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
Jason
@Jauble
Oct 12 2015 01:04
@namsir Apparently the last thing I did last night was change the name of the js file, and I forgot to update it in the html and delete the old file lol
CamperBot
@camperbot
Oct 12 2015 01:04
:star: 982 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Oct 12 2015 01:05
@gratschultz2013 If you click through to the Wiki above, there are a BUNCH of sites and resources for you
noobstar
@namsir
Oct 12 2015 01:05
@Jauble lol....i was thinking about the same thing.....
Rex Schrader
@SaintPeter
Oct 12 2015 01:05
@namsir :D - join team "Free Code Camp" ;)
Garrett Schultz
@garettschultz
Oct 12 2015 01:05
okay because codewars just has a sign in page and doesnt say anything about it
noobstar
@namsir
Oct 12 2015 01:05
@SaintPeter it is helpful....it's kinda like a game for developer :D
Rex Schrader
@SaintPeter
Oct 12 2015 01:05
@gratschultz2013 try the base url: http://codewars.com
noobstar
@namsir
Oct 12 2015 01:06
@SaintPeter any other useful sites? :D
Garrett Schultz
@garettschultz
Oct 12 2015 01:07
is codewars free
Rex Schrader
@SaintPeter
Oct 12 2015 01:07
@namsir Check out the Wiki link above - there are a ton
@gratschultz2013 It is
@gratschultz2013 Word of warning: If you can't do the Bonfires, it'll probably be too hard for you
noobstar
@namsir
Oct 12 2015 01:08
damn that's cold lol
@SaintPeter i've seen javascript understanding the weird parts.....awesome tuts.
Rex Schrader
@SaintPeter
Oct 12 2015 01:09
@namsir Well . . better he knows up front. I want to set expectations, not be mean.
noobstar
@namsir
Oct 12 2015 01:09
@SaintPeter i might have to go back and review it couple more times lol
@SaintPeter i got it but then i forget it ;x
Garrett Schultz
@garettschultz
Oct 12 2015 01:10
@SaintPeter ya codewars isnt going to work for me, its making me prove my skills before I can even join and I have no idea what im doing.
Rex Schrader
@SaintPeter
Oct 12 2015 01:11
@namsir @gratschultz2013 In my opinion, the best way to learn to code is by WRITING code. No amount of book reading will teach you what you can learn by just trying to make something work. I enjoy puzzles, and code is basically just one big puzzle games. I used to play a lot of MMOs, but I inevitably ended up writing a website or a mapping program or a planner or something, rather than playing the games themselves. If you love a good challenge, then coding is it.
@gratschultz2013 Starting back at "Reverse a String" and moving forward may be the only way.
@gratschultz2013 You need to commit to yourself to just ask for help, rather than googling an answer.
@gratschultz2013 There are a lot of great/active folks here who may be able to help you make heads or tails of it
noobstar
@namsir
Oct 12 2015 01:12
@SaintPeter oh yeah...i love these challenges....took me hours sometimes to figure 1 problem out :D
Jordan Robertson
@Jordanson
Oct 12 2015 01:13
It's natural to be pretty lost by time i get to the bonfires right? @SaintPeter bc the solution to the factorialize one deals with recursion. well, the ideal solution at least. i was working on my own but it was too lengthy compared to the answer on the wiki. and i really do not understand the answer at all but i'm reading up on it. I just started this so i know i need to be patient and diligent but i feel like fcc hasn't taught the concepts well. thoughts? sorry for grammar. terrible typer lol
Jelani Thompson
@JelaniThompson
Oct 12 2015 01:13
Hey guys
So I'm almost finished the Random Quote Generator CodePen project
But I'm trying to do the bonus user story
noobstar
@namsir
Oct 12 2015 01:13
@Jordanson you can do it without recursion.
Jelani Thompson
@JelaniThompson
Oct 12 2015 01:13
Here's what I tried doing to get the tweet button to work
Garrett Schultz
@garettschultz
Oct 12 2015 01:13
I am going to go back and redo all the js tutorials from the beginning and keep trying each one different ways until each concept gets embedded into my head.
Jelani Thompson
@JelaniThompson
Oct 12 2015 01:13
<a class ="twitter-share-button" href="https://twitter.com/intent/tweet?text" + encodeURIComponent(quote.quote + ' - ' + quote.author);>Tweet</a>
Rex Schrader
@SaintPeter
Oct 12 2015 01:13
@Jordanson Yes, it's totally normal to be overwhelmed. See This Article.
Jelani Thompson
@JelaniThompson
Oct 12 2015 01:13
Does anyone know why the tweet is still displaying the codepen title?
noobstar
@namsir
Oct 12 2015 01:14
@Jordanson here how i learn.....i figure out myself by start coding.....when i did it....i go and research or ask people if there's a way to improve it....and learn from it
Rex Schrader
@SaintPeter
Oct 12 2015 01:14
@Jordanson Secondly: Don't worry if your solution is big and bulky and weird. Move on. Premature optimization is the root of all evil. You can ask for help in the /CodeReview section, but it' better, in my opinion, to move on to the next ones and try to solve them.
@Jordanson Listen, if you were learning to paint, you wouldn't expect to paint the Mona Lisa after a month or two, right? Coding is a skill. If you're comparing your clunky for loop against one my my optimized solutions (that, honestly, I've been working on for a month becuase I've been helping everyone and their brother on it), then it's like comparing your finger paints to a grand master. Don't do it!
noobstar
@namsir
Oct 12 2015 01:16
@SaintPeter lol wow....codewars test your skills first before you can sign up? lol cool.
Rex Schrader
@SaintPeter
Oct 12 2015 01:16
@JelaniThompson Lemme take a look
Jelani Thompson
@JelaniThompson
Oct 12 2015 01:17
@SaintPeter Here ya go
Rex Schrader
@SaintPeter
Oct 12 2015 01:17
@JelaniThompson Got a URL for me?
Jelani Thompson
@JelaniThompson
Oct 12 2015 01:17
Yep ^
noobstar
@namsir
Oct 12 2015 01:17
i really appreciate all of you guys doing this for free :D
i admired yall. :smile:
Jordan Robertson
@Jordanson
Oct 12 2015 01:17
alright thanks guys. im gonna continue with my solution and improve upon it. y'all are absolutely right. i just need to be patient. i cannot expect to get this in a matter of weeks.
CamperBot
@camperbot
Oct 12 2015 01:17
if you want to thank someone, put an @ before their name!
Rex Schrader
@SaintPeter
Oct 12 2015 01:18
@Jordanson If you want a critique of your solution, I can give one. Or suggest areas to improve
wiki help rooms
CamperBot
@camperbot
Oct 12 2015 01:18

:point_right: help rooms [wiki]

There are official help rooms for each major section of FCC content:

Chat Room Description
Help get help with our Waypoint challenges from your fellow campers
HelpBonfires get help with our Bonfire challenges from your fellow campers
HelpZiplines get help with our Zipline 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
CodeReview get constructive criticism and advice on finished code from your fellow campers
YouCanDoThis learning to code is hard - share your feelings and get moral support here

Choose the right room for your question!
:pencil: read more about help rooms on the FCC Wiki

noobstar
@namsir
Oct 12 2015 01:18
@Jordanson yeah coding is fun and sure takes a long time to be good at it :D
Rex Schrader
@SaintPeter
Oct 12 2015 01:18
@Jordanson Ask in "CodeReview" so we don't spoiler it for other viewers here
@JelaniThompson ok, I know the issue:
Jelani Thompson
@JelaniThompson
Oct 12 2015 01:18
Oh?
Jordan Robertson
@Jordanson
Oct 12 2015 01:19
im loving it so far and the challenge is great. @thanks @namsir @SaintPeter
CamperBot
@camperbot
Oct 12 2015 01:19
jordanson sends brownie points to @thanks and @namsir and @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for thanks
:star: 983 | @saintpeter | http://www.freecodecamp.com/saintpeter
:warning: jordanson already gave namsir points
Rex Schrader
@SaintPeter
Oct 12 2015 01:19
@JelaniThompson You are using Twitter's js code, which creates the button. The problem is that it creates it by embedding an iframe which points to twitter itself. It is not possible to modify HTML elements from another page (inside an iframe) from your page.
Jordan Robertson
@Jordanson
Oct 12 2015 01:19
lol i said @thanks wth
CamperBot
@camperbot
Oct 12 2015 01:19
jordanson sends brownie points to @thanks :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for thanks
Rex Schrader
@SaintPeter
Oct 12 2015 01:20
@JelaniThompson The solution is to roll your own button.
noobstar
@namsir
Oct 12 2015 01:20
@Jordanson as long as you love doing what you are doing...you will be good one day :)
Rex Schrader
@SaintPeter
Oct 12 2015 01:20
@JelaniThompson Looks like you've got the right code for the twitter intent tweet
@Jordanson It works when you say "thanks" and anyone @mentioned in the comment gets a thanks. So . . Thanks for your service :D
CamperBot
@camperbot
Oct 12 2015 01:20
saintpeter sends brownie points to @jordanson and @mentioned :sparkles: :thumbsup: :sparkles:
Jelani Thompson
@JelaniThompson
Oct 12 2015 01:20
By roll your own button, do you mean just a simple <a></a> without the Twitter JS?
CamperBot
@camperbot
Oct 12 2015 01:20
:warning: could not find receiver for mentioned
:star: 175 | @jordanson | http://www.freecodecamp.com/jordanson
Rex Schrader
@SaintPeter
Oct 12 2015 01:21
@JelaniThompson Correct. You can get an icon from Font Awesome and style the link as a button using bootstrap
Jelani Thompson
@JelaniThompson
Oct 12 2015 01:21
@SaintPeter Thanks so much :D
CamperBot
@camperbot
Oct 12 2015 01:21
jelanithompson sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 984 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Oct 12 2015 01:22
@JelaniThompson ie: <a class="btn btn-primary" href="<twitter link here>">some icon</a>
@JelaniThompson :D
Anyone waiting for help?
noobstar
@namsir
Oct 12 2015 01:24
@SaintPeter i'm working on sumPrimes....figured out how to check for if the input is a prime number or not.
bonfire sum all primes
CamperBot
@camperbot
Oct 12 2015 01:25

:fire:Bonfire: Sum All Primes :link:

function sumPrimes(num) {
  return num;
}

sumPrimes(10);

Sum all the prime numbers up to and including the provided number.

more info:  bf details | bf links | hint

noobstar
@namsir
Oct 12 2015 01:25
now i just sitting duck here don't know what to do next lol
brian farts.
Rex Schrader
@SaintPeter
Oct 12 2015 01:26
@namsir Well . . . get a list of primes . . . sum them up?
noobstar
@namsir
Oct 12 2015 01:26
@SaintPeter Ahhhhh there's a light bulb LOL
Rex Schrader
@SaintPeter
Oct 12 2015 01:27
@namsir You basically just start at 1, then increment your number by at least 2 each time, check if it's prime, add it to the sum . . . keep going until your next prime is larger than num
noobstar
@namsir
Oct 12 2015 01:27
@SaintPeter thanks :D
CamperBot
@camperbot
Oct 12 2015 01:27
namsir sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: namsir already gave saintpeter points
Jelani Thompson
@JelaniThompson
Oct 12 2015 01:28
@SaintPeter Hey! I tried your advice and I plan on styling it similarly to the red/white button I have the generates the new quote
But is there something here that I missed when taking your advice?
noobstar
@namsir
Oct 12 2015 01:30
wow codewars is awesome :D
Rex Schrader
@SaintPeter
Oct 12 2015 01:32
@JelaniThompson Are you using bootstrap?
Jelani Thompson
@JelaniThompson
Oct 12 2015 01:33
nahpo
Just jQuery, haha
Jordan Robertson
@Jordanson
Oct 12 2015 01:33
function factorialize(num) { return num; } factorialize(0); function factorialize(num) { var fac2 = 1 return fac2 } factorialize(5); function factorialize(num) { var product = 1*2*3*4*5 return product } factorialize(10); function factorialize(num) { var fac2 = 1*2*3*4*5*6*7*8*9*10 return fac2 } factorialize(20); function factorialize(num) { var fac2 = 1*2*3*4*5*6*7*8*9*10*11*12*13*14*15*16*17*18*19*20 return fac2 }what do i need to change so it will distinguish between each function?
Rex Schrader
@SaintPeter
Oct 12 2015 01:33
@JelaniThompson ok, all that styling you have applied to your .shuffle? Apply it to some new class for your twitter button
Jordan Robertson
@Jordanson
Oct 12 2015 01:33
wth
```
function factorialize(num) {
  return num;
}
factorialize(0);
function factorialize(num) {
var fac2 = 1
return fac2
}
factorialize(5);
function factorialize(num) {
var product = 1*2*3*4*5
return product
}
factorialize(10);
function factorialize(num) {
var fac2 = 1*2*3*4*5*6*7*8*9*10
return fac2
}
factorialize(20);
function factorialize(num) {
var fac2 = 1*2*3*4*5*6*7*8*9*10*11*12*13*14*15*16*17*18*19*20
return fac2
}
Rex Schrader
@SaintPeter
Oct 12 2015 01:34
@Jordanson Ah, ok, you've hard coded your solutions
Jelani Thompson
@JelaniThompson
Oct 12 2015 01:34
@SaintPeter Will that affect the actual linking or?
Rex Schrader
@SaintPeter
Oct 12 2015 01:34
@SaintPeter Do a display: inline-block for both buttons to have them side by side.
@JelaniThompson Nope
@JelaniThompson You may need to set text-decoration: none to get rid of the underline.
Jordan Robertson
@Jordanson
Oct 12 2015 01:35
yeah pretty ugly. it's only checking the last function
Rex Schrader
@SaintPeter
Oct 12 2015 01:35
@Jordanson ok . . . so . . . You clearly know how to calculate a factorial manually. You'll note that there is a common theme there, that you're counting from 1 to num.
@Jordanson Can you think of a way to count from 1 to num without writing out all of the numbers manually? Some sort of control structure to do that?
Bettina Schaden
@bSchaden
Oct 12 2015 01:36
Waypoint: Target Even Numbered Elements Using jQuery
help Waypoint: Target Even Numbered Elements Using jQuery
CamperBot
@camperbot
Oct 12 2015 01:37

:point_right: waypoint target even numbered elements using jquery [wiki]

Target Even Numbered Elements Using jQuery

You can also target all the even-numbered elements.

Here's how you would target all the odd-numbered elements with class target and give them classes: $('.target:odd').addClass('animated shake');

This will shake all the even ones: $('.target:even').addClass("shake");

:pencil: read more about waypoint target even numbered elements using jquery on the FCC Wiki

Rex Schrader
@SaintPeter
Oct 12 2015 01:37
@Jordanson The idea is to solve the problem in the general case - that you wouldn't know what your num was going to be ahead of time.
Bettina Schaden
@bSchaden
Oct 12 2015 01:38
So, when I target :even does it start counting from 0? Is that why the first one shakes?
Rex Schrader
@SaintPeter
Oct 12 2015 01:39
@bschaden "In particular, note that the 0-based indexing means that, counter-intuitively, :even selects the first element, third element, and so on within the matched set."
Bettina Schaden
@bSchaden
Oct 12 2015 01:41
@SaintPeter thanks. That's what I thought. :+1:
CamperBot
@camperbot
Oct 12 2015 01:41
bschaden sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 985 | @saintpeter | http://www.freecodecamp.com/saintpeter
Jordan Robertson
@Jordanson
Oct 12 2015 01:46
can i use math.floor min max @SaintPeter?
Rex Schrader
@SaintPeter
Oct 12 2015 01:47
@Jordanson I don't think that would be helpful. You need to count. Do you recall how you might count from 1 to num?
Jordan Robertson
@Jordanson
Oct 12 2015 01:47
I don't. it can be found in that waypoint you linked?
Can anyone help me with figuring out why my plus button on my calculator is below, rather than next to, the other buttons it should line up with? The CodPen is here: http://codepen.io/BenBagBag/pen/zvdYwR?editors=110
Jelani Thompson
@JelaniThompson
Oct 12 2015 01:52
@SaintPeter Using inline-block on both of them just makes them align to the left
should I just put them both into a div and center that?
Mark T. Graybill
@Boolean-Operator
Oct 12 2015 01:57
bonfire: title case a sentence
CamperBot
@camperbot
Oct 12 2015 01:57

:fire:Bonfire: Title Case a Sentence :link:

function titleCase(str) {
  return str;
}

titleCase("I'm a little tea pot");

Return the provided string with the first letter of each word capitalized.

more info:  bf details | bf links | hint

Mark T. Graybill
@Boolean-Operator
Oct 12 2015 01:58
bf hint
CamperBot
@camperbot
Oct 12 2015 01:58
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Mark T. Graybill
@Boolean-Operator
Oct 12 2015 01:59
This message was deleted
CamperBot
@camperbot
Oct 12 2015 01:59
if you want to thank someone, put an @ before their name!
Mark T. Graybill
@Boolean-Operator
Oct 12 2015 02:00
This message was deleted
CamperBot
@camperbot
Oct 12 2015 02:00
if you want to thank someone, put an @ before their name!
Mark T. Graybill
@Boolean-Operator
Oct 12 2015 02:13
This message was deleted
Rex Schrader
@SaintPeter
Oct 12 2015 02:13
@JelaniThompson I think so?
Mark T. Graybill
@Boolean-Operator
Oct 12 2015 02:15
I'm working on BF:title case a sentence and getting an error on the array.join(); is not function. Can someone tell me what I'm doing wrong ?
function titleCase(str) {
  //split sting into an array
  var stringArray = str.split(" ");
  //make entire word lower case and capitalize the first letter 

  for (var i = 0; i < stringArray.length; i++) {
    var word = stringArray[i];
    var wordCap = word.toLowerCase();
    var firstLetter = wordCap.charAt(0);
    firstLetter = firstLetter.toUpperCase();
    var wordCap = wordCap.replace(wordCap.charAt(0), firstLetter);

    //create new array of capitalize words
    var array = new Array();
    array[i] = array.push(wordCap);

    }

  //Join array back into a string and return string  
  var newString = array.join(' ');
  return newString;

}

titleCase("I'm a little tea pot", "");
Rex Schrader
@SaintPeter
Oct 12 2015 02:19

@Boolean-Operator At least part of the problem is that you're re-initializing array every time you loop. You only need to initalize it once:

var array = [];

Also: Don't use array as a variable name. Use arr or something else. array is much too close to a reserved word of Array and should not be used.

Abhisek Pattnaik
@abhisekp
Oct 12 2015 02:21
@Boolean-Operator Better not to use either array or arr. Use a proper descriptive name.
Rex Schrader
@SaintPeter
Oct 12 2015 02:23
@Boolean-Operator The point I may have failed to convey is that you need to inalize it BEFORE your loop. If you do it IN the loop you're going to blow it away every time.
Secondly: When you say array[i[ = array.push(wordCap), you're doing something really odd. .push returns a number not a new array. push MODIFIES the array it is used on. But I don't understany why you are pushing anything at all. Just set:
stringArray[i] = wordCap;
Bret Reynoso
@breyn407
Oct 12 2015 02:24
array.push(wordCap); will push wordCap into array. array[i] = array.push(wordCap);
oops
Mark T. Graybill
@Boolean-Operator
Oct 12 2015 02:24
Thanks @SaintPeter . That was the problem.
CamperBot
@camperbot
Oct 12 2015 02:24
boolean-operator sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 986 | @saintpeter | http://www.freecodecamp.com/saintpeter
Bret Reynoso
@breyn407
Oct 12 2015 02:25
nm my entry, i though i was in markup mode
Mark T. Graybill
@Boolean-Operator
Oct 12 2015 02:25
@SaintPeter Those were the two pieces to the puzzle I was missing.
Bret Reynoso
@breyn407
Oct 12 2015 02:26

I just found that out myself on the bonfires: typeof array.push(wordCap) is a number

whereas using array.push(wordcap) by itself will execute the push

Bret Reynoso
@breyn407
Oct 12 2015 02:33
camperbot, how do i edit an entry?
hello camperbot
One of these days I’ll figure out how that thing works…
Mark Howard
@iheartkode
Oct 12 2015 02:34
This message was deleted
var energy = 50;

// carpentry
var carpentry = {
    skillPoints: 0,
};

var couch = {
    skillPoints: 5,
    energyNeeded: 30
};

var almostNiceCouch = {
    skillPoints: 10,
    energyNeeded: 35
};


if(energy > couch.energyNeeded) {
    console.log("You Created a Couch.. ");
    carpentry.skillPoints += couch.skillPoints;
    console.log("Your carpentry is now " + carpentry.skillPoints); 
}else{
    console.log("You do not have enough energy..");
}
My carpentry skill lol
Abhisek Pattnaik
@abhisekp
Oct 12 2015 02:36
@breyn407
explain edit
CamperBot
@camperbot
Oct 12 2015 02:36

:point_right: edit or delete message [wiki]

Editing or Deleting a previous message within 5 mins. of posting

How to delete message
:pencil: read more about edit or delete message on the FCC Wiki

Bret Reynoso
@breyn407
Oct 12 2015 02:38
Excellent! Now I see. Cool, thanks @abhisekp
CamperBot
@camperbot
Oct 12 2015 02:38
breyn407 sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 578 | @abhisekp | http://www.freecodecamp.com/abhisekp
Mark T. Graybill
@Boolean-Operator
Oct 12 2015 02:40
@breyn407 Use the three little dots at the right side of your post. I understand what you mean. I had more difficulty posting my code in the correct format than I did getting my JS code 85% done.
Richard Cox
@RickCoxDev
Oct 12 2015 02:43
bonfire falsy bouncer
CamperBot
@camperbot
Oct 12 2015 02:43
Sorry, can't find a bonfire called falsy bouncer. [ Check the map? ]
Richard Cox
@RickCoxDev
Oct 12 2015 02:43
bonfire falsy
CamperBot
@camperbot
Oct 12 2015 02:43
Sorry, can't find a bonfire called falsy. [ Check the map? ]
Abhisek Pattnaik
@abhisekp
Oct 12 2015 02:44
bf bouncer
CamperBot
@camperbot
Oct 12 2015 02:44

:fire:Bonfire: Falsey Bouncer :link:

function bouncer(arr) {
  // Don't show a false ID to this bouncer.
  return arr;
}

bouncer([7, 'ate', '', false, 9]);

Remove all falsey values from an array.

more info:  bf details | bf links | hint

Abhisek Pattnaik
@abhisekp
Oct 12 2015 02:44
@Stackclash :point_up: October 12, 2015 8:14 AM
Patrick Kennedy
@pkennedy89
Oct 12 2015 02:44
Hi Campers, I'm having some issues with the camelcase test in the Spinal Tap case bonfire. Anyone want to take a look at my regex to see where I might be going wrong?
Bret Reynoso
@breyn407
Oct 12 2015 02:44
@Stackclash, I think it is spelled “Falsey”
at least in FCC
Spelled “Falsy” at MDN.
Patrick Kennedy
@pkennedy89
Oct 12 2015 02:45
help spinal tap case
CamperBot
@camperbot
Oct 12 2015 02:45

:point_right: bonfire spinal tap case [wiki]

Problem Explanation:

  • Convert the given string to an all lowercase sentence joined by dashes.
:pencil: read more about bonfire spinal tap case on the FCC Wiki
Richard Cox
@RickCoxDev
Oct 12 2015 02:45
ok thanks. I need some help with this.
CamperBot
@camperbot
Oct 12 2015 02:45
if you want to thank someone, put an @ before their name!
Abhisek Pattnaik
@abhisekp
Oct 12 2015 02:45
@breyn407 no. FCC doesn't spell wrong. The camperbot has not been updated with the proper spelling. The camperbot dev is on vacation.
Richard Cox
@RickCoxDev
Oct 12 2015 02:45
I'm trying to test for NaN but am having a hard time.
Abhisek Pattnaik
@abhisekp
Oct 12 2015 02:46
Richard Cox
@RickCoxDev
Oct 12 2015 02:46
function bouncer(arr) {
  // Don't show a false ID to this bouncer.
  var falsy = [false, null, 0, "", undefined, NaN];
  return arr.filter(
    function (value) {
      return falsy.indexOf(value) == -1;
    }
  );
}

bouncer([7, "ate", "", false, 9]);
Abhisek Pattnaik
@abhisekp
Oct 12 2015 02:46
@Stackclash you can't do NaN === NaN because they are not equal. They will always be false.
Jason
@Jauble
Oct 12 2015 02:47
When i put: document.getElementById('sec').innerHTML = "Test"; in my js file, I get this error:
Cannot set property 'innerHTML' of null. sec is an h1 element. Anyone know what's causing this?
Bret Reynoso
@breyn407
Oct 12 2015 02:47
@abhisekp, I think the Bonfire used to be misspelled.
Abhisek Pattnaik
@abhisekp
Oct 12 2015 02:48
@breyn407 yep! It was corrected later tho.
Bret Reynoso
@breyn407
Oct 12 2015 02:49
@abhisekp. that’s what i thought. I did that bf about 6 weeks ago or so. then just redid it because i took time off.
Richard Cox
@RickCoxDev
Oct 12 2015 02:50
any tips on how to correctly test for this. I tried adding:
return falsy.indexOf(value) == -1 || isNaN(value);
Abhisek Pattnaik
@abhisekp
Oct 12 2015 02:50
@Stackclash btw, always use strict equality ===
Richard Cox
@RickCoxDev
Oct 12 2015 02:51
but that returned just the numbers and not the strings.
Abhisek Pattnaik
@abhisekp
Oct 12 2015 02:52
@Stackclash use Number.isNaN instead of isNaN (just a good practice) -- doesn't solve the problem tho.
@Stackclash "" (empty string) is a falsy value
explain falsy
CamperBot
@camperbot
Oct 12 2015 02:53

:point_right: bonfire falsy bouncer [wiki]

Problem Explanation:

Remove all falsy values from an array.

:pencil: read more about bonfire falsy bouncer on the FCC Wiki

Abhisek Pattnaik
@abhisekp
Oct 12 2015 02:53
explain js falsy
CamperBot
@camperbot
Oct 12 2015 02:53
no wiki entry for: js falsy
:pencil: click here to create one now!after creating your page type update to reload it here
Abhisek Pattnaik
@abhisekp
Oct 12 2015 02:53
find falsy
CamperBot
@camperbot
Oct 12 2015 02:53

find falsy

:zero: bonfire falsy bouncer

Abhisek Pattnaik
@abhisekp
Oct 12 2015 02:53
find falsey
CamperBot
@camperbot
Oct 12 2015 02:53

find falsey

:zero: bonfire falsey bouncer
:one: js falsey

Abhisek Pattnaik
@abhisekp
Oct 12 2015 02:54
1
CamperBot
@camperbot
Oct 12 2015 02:54

:point_right: js falsey [wiki]

Something which evaluates to FALSE. There are only five falsey values in JavaScript:
undefined, null, NaN, 0, "" (empty string), and false of course.

See also: truthy | Truthy & Falsey blog post
:pencil: read more about js falsey on the FCC Wiki

Abhisek Pattnaik
@abhisekp
Oct 12 2015 02:55
@Stackclash :point_up: October 12, 2015 8:24 AM
Becky
@martinbeks
Oct 12 2015 02:56
In "Modify Array Data with Indexes," does anyone know what "You should be using correct index to modify the value in myArray." means? I keep switching it up, using numbers 0-2, but nothing is working. I can't get it.
Richard Cox
@RickCoxDev
Oct 12 2015 02:56
@abhisekp yeah I have the empty string working.
Jason
@Jauble
Oct 12 2015 02:57
@abhisekp :point_up: October 11, 2015 7:47 PM Any idea?
Abhisek Pattnaik
@abhisekp
Oct 12 2015 02:58
@Stackclash I don't understand why you've written this return falsy.indexOf(value) == -1;
falsy.indexOf(value) == -1 will always be false
pwdd
@pwdd
Oct 12 2015 02:58
This message was deleted
Abhisek Pattnaik
@abhisekp
Oct 12 2015 02:58
@Jauble show the html code
Jason
@Jauble
Oct 12 2015 02:59
<h1 id="sec"></h1>
Richard Cox
@RickCoxDev
Oct 12 2015 03:00
.indexOf() was taught a couple of bonfires ago. So I thought it would be good to practice with by creating an array of the "falseys" that I want to remove from the original array passed in.
@abhisekp :point_up:
Abhisek Pattnaik
@abhisekp
Oct 12 2015 03:03
@Stackclash sure.. :+1: But it will never match NaN
@Jauble you're not checking for DOMContentLoaded event before accessing the DOM
David Bouwkamp
@DavidBouw
Oct 12 2015 03:05
bf chunky monkey
CamperBot
@camperbot
Oct 12 2015 03:05

:fire:Bonfire: Chunky Monkey :link:

function chunk(arr, size) {
  // Break it up.
  return arr;
}

chunk(['a', 'b', 'c', 'd'], 2);

Write a function that splits an array (first argument) into groups the length of size (second argument) and returns them as a multidimensional array.

more info:  bf details | bf links | hint

Abhisek Pattnaik
@abhisekp
Oct 12 2015 03:05

@Stackclash I guess this should work

return falsy.indexOf(value) == -1 || !isNaN(value);

NOTE: NOT operator on isNaN

Richard Cox
@RickCoxDev
Oct 12 2015 03:06
return falsy.indexOf(value) == -1 || isNaN(value);
Bret Reynoso
@breyn407
Oct 12 2015 03:07

@martinbeks, the waypoint says:

Now modify the data stored at index 0 of myArray to the value of 3.

Richard Cox
@RickCoxDev
Oct 12 2015 03:07
@abhisekp :point_up: yeah I tried that. But if there is any non number element in the array it gets removed. i.e. strings
Bret Reynoso
@breyn407
Oct 12 2015 03:07
@martinbeks, what does your code look like?
Abhisek Pattnaik
@abhisekp
Oct 12 2015 03:08
This message was deleted
Becky
@martinbeks
Oct 12 2015 03:09
@martinbeks, what does your code look like?
var myArray = [3,2,3]; myArray[2] = 3
Richard Cox
@RickCoxDev
Oct 12 2015 03:10
I got it working. It's probably a lot more complicated than it should be but it works.
function bouncer(arr) {
  // Don't show a false ID to this bouncer.
  var falsy = [false, null, 0, "", undefined, NaN];
  return arr.filter(
    function (value) {
      if (typeof(value) === "number") {
        return !Number.isNaN(value) && value !== 0;
      }
      else {
        return falsy.indexOf(value) === -1;
      }
    }
  );
}

bouncer([false, null, 0, NaN, undefined, ""]);
Abhisek Pattnaik
@abhisekp
Oct 12 2015 03:10
@Stackclash There is another easy method to solve it but let's continue with your code... :+1:
Richard Cox
@RickCoxDev
Oct 12 2015 03:11
not readable at all. lol
thanks @abhisekp
CamperBot
@camperbot
Oct 12 2015 03:11
stackclash sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 579 | @abhisekp | http://www.freecodecamp.com/abhisekp
Bret Reynoso
@breyn407
Oct 12 2015 03:11

@martinbeks, on my screen, it looks like the

var myArray = [1,2,3];

should not be changed

Abhisek Pattnaik
@abhisekp
Oct 12 2015 03:11
@Stackclash You might <3 this
function bouncer(arr) {
  // Don't show a false ID to this bouncer.
  // I've a hammer fist.
  return arr.filter(Boolean);
}
Richard Cox
@RickCoxDev
Oct 12 2015 03:12
@abhisekp LOL! WOW! that's a lot simpler!
Abhisek Pattnaik
@abhisekp
Oct 12 2015 03:12
@Stackclash Here is another one
function bouncer(arr) {
  // Don't show a false ID to this bouncer.
  // I've a hammer fist.
  var filtered = [];
  for(var i = 0; i < arr.length; i++) {
    if(Boolean(arr[i])) {
      filtered.push(arr[i]);
    }
  }

  return filtered;
}
@Stackclash note that the 2nd one is approximately implementation of the filter method internally.
Richard Cox
@RickCoxDev
Oct 12 2015 03:14
@abhisekp yeah I see it now there were two links in the bonfire. .filter() and Boolean objects. I didn't look at the Boolean thinking, "I don't need to look at that, I know what a Boolean is." lol
Becky
@martinbeks
Oct 12 2015 03:17
@breyn407 If I don't change that to myArray = [1,2,3]; the other part of the assignment won't get the green checkmark by it. It's the second half of the problem I can't figure out.
Bret Reynoso
@breyn407
Oct 12 2015 03:18

@martinbeks, also your line:

myArray[2] = 3;

is changing myArray at index 2. the instructions indicate you should be changing index 0

@martinbeks, if you leave the first line alone (you’re not actually supposed to modify that line), then you can fix it with a single correction of the line I just showed
Abhisek Pattnaik
@abhisekp
Oct 12 2015 03:19

@Stackclash

Always the known ones back stab :P

Bret Reynoso
@breyn407
Oct 12 2015 03:20
i.e. put back:
var myArray = [1,2,3];
Becky
@martinbeks
Oct 12 2015 03:20
@breyn407 Here is all I have. The only part I 've changed is the last line:
var ourArray = [1,2,3];
ourArray1 = 3;
// ourArray now equals [1,3,3].
var myArray = [1,2,3];
// Only change code below this line.
myArray = [3,2,3]; myArray2 = 3 <--All I've changed.
That blue 2 should be bracketed.
Bret Reynoso
@breyn407
Oct 12 2015 03:21
@martinbeks, your “ourArray” is missing square brackets
ok
you don’t need:
myArray = [3,2,3];
it is already defined 2 lines above
then check your index (the blue 2) with the instructions
Becky
@martinbeks
Oct 12 2015 03:23
If I take that away, then I can't go on. These are the instructions:
"myArray should now be [3,2,3].
You should be using correct index to modify the value in myArray."
When I take that line away, the first part of the assignment is still exed out in red.
Bret Reynoso
@breyn407
Oct 12 2015 03:24
yep
because your index should not be 2
Becky
@martinbeks
Oct 12 2015 03:24
Ok. GOt it. Thanks.
CamperBot
@camperbot
Oct 12 2015 03:24
if you want to thank someone, put an @ before their name!
Becky
@martinbeks
Oct 12 2015 03:25
@breyn407 thanks. That was frustrating, but now I think I get it.
CamperBot
@camperbot
Oct 12 2015 03:25
martinbeks sends brownie points to @breyn407 :sparkles: :thumbsup: :sparkles:
:star: 249 | @breyn407 | http://www.freecodecamp.com/breyn407
Bret Reynoso
@breyn407
Oct 12 2015 03:26
@martinbeks, let us know if it works :smile:
Becky
@martinbeks
Oct 12 2015 03:27
It did. Index 0. I could've sworn I tried that, too. Sometimes the most obvious answer seems too easy to be true, making me overthink this. I'll get it someday. ;)
Bret Reynoso
@breyn407
Oct 12 2015 03:28
the way you were describing it, you did try 0. however, you still had that superfluous “myArray = [3,2,3];” which was throwing it off
Becky
@martinbeks
Oct 12 2015 03:29
Ah. I see. Like I said. Obvious answers lead to me overthinking. B)
David Bouwkamp
@DavidBouw
Oct 12 2015 03:35
This message was deleted
Jason
@Jauble
Oct 12 2015 03:43
@abhisekp Thanks
CamperBot
@camperbot
Oct 12 2015 03:43
jauble sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 580 | @abhisekp | http://www.freecodecamp.com/abhisekp
Preston Porter
@code7777
Oct 12 2015 03:46
I'm having trouble doing the reverse a string bonfire can anyone help me out?
h4r1m4u
@h4r1m4u
Oct 12 2015 03:47
@code7777 what do you need?
Preston Porter
@code7777
Oct 12 2015 03:48
I guess i can show you what I have

function reverseString(str) {

return str;
}

var a0r =reverseString.split("hello", "");

well first im trying to split the String
then store it into an array
bruglesco
@bruglesco
Oct 12 2015 03:49
well thats what they give you to start
h4r1m4u
@h4r1m4u
Oct 12 2015 03:49
@code7777 you should only be modifying the code within the function
Preston Porter
@code7777
Oct 12 2015 03:50
oh okay
VeeShostak
@VeeShostak
Oct 12 2015 03:50

'''
function reverseString(str) {

// CODE HERE

return str;
}

reverseString("hello", "");
'''

CamperBot
@camperbot
Oct 12 2015 03:50
:bulb: to format code use backticks! ``` more info
h4r1m4u
@h4r1m4u
Oct 12 2015 03:50
the goal of the exercise is to write a function that, when supplied with a string, will return it reversed
VeeShostak
@VeeShostak
Oct 12 2015 03:50
place your code in the function
leave everything else @code7777
h4r1m4u
@h4r1m4u
Oct 12 2015 03:50
as veeshostak says
Preston Porter
@code7777
Oct 12 2015 03:51
alrighty I'll give it a shot thanks for the guidence! :D
CamperBot
@camperbot
Oct 12 2015 03:51
if you want to thank someone, put an @ before their name!
bruglesco
@bruglesco
Oct 12 2015 03:51
you want to return str so...
str = whatever you need to do to reverse originale string
Preston Porter
@code7777
Oct 12 2015 03:55
i tried splitting the string by storing it into an array like var array1 =reverseString.split(); but it says reverseString.split(); is not a function .
DJ
@qualitymanifest
Oct 12 2015 03:55
@bruglesco i mean, he could return a0r if he had put it within the function and corrected the code... but yeah, no good reason to
Preston Porter
@code7777
Oct 12 2015 03:55
i mean a0r
DJ
@qualitymanifest
Oct 12 2015 03:56
@code7777 you need to split str into individual characters, then reverse, then join those characters back together and return that
@code7777 read all the "helpful links". you're using split, which is one of them... but you need to use all of them
Preston Porter
@code7777
Oct 12 2015 03:57
@qualitymanifest yea thats what I'm trying to do I'm just having trouble putting it in code form
DJ
@qualitymanifest
Oct 12 2015 03:58
@code7777 all you're accomplishing by using .split is making the input, say, "hello", an array of individual characters like [h,e,l,l,o]
can you post your current code?
(the whole thing)
Preston Porter
@code7777
Oct 12 2015 03:59

sure @qualitymanifest function reverseString(str) {
var a0s = reverseString.split();
return str;
}

reverseString("hello", "");

i had more earlier but i deleted it
DJ
@qualitymanifest
Oct 12 2015 03:59
@code7777 so, first problem, reverseString is the name of the function. not the input
@code7777 str is the input to the function
Preston Porter
@code7777
Oct 12 2015 04:01
ohhh ok
@qualitymanifest

function reverseString(str) {
var a0s = reverseString.split();
a0s =a0s.reverse();
a0s =a0s.join();
reverseString =a0s;
return str;
}

reverseString("hello", "");

DJ
@qualitymanifest
Oct 12 2015 04:01
also, you need to specify WHERE you want to split
Preston Porter
@code7777
Oct 12 2015 04:01
yea i didn't know where to specify should i put a comma
DJ
@qualitymanifest
Oct 12 2015 04:02
nope, you're still trying to split the name of the function
Preston Porter
@code7777
Oct 12 2015 04:02
inside .split(,)
ohhhhh
VeeShostak
@VeeShostak
Oct 12 2015 04:02
also: If an empty string ("") is used as the separator, the string is split between each character. @code7777
DJ
@qualitymanifest
Oct 12 2015 04:03
@VeeShostak i was leading to that ;)
VeeShostak
@VeeShostak
Oct 12 2015 04:03
apologize, you take the lead
Preston Porter
@code7777
Oct 12 2015 04:03
@VeeShostak oh ok ty now i know to use an empty string as a seperator
DJ
@qualitymanifest
Oct 12 2015 04:04
but yeah that wasn't "too much" information, rather just a good tip @VeeShostak
Preston Porter
@code7777
Oct 12 2015 04:05
so should i have var a0s =str.spilt(""); for my first line?
DJ
@qualitymanifest
Oct 12 2015 04:05
split is spelled wrong there, but yes that would work for splitting
Preston Porter
@code7777
Oct 12 2015 04:06
ok
Yay i just figured it out :D thx @qualitymanifest @VeeShostak @bruglesco @h4r1m4u couldn't have done it without you guys!!
CamperBot
@camperbot
Oct 12 2015 04:08
code7777 sends brownie points to @qualitymanifest and @veeshostak and @bruglesco and @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 189 | @veeshostak | http://www.freecodecamp.com/veeshostak
:star: 195 | @bruglesco | http://www.freecodecamp.com/bruglesco
:star: 213 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
:star: 268 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
h4r1m4u
@h4r1m4u
Oct 12 2015 04:08
@code7777 great job! keeep it up
bruglesco
@bruglesco
Oct 12 2015 04:09
bf seek and destroy
CamperBot
@camperbot
Oct 12 2015 04:09

: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

DJ
@qualitymanifest
Oct 12 2015 04:09
@code7777 cool glad it worked out. a tip though - read all the "helpful links" provided. starting at the bonfires, they teach you to teach yourself
CamperBot
@camperbot
Oct 12 2015 04:09
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
bruglesco
@bruglesco
Oct 12 2015 04:11
I find searching the answers a more effective learning experience
The more and more the code is provided for me the less helpful it is
Preston Porter
@code7777
Oct 12 2015 04:12
yea I tried that but I guess i kind of just got confused at this 1 @qualitymanifest
bruglesco
@bruglesco
Oct 12 2015 04:12
yeah that happens too
DJ
@qualitymanifest
Oct 12 2015 04:12
@bruglesco i'm not sure i understand... the two things you just seem to contradict themselves
bruglesco
@bruglesco
Oct 12 2015 04:13
hmm I mean
Mark Howard
@iheartkode
Oct 12 2015 04:13
lol
VeeShostak
@VeeShostak
Oct 12 2015 04:13
I thought that too. But he means searching by yourself I think
lol
bruglesco
@bruglesco
Oct 12 2015 04:13
yes
VeeShostak
@VeeShostak
Oct 12 2015 04:13
haha
DJ
@qualitymanifest
Oct 12 2015 04:13
@bruglesco @VeeShostak oh! in that case...
bruglesco
@bruglesco
Oct 12 2015 04:14
I was getting frustrated with codeacademy because it had me type the code without actually understanding what I was doing
DJ
@qualitymanifest
Oct 12 2015 04:14
i agree. but to a point - the helpful links just point you towards MDN pages where you will learn how to use them. they certainly don't give the the answers
bruglesco
@bruglesco
Oct 12 2015 04:14
but for these bonfires I feel like I have to figure it out as much as I can on my own in order to understand it
I like the links
DJ
@qualitymanifest
Oct 12 2015 04:15
@bruglesco viewing the "helpful links" is learning on your own... they just give you some tiny hints as to where to learn
@bruglesco okay i just misunderstood then :thumbsup:
bruglesco
@bruglesco
Oct 12 2015 04:16
I dont like to ask -- out of fear someone will supply the answer
thats what I was getting at in a very poor way
DJ
@qualitymanifest
Oct 12 2015 04:18
@bruglesco yeah i see that happen here fairly frequently (people just straight up giving solutions)... when i do ask, i specify that i don't want a solution, but rather an idea of what direction to go. usually works
bruglesco
@bruglesco
Oct 12 2015 04:19
good to know
DJ
@qualitymanifest
Oct 12 2015 04:19
@bruglesco where are you at now on FCC?
bruglesco
@bruglesco
Oct 12 2015 04:19
Well for my current BF I am on Seek and Destroy
and I want to understand the filter() method better
It takes a callback function...
DJ
@qualitymanifest
Oct 12 2015 04:20
oh okay i'm just a few past that, if you'd like to pair sometime just send me a PM, i'm on here pretty often
sounds like we have pretty similar attitudes regarding help
bruglesco
@bruglesco
Oct 12 2015 04:21
which one are you on?
so for that should I write the callback function then supply it to the filter method?
David Bouwkamp
@DavidBouw
Oct 12 2015 04:22
bf chunky monkey
CamperBot
@camperbot
Oct 12 2015 04:22

:fire:Bonfire: Chunky Monkey :link:

function chunk(arr, size) {
  // Break it up.
  return arr;
}

chunk(['a', 'b', 'c', 'd'], 2);

Write a function that splits an array (first argument) into groups the length of size (second argument) and returns them as a multidimensional array.

more info:  bf details | bf links | hint

DJ
@qualitymanifest
Oct 12 2015 04:22
i'm kind of doing both waypoints (almost done with the weather zipline) and intermediate bonfires
@bruglesco let me look at seek and destroy again...
David Bouwkamp
@DavidBouw
Oct 12 2015 04:23
function chunk(arr, size) {
  //nest arr into xArray
  var xArray = [][];
  var i = 0;
  while(arr.length > 0){
    for(j = 0; j < size; j++){
      xArray[i][j] = arr.shift();
    }
    i = i+1;
  }

  return xArray;
}

chunk(["a", "b", "c", "d"], 2, "");
How do I fix my xArray initialization? I'm currently getting an Unexpected [ error
h4r1m4u
@h4r1m4u
Oct 12 2015 04:25
@BrainDrainBahrain you don't need to init it as a multiarray
var xArray = [] will do
DJ
@qualitymanifest
Oct 12 2015 04:25
@BrainDrainBahrain yeah just [] works. you still have other problems though
@bruglesco do you wanna send me the code you have right now?
bruglesco
@bruglesco
Oct 12 2015 04:26
no I started over
Let me write some and send it
DJ
@qualitymanifest
Oct 12 2015 04:30
@bruglesco alright. if you want a vague idea, let me know
David Bouwkamp
@DavidBouw
Oct 12 2015 04:30
Where in my code am i setting property '0' of undefined? I'm completely lost on this bug.
function chunk(arr, size) {
  //nest arr into xArray
  var xArray = [];
  var i = 0;
  while(arr.length !== undefined){
    for(j = 0; j < size; j++){
      xArray[i][j] = arr.shift();
    }
    i = i+1;
  }

  return xArray;
}

chunk(["a", "b", "c", "d"], 2, "");
got mixed up between the returns from .from() and .length woops
bruglesco
@bruglesco
Oct 12 2015 04:33
This message was deleted
This message was deleted
David Bouwkamp
@DavidBouw
Oct 12 2015 04:33
still not the fix though
bruglesco
@bruglesco
Oct 12 2015 04:33
function destroyer(arr) {
  // Remove all the values
  function seek(val) {
    return val !== this;
  }
  for (var i = 1; i <= arguments.length; i++) {
  arr.filter(seek, arguments[i])
  }
  return arr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3, "");
Puiyee Tong
@pytong
Oct 12 2015 04:33
@BrainDrainBahrain You can check for arr.length > 0
David Bouwkamp
@DavidBouw
Oct 12 2015 04:35
still getting output
Cannot set property '0' of undefined'
is i a reserved var?
Bret Reynoso
@breyn407
Oct 12 2015 04:39
@BrainDrainBahrain, do you need a “var” in your “for” statement?
it looks like your “j” is undeclared
DJ
@qualitymanifest
Oct 12 2015 04:39
@bruglesco alright i'm trying it out... not making much sense to me currently... in the meantime if you want to see a vague explanation of how i solved it let me know
Bret Reynoso
@breyn407
Oct 12 2015 04:39
…or rather “undefined"
David Bouwkamp
@DavidBouw
Oct 12 2015 04:40
@breyn407 still no good. hmm
Bret Reynoso
@breyn407
Oct 12 2015 04:40
same error?
David Bouwkamp
@DavidBouw
Oct 12 2015 04:40
yea
bruglesco
@bruglesco
Oct 12 2015 04:40
yes vague works
@BrainDrainBahrain share your updated code
David Bouwkamp
@DavidBouw
Oct 12 2015 04:41
This message was deleted
function chunk(arr, size) {
  //nest arr into xArray
  var xArray = [];
  var i = 0;
  while(arr.length > 0){
    for(j = 0; j < size; j++){
      xArray[i][j] = arr.shift();
    }
    i = i+1;
  }

  return xArray;
}

chunk(["a", "b", "c", "d"], 2, "");
DJ
@qualitymanifest
Oct 12 2015 04:41
@bruglesco i made a variable to contain arguments, and inside filter had a for loop checking if that part of the input was equal to that part of that part of my arguments variable. i then returned a boolean primitive (true or false) to filter. i'm sure there's a cleaner way to do it but it works
bruglesco
@bruglesco
Oct 12 2015 04:41
you still need to declare j
David Bouwkamp
@DavidBouw
Oct 12 2015 04:42
function chunk(arr, size) {
  //nest arr into xArray
  var xArray = [];
  var i = 0;
  while(arr.length > 0){
    for(var j = 0; j < size; j++){
      xArray[i][j] = arr.shift();
    }
    i = i+1;
  }

  return xArray;
}

chunk(["a", "b", "c", "d"], 2, "");
Mistereo
@Mistereo
Oct 12 2015 04:42
@BrainDrainBahrain xArray[i] is not defined. Soo you can't do xArray[i][j] =...
bruglesco
@bruglesco
Oct 12 2015 04:42
the for loop was inside filter?
@qualitymanifest
DJ
@qualitymanifest
Oct 12 2015 04:43
@bruglesco yes
David Bouwkamp
@DavidBouw
Oct 12 2015 04:44
@Mistereo so is it illegal to initialize like so?
var xArray = [1];
Mistereo
@Mistereo
Oct 12 2015 04:44
@BrainDrainBahrain nope, xArray[i] should be array.
bruglesco
@bruglesco
Oct 12 2015 04:44
you never bring arr into the function @BrainDrainBahrain
Mistereo
@Mistereo
Oct 12 2015 04:45
@BrainDrainBahrain for each i in your loop.
David Bouwkamp
@DavidBouw
Oct 12 2015 04:45
@bruglesco It's used with .shift()
bruglesco
@bruglesco
Oct 12 2015 04:46
ur right
DJ
@qualitymanifest
Oct 12 2015 04:46
@bruglesco have you tried running your code in something where you can see console.log outputs?
Mistereo
@Mistereo
Oct 12 2015 04:46
@BrainDrainBahrain also please note, that you can get undefined when trying to .shift on empty array.
bruglesco
@bruglesco
Oct 12 2015 04:47
not really @qualitymanifest
DJ
@qualitymanifest
Oct 12 2015 04:49
try this out https://repl.it/BP9w it shows you what trying to use "seek" as an input to filter does
@bruglesco you really don't need the "seek" function at all
bruglesco
@bruglesco
Oct 12 2015 04:56
then what do I need
the filter method is really throwing me
DJ
@qualitymanifest
Oct 12 2015 04:56
also i'm not really sure if you can use a for loop outside filter, since filter does it's own iterating. i only used one input to filter
bruglesco
@bruglesco
Oct 12 2015 04:56
ohh right....
passing a for loop into the filter method itself throws an error though
It wants a callback function
David Bouwkamp
@DavidBouw
Oct 12 2015 05:00
function chunk(arr, size) {
  //nest arr into xArray
  var xArray = [];
  var i = 0;
  var j = 0;
  var count = 0;
  while(arr.length > 0){
     xArray[i] = [];
     if(count === size){
       i++;
       count = 0;
     }
     xArray[i][count] = arr.shift();
     count = count + 1;
  }

  return xArray;
}

chunk(["a", "b", "c", "d"], 2, "");
somehow the line count = count + 1 is causing the error Cannot set property '0' of undefined Why is this happening?
DJ
@qualitymanifest
Oct 12 2015 05:04
@bruglesco
//arguments variable initialized
//return .filter of input: {
//  for loop iterating over arguments variable
//  if filter input is equal to arguments variable,
//  return primitive boolean (true or false), depending
}
@bruglesco any minute now @Mistereo or @dting will come by with a more succinct example ;)
bruglesco
@bruglesco
Oct 12 2015 05:08
well then heres hoping i understand it before then
I wouldnt want it to get easy
1234Matt
@1234Matt
Oct 12 2015 05:11
Hi!
I have a question, how can I install ubuntu on second half of my Harddisc?
I have Already split them when I reinstalled os, but not sure if properly
thanks!
CamperBot
@camperbot
Oct 12 2015 05:12
if you want to thank someone, put an @ before their name!
EtwasShawn
@EtwasShawn
Oct 12 2015 05:12
Hello. I was wondering if someone could identify where I am going wrong here or if this is possibly a bug? This is for Bonfire: Where art though
All tests pass except to return an array of objects. In the results field it shows: [{"a":1,"b":2},{"a":1,"b":2, "c":2}], which looks like an array of objects to me.
function where(collection, source) {
  var arr = [];
  var sourceKeys = Object.keys(source);

  for (var i in collection){  
    var propCount = 0;   
    for(var j in sourceKeys){
      if(collection[i].hasOwnProperty(sourceKeys[j]) === true){
         propCount++;       
         }          
    }      
       if(propCount === sourceKeys.length){
        arr.push(collection[i]);
      }     
  }
  // What's in a name?

  return arr;
}

where([{ "a": 1, "b": 2 }, { "a": 1 }, { "a": 1, "b": 2, "c": 2 }], { "a": 1, "b": 2 });
DJ
@qualitymanifest
Oct 12 2015 05:12
@bruglesco nah they're both good at helping and not providing answers. lots of other people here too. give my version a try though. i gotta go to sleep but, good luck and good night
bruglesco
@bruglesco
Oct 12 2015 05:13
@qualitymanifest thanks
CamperBot
@camperbot
Oct 12 2015 05:13
bruglesco sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 269 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
David Bouwkamp
@DavidBouw
Oct 12 2015 05:28
This message was deleted
CamperBot
@camperbot
Oct 12 2015 05:28
Sorry, can't find a bonfire called chunky monkeyfunction chunkarr size nest arr into xarray var xarray var i 0 var count 0 xarrayi whilearrlength 0 xarrayicount arrshift count ifcount size i ifarrlength 0 else xarrayi count 0 return xarraychunka b c d 2 could someone share an elegant solution to this bf mine is a mess. [ Check the map? ]
Chris Phillips
@christoph-phillips
Oct 12 2015 05:42
Hi guys can anyone help me with a twitter button for my quote generator. I have it working based on changing the a:[data-text] property but it only works once when I press the button for a new quote. It will not change when clicking the button again for a second quote. Cannot find a solution online! Any help greatly appreciated. http://codepen.io/chris_is_phillips/pen/vNJyaj
Lanie Molinar
@LivingForGod1991
Oct 12 2015 05:43
Hi. Can someone please help me figure out what I'm doing wrong? I'm working on Waypoint: Create a Custom Heading. I think I'm doing it right, but it's not working. I'll post my code next.
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

<style>
  h2 {
    font-family: Lobster, Monospace;
  }

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

<div class="container-fluid">
  <div class="row"><h2 class="text-primary text-center"><div class="col-xs-8">CatPhotoApp</div></h2>

  <div class="col-xs-4"><a href="#"><img class="img-responsive thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a></div>
</div>
  <img src="http://bit.ly/fcc-running-cats" class="img-responsive">
  <div class="row">
    <div class="col-xs-4">
      <button class="btn btn-block btn-primary">Like</button>
    </div>
    <div class="col-xs-4">
      <button class="btn btn-block btn-info">Info</button>
    </div>
    <div class="col-xs-4">
      <button class="btn btn-block btn-danger">Delete</button>
    </div>
  </div>
  <p>Things cats <span class="text-danger">love:</span></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>
  <form action="/submit-cat-photo">
    <label><input type="radio" name="indoor-outdoor"> Indoor</label>
    <label><input type="radio" name="indoor-outdoor"> Outdoor</label>
    <label><input type="checkbox" name="personality"> Loving</label>
    <label><input type="checkbox" name="personality"> Lazy</label>
    <label><input type="checkbox" name="personality"> Crazy</label>
    <input type="text" placeholder="cat photo URL" required>
    <button type="submit">Submit</button>
  </form>
</div>
bruglesco
@bruglesco
Oct 12 2015 05:50
yes the h2 should be nested inside the div not the other way around
@LivingForGod1991
Lanie Molinar
@LivingForGod1991
Oct 12 2015 06:03
@bruglesco Thanks. I didn't realize that made a difference.
CamperBot
@camperbot
Oct 12 2015 06:03
livingforgod1991 sends brownie points to @bruglesco :sparkles: :thumbsup: :sparkles:
:star: 199 | @bruglesco | http://www.freecodecamp.com/bruglesco
Jason
@Jauble
Oct 12 2015 06:17
@christoph-phillips You can take a look at mine if you want. Nice job on everything else btw http://codepen.io/auble220/pen/GpmjGx
Helio Goncalves
@srlhyo
Oct 12 2015 06:39
hi there!
anyone to help me please?
David Bouwkamp
@DavidBouw
Oct 12 2015 06:40
@srlhyo I might be able to help. What's your question?
Jose E. Pimentel
@jedpimentel
Oct 12 2015 06:43
@srlhyo it's usually better to post the question directly... there are usually a few people lurking
David Bouwkamp
@DavidBouw
Oct 12 2015 07:04
Is anyone else working on the Mutations bf?
bf mutations
CamperBot
@camperbot
Oct 12 2015 07:05

:fire:Bonfire: Mutations :link:

function mutation(arr) {
  return arr;
}

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

Return true if the string in the first element of the array contains all of the letters of the string in the second element of the array.

more info:  bf details | bf links | hint

Jose E. Pimentel
@jedpimentel
Oct 12 2015 07:07
that one's interesting, a few ways to do it
Travis
@TravisHi
Oct 12 2015 07:08
Hey guys, anyone know how to output and count the total iterations of a while loop?
David Bouwkamp
@DavidBouw
Oct 12 2015 07:08
@TravisHi console.log(count);
Jose E. Pimentel
@jedpimentel
Oct 12 2015 07:09
@TravisHi define var iterations = 0 before the loop, iterations++ right at the start of the loop
David Bouwkamp
@DavidBouw
Oct 12 2015 07:09
@TravisHi console.log(count);
@TravisHi as long as count is an integer you are using to count the number of cycles through a loop
Jose E. Pimentel
@jedpimentel
Oct 12 2015 07:10
@BrainDrainBahrain for mutations I found it easier to use a helper function, which only checks one character versus the entire word... then ran it on all the characters
Travis
@TravisHi
Oct 12 2015 07:11
@thanks @BrainDrainBahrain and @jedpimentel !
CamperBot
@camperbot
Oct 12 2015 07:11
travishi sends brownie points to @thanks and @braindrainbahrain and @jedpimentel :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for thanks
:warning: could not find receiver for braindrainbahrain
:star: 345 | @jedpimentel | http://www.freecodecamp.com/jedpimentel
Travis
@TravisHi
Oct 12 2015 07:11
lets try that again :/
thanks @BrainDrainBahrain
CamperBot
@camperbot
Oct 12 2015 07:11
travishi sends brownie points to @braindrainbahrain :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for braindrainbahrain
Travis
@TravisHi
Oct 12 2015 07:12
he must have ran?
Jose E. Pimentel
@jedpimentel
Oct 12 2015 07:12
hmmm.. I should totally make an account named @Thanks
CamperBot
@camperbot
Oct 12 2015 07:12
jedpimentel sends brownie points to @thanks :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for thanks
David Bouwkamp
@DavidBouw
Oct 12 2015 07:12
I don't know how to link this to my codecamp account
Jose E. Pimentel
@jedpimentel
Oct 12 2015 07:12
then ask for advice all the time 3:)
@BrainDrainBahrain what's the site URL you get when clicking on your brownie point score?
David Bouwkamp
@DavidBouw
Oct 12 2015 07:13
I can send points but i can't receive them. idk. any idea what could be wrong with my settings?
I think i got it now. I just connected codecamp to my git
Travis
@TravisHi
Oct 12 2015 07:15
@jedpimentel is there a way to show only the total iterations after the loop is completed?
David Bouwkamp
@DavidBouw
Oct 12 2015 07:15
thanks @jedpimentel
CamperBot
@camperbot
Oct 12 2015 07:15
braindrainbahrain sends brownie points to @jedpimentel :sparkles: :thumbsup: :sparkles:
:star: 346 | @jedpimentel | http://www.freecodecamp.com/jedpimentel
jedpimentel @jedpimentel tests @BrainDrainBahrain 's brownie recepticle
Jose E. Pimentel
@jedpimentel
Oct 12 2015 07:15
test 123 @BrainDrainBahrain thanks 123
CamperBot
@camperbot
Oct 12 2015 07:15
jedpimentel sends brownie points to @braindrainbahrain :sparkles: :thumbsup: :sparkles:
:star: 192 | @braindrainbahrain | http://www.freecodecamp.com/braindrainbahrain
David Bouwkamp
@DavidBouw
Oct 12 2015 07:16
Woohoo!
Travis
@TravisHi
Oct 12 2015 07:16
phew I got it dw @jedpimentel !
Jose E. Pimentel
@jedpimentel
Oct 12 2015 07:17
@TravisHi using the counter++ would give you the total iterations (you do need to calculate the total iterations)
Travis
@TravisHi
Oct 12 2015 07:17
man this khan academy course for Algorithms isn't as good as their other material, either that or I'm struggling with the content
yeah, it was just where I was placing the println
I had it just printing every loop, only needed to put it where the desired condition would return
David Bouwkamp
@DavidBouw
Oct 12 2015 07:18
@jedpimentel I'm trying to imagine a recursive solution with match atm. If anyone is interested in tossing some ideas around for bf Mutations let me know
Jose E. Pimentel
@jedpimentel
Oct 12 2015 07:19
ah, yeah. it's best to print only once thwe loop is done
Ali-Haider5
@Ali-Haider5
Oct 12 2015 07:30
This message was deleted
help...
CamperBot
@camperbot
Oct 12 2015 07:30

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

Basic Commands:

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

:speech_balloon: meet CamperBot in this room!

:pencil: read more about camperbot on the FCC Wiki

David Bouwkamp
@DavidBouw
Oct 12 2015 07:31
@Ali-Haider5 what is your output?
Jose E. Pimentel
@jedpimentel
Oct 12 2015 07:34
@Ali-Haider5 you might want to insert a return false somewhere
Travis
@TravisHi
Oct 12 2015 07:34
and triple equals?
Ali-Haider5
@Ali-Haider5
Oct 12 2015 07:36
@jedpimentel @BrainDrainBahrain done works now
thanks
CamperBot
@camperbot
Oct 12 2015 07:36
if you want to thank someone, put an @ before their name!
Mohit Garg
@mohitgarg
Oct 12 2015 07:39
hey guys
i m stuck on a lesson .i m really new to this thing can someone help me
David Bouwkamp
@DavidBouw
Oct 12 2015 07:40
@4mohit Which lesson?
Mohit Garg
@mohitgarg
Oct 12 2015 07:41
@BrainDrainBahrain Lesson 22
David Bouwkamp
@DavidBouw
Oct 12 2015 07:42
@4mohit Nest an Anchor Element within a Paragragh?
Mohit Garg
@mohitgarg
Oct 12 2015 07:42
i have tried the no breaking space element and pre and br tag everything nothing's working
yeas that' right
yes*
i just can't get the space after it
Rahul Rana
@rahulrana95
Oct 12 2015 07:44
go stuck in jquery code
anyone help?
Edper
@edper
Oct 12 2015 07:44
@BrainDrainBahrain you can iterate on each character of the second array if it is in the first array and if there is one character which is not return false right away. Otherwise continue until every character is accounted for then return true.
David Bouwkamp
@DavidBouw
Oct 12 2015 07:44
@4mohit can you post your code for me?
Rahul Rana
@rahulrana95
Oct 12 2015 07:45
The .parent() method should be called on the #target1 element.
How to do this?
Mohit Garg
@mohitgarg
Oct 12 2015 07:47

@BrainDrainBahrain yeah here it is
```

<p>
View more <a href="http://www.freecatphotoapp.com">cat photos</a>
</p>

Edper
@edper
Oct 12 2015 07:48
@4mohit there should be a space after the word "more"
David Bouwkamp
@DavidBouw
Oct 12 2015 07:48
@4mohit @edper is correct
Edper
@edper
Oct 12 2015 07:48
<p>
View more <a href="http://www.freecatphotoapp.com">cat photos</a>
</p>
Mohit Garg
@mohitgarg
Oct 12 2015 07:48
i have given a space after the world more and its showing in the output but when i run the test it jus won't compile
Edper
@edper
Oct 12 2015 07:49
Also you should put the code that you posted in the right place.
<h2 class="red-text">CatPhotoApp</h2>

<p>View more <a href="http://www.freecatphotoapp.com">cat photos</a></p>

<img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat">
Mohit Garg
@mohitgarg
Oct 12 2015 07:51
yeah right place it was thank you @edper
CamperBot
@camperbot
Oct 12 2015 07:51
4mohit sends brownie points to @edper :sparkles: :thumbsup: :sparkles:
:star: 52 | @edper | http://www.freecodecamp.com/edper
Edper
@edper
Oct 12 2015 07:56
Glad to be of help to you @4mohit . GOD bless.
On to the next challenge!
Trilok reddy
@Trilokreddy007
Oct 12 2015 07:57
can anyone help me i,m in Waypoint: Nest an Anchor Element within a Paragraph .i,m not able to pass the test as it says "Your p element should have the text "View more " (with a space after it).
as anyone solved it
Mohit Garg
@mohitgarg
Oct 12 2015 07:58
yeah i was jus their
Edper
@edper
Oct 12 2015 07:58
Show your code @Trilokreddy007
Mohit Garg
@mohitgarg
Oct 12 2015 07:58
do not use a new line for view more and p element that's what solve my problem
Trilok reddy
@Trilokreddy007
Oct 12 2015 07:58
can u tell me how u did it?
Mohit Garg
@mohitgarg
Oct 12 2015 07:59

```

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

<p>View more <a href="http://www.freecatphotoapp.com">cat photos</a></p>

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

```

Edper
@edper
Oct 12 2015 07:59
@Trilokreddy007 Check my sample code above.
Trilok reddy
@Trilokreddy007
Oct 12 2015 07:59
<p>"view more" <a href="http://www.freecatphotoapp.com"> cat photos </a></p>
Edper
@edper
Oct 12 2015 07:59
No quote!
Mohit Garg
@mohitgarg
Oct 12 2015 07:59
Dont use double quotes
and a space after the more word
Trilok reddy
@Trilokreddy007
Oct 12 2015 08:01
thank u @4mohit and @edper it works .thanks alot.
CamperBot
@camperbot
Oct 12 2015 08:01
if you want to thank someone, put an @ before their name!
Edper
@edper
Oct 12 2015 08:02
You're welcome @Trilokreddy007
Trilok reddy
@Trilokreddy007
Oct 12 2015 08:03
another question why it is not valid to write the code( <p>"view more" <a href="http://www.freecatphotoapp.com"> cat photos </a></p> ) at the bottom.
Sasa
@tanasic
Oct 12 2015 08:04
@Trilokreddy007 it is valid, but just not in this exercise because that is not the way THAT PARTICULAR page is suppoused to be structured ;)
@tanasic its like someone is showing you how to make a door, and you put a knob on the bottom on the door..
@Trilokreddy007 so, the code is valid, but the free code camp lessons is telling you you failed because it is not suppoused to be structured that way for that exercise :)
Trilok reddy
@Trilokreddy007
Oct 12 2015 08:06
okay thank a lot @tanasic
CamperBot
@camperbot
Oct 12 2015 08:06
if you want to thank someone, put an @ before their name!
Sasa
@tanasic
Oct 12 2015 08:06
@Trilokreddy007 no problem :)
Suraj Jain
@surajjain
Oct 12 2015 08:49
I'm stuck with a very basic thing, pls someone help me

<h1>Hello World</h1> <!-- comment 1 -->

<h2>CatPhotoApp</h2> <!-- comment 2 -->

<p>Hello Paragraph</p> <!-- comment 3 -->

Is this correct?
Jose E. Pimentel
@jedpimentel
Oct 12 2015 08:50
the comments, yes
what's the problem URL?
Suraj Jain
@surajjain
Oct 12 2015 08:50
no, Im not able to proceed further, it says "Be sure to delete all trailing comment tags, i.e. -->."
Jose E. Pimentel
@jedpimentel
Oct 12 2015 08:51
could you link to the problem so I can test your code?
Suraj Jain
@surajjain
Oct 12 2015 08:52
how do I do that? I'm new here
Im in the basics of HTML
Jose E. Pimentel
@jedpimentel
Oct 12 2015 08:52
just the URL should be fine, or the name of the waypoint
Jose E. Pimentel
@jedpimentel
Oct 12 2015 08:53
aah okay
it's saying to remove the comments, try following the directions without paying much attention to the red/green marks (they might tangle you up)
basically, just remove the comments
(by deleting them)
Suraj Jain
@surajjain
Oct 12 2015 08:57
It worked, thanks a lot @jedpimentel
CamperBot
@camperbot
Oct 12 2015 08:57
surajjain sends brownie points to @jedpimentel :sparkles: :thumbsup: :sparkles:
:star: 347 | @jedpimentel | http://www.freecodecamp.com/jedpimentel
Edper
@edper
Oct 12 2015 09:13

@EtwasShawn You are only testing if a certain property is present but not the values of collection versus source.

function where(collection, source) {
  var arr = [];
  var sourceKeys = Object.keys(source);

  for (var i in collection){  
    var propCount = 0;   
    for(var j in sourceKeys){
    // This part here you only tested for the presence of a property and not the value(s)
      if(collection[i].hasOwnProperty(sourceKeys[j]) === true){
         propCount++;       
         }          
    }      
       if(propCount === sourceKeys.length){
        arr.push(collection[i]);
      }     
  }
  // What's in a name?

  return arr;
}
where([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" });

With the example above you returned all the collection even if the value is incorrect although the property names are correct.

Michael Kebe
@michaelkebe
Oct 12 2015 09:20
Too bad, that this is a valid solution for the roman numeral converter:
function convert(num) {
  var transformations = new Array(29);
  transformations[12] = "XII";
  transformations[5] = "V";
  transformations[9] = "IX";
  transformations[29] = "XXIX";
  transformations[16] = "XVI";
  return transformations[num];
}
Jose E. Pimentel
@jedpimentel
Oct 12 2015 09:22
@michaelkebe true, at least you have to take an academic honesty pledge before receiving the certificates :v
Edper
@edper
Oct 12 2015 09:24
@michaelkebe and if we use different values that code does not work. If the goal is simply to get the right output then we could virtually circumvent most of the challenge here..lol
Michael Kebe
@michaelkebe
Oct 12 2015 09:25
Can I run my own test inside the freecodecamp editor?
something like assert(foo === "bar")
Jose E. Pimentel
@jedpimentel
Oct 12 2015 09:25
but it works for the test cases... same as the factorial function. I've seen a lot of factorial functions that don't take in consideration that factorial(0)=1
David Bouwkamp
@DavidBouw
Oct 12 2015 09:30
This message was deleted
Michael Kebe
@michaelkebe
Oct 12 2015 09:41
help chai assert
CamperBot
@camperbot
Oct 12 2015 09:41

:point_right: chai assert [wiki]

assert(expression, message)

  • @param{ Mixed }expressionto test for truthiness
  • @param{ String }messageto display on error

Write your own test expressions.

assert('foo' !== 'bar', 'foo is not bar');
assert(Array.isArray([]), 'empty arrays are arrays');

details: http://chaijs.com/api/assert/

:pencil: read more about chai assert on the FCC Wiki

Michael Kebe
@michaelkebe
Oct 12 2015 09:44
help chai expectations
CamperBot
@camperbot
Oct 12 2015 09:44
no wiki entry for: chai expectations
:pencil: click here to create one now!after creating your page type update to reload it here
Mettcon
@Mettcon
Oct 12 2015 09:44
Maybe i'm just stupid but i'm pretty sure the course missed it to teach me stuff i need for bonfires
Without my javascript guy i maybe never solve them
Jose E. Pimentel
@jedpimentel
Oct 12 2015 09:46
@Mettcon usually they are new subjects
you could do the codecademy JS course first (ity used to be part of the curriculum), but mostly it'll be a mix of the suggested links under the problem statements and google
Mettcon
@Mettcon
Oct 12 2015 09:52
I will take a look into this course
But for example the first bonfire
Damnit... The links told me nothing new... My js guy started to explain me functions and the syntax... I knew the code but had no idea where and how to place it
Jose E. Pimentel
@jedpimentel
Oct 12 2015 09:57
well... you're going to have to read a JavaScript book eventually might as well start now alongside the bonfires. I took a step back so I could read Eloquent Javascript, but it's a bit harsh for begginers (ex: I sometimes have to take naps mid-chaper)
The HackerRank algorithms challenges are also a nice place to learn, they have a good learning curve as long as you start with the easy ones
Elizabeth Hatleli
@TheHighPriestess
Oct 12 2015 09:59

I'm nearly finished with my Wikipedia zipline. HOWEVER, I have one small problem with the output on the page. The headings are all grouped together...the excerpts all grouped together...the links all grouped together etc. I want...

Title
Excerpt
Link

How can I do that? I'm drawing a blank.

EtwasShawn
@EtwasShawn
Oct 12 2015 10:11
@edper thanks! A small adjustment and I was able to submit it successfully.
CamperBot
@camperbot
Oct 12 2015 10:11
etwasshawn sends brownie points to @edper :sparkles: :thumbsup: :sparkles:
:star: 53 | @edper | http://www.freecodecamp.com/edper
Mettcon
@Mettcon
Oct 12 2015 10:13
@jedpimentel
Thanks
CamperBot
@camperbot
Oct 12 2015 10:14
if you want to thank someone, put an @ before their name!
h4r1m4u
@h4r1m4u
Oct 12 2015 10:14

@TheHighPriestess i had a brief look at your codepen. if i understand it correctly, the issue is with this bit:

      $("h2").append(thetitle);
      $(".excerpt").append(theexcerpt);
      $(".link").append(thelink);

you're appending all the titles into the same <h2> element, all excerpts into the same <p> element, etc. don't do that. as you loop through the wiki articles, display each in an individual <div> on the page.

Elizabeth Hatleli
@TheHighPriestess
Oct 12 2015 10:15
@h4r1m4u so....create a new div for each entry?
that's the only way I can think of...
h4r1m4u
@h4r1m4u
Oct 12 2015 10:17
@TheHighPriestess yes, that's what i would do. you have the <div class="info"> which displays all the results. how i would structure the page is then this:
<div class="info">

<div class="article">
<h2>title</h2>
<p>excerpt<p>
<p>link</p>
</div>

<div class="article">
<h2>next title</h2>
<p>next excerpt<p>
<p>next link</p>
</div>

...
</div>
so instead of appending the content to the same elements, add the article divs to the main info container
Elizabeth Hatleli
@TheHighPriestess
Oct 12 2015 10:19
iow...actually create these elements and append them to the "info" container
That makes sense. Thank you @h4r1m4u
CamperBot
@camperbot
Oct 12 2015 10:21
thehighpriestess sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 214 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 12 2015 10:21
yes. your jquery would looks something like this:
$(".info").append("<div class='article'><h2>" + thetitle + "</h2><p>" + theexcerpt + "</p></div>");
you're real close
Elizabeth Hatleli
@TheHighPriestess
Oct 12 2015 10:22
ah....thank you!
CamperBot
@camperbot
Oct 12 2015 10:22
if you want to thank someone, put an @ before their name!
Elizabeth Hatleli
@TheHighPriestess
Oct 12 2015 10:22
I spent so long on those bonfires that I am starting to forget my jquery
h4r1m4u
@h4r1m4u
Oct 12 2015 10:23
hahaha :) i know the feeling
David Bouwkamp
@DavidBouw
Oct 12 2015 10:23
Does anyone have a link to a good write up on .filter()?
Jose E. Pimentel
@jedpimentel
Oct 12 2015 10:24
@BrainDrainBahrain http://eloquentjavascript.net/05_higher_order.html "Filtering an array"
David Bouwkamp
@DavidBouw
Oct 12 2015 10:24
@jedpimentel thanks
CamperBot
@camperbot
Oct 12 2015 10:24
braindrainbahrain sends brownie points to @jedpimentel :sparkles: :thumbsup: :sparkles:
:star: 351 | @jedpimentel | http://www.freecodecamp.com/jedpimentel
peppermint009
@peppermint009
Oct 12 2015 10:30
Hi! I'm getting "chai is not defined" error for jquery lessons, anyone who has encountered this before?
h4r1m4u
@h4r1m4u
Oct 12 2015 10:33
@peppermint009 which waypoint and could you post your code?
peppermint009
@peppermint009
Oct 12 2015 10:36
@h4r1m4u it's http://freecodecamp.com/challenges/waypoint-learn-how-script-tags-and-document-ready-work, I just added <script>$(document).ready(function() {});</script> on top most line
I have tried ie,mozilla and chrome, still getting same error. Weird is that just adding <script></script> will give me chai is not defined error
David Bouwkamp
@DavidBouw
Oct 12 2015 10:37
Is there a reason why all the starter bonfires have this "" arg at the end of the function call?
destroyer([1, 2, 3, 1, 2, 3], 2, 3, "");
h4r1m4u
@h4r1m4u
Oct 12 2015 10:38
@peppermint009 that's strange. i haven't run into that and i'm not sure what might cause it. the code you added should work
Jose E. Pimentel
@jedpimentel
Oct 12 2015 10:38
@BrainDrainBahrain absolutely no idea... should be a bug, JS will usually just throw away that empty array if the function doesn't use it. Deleting it should be fine
peppermint009
@peppermint009
Oct 12 2015 10:39
@h4r1m4u thanks, seems isolated case. maybe just in my machine or something.
CamperBot
@camperbot
Oct 12 2015 10:39
peppermint009 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 215 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Jose E. Pimentel
@jedpimentel
Oct 12 2015 10:40
I actually remember they didn't have that element when I did them, it should be somethiing new
David Bouwkamp
@DavidBouw
Oct 12 2015 10:40
@jedpimentel Thanks. Glad to know I'm not going crazy! haha
CamperBot
@camperbot
Oct 12 2015 10:40
braindrainbahrain sends brownie points to @jedpimentel :sparkles: :thumbsup: :sparkles:
:warning: braindrainbahrain already gave jedpimentel points
Travis
@TravisHi
Oct 12 2015 11:06
@BrainDrainBahrain I wondered the same thing actually
Avishay
@avishayshushan
Oct 12 2015 11:29
hey all,
need some help on my calculator app
the css hover is not working properly .
hover your mouse over the line with '4' '5' '6'.. and see
http://codepen.io/avishayshushan/full/WQjPRV/
Aleksandar B.
@aleksandar-b
Oct 12 2015 11:35
@avishayshushan my browser keeps freezing when i visit your site
Avishay
@avishayshushan
Oct 12 2015 11:36
@samosale da**
John Power
@powerjohn
Oct 12 2015 11:37
@avishayshushan not sure but it coud be the overflow of the divs with the class row inspect the elements and you'll see what I mean
Aleksandar B.
@aleksandar-b
Oct 12 2015 11:37
@avishayshushan don't use bootstrap for this
Avishay
@avishayshushan
Oct 12 2015 11:38
@powerjohn why the lines behave differently ?
@samosale why?
John Power
@powerjohn
Oct 12 2015 11:41
@avishayshushan the line with 9 . 4 is covered by the div with class row the others are not thats the ony explaination i can think of
Mateja Trifunovski
@Matko95
Oct 12 2015 11:43
Anyone here finished the simon game zipline?
Avishay
@avishayshushan
Oct 12 2015 11:43
@powerjohn i don't know why but the preview here is not the actual design
@powerjohn i can't see that the other lines are not wrap with the row div
Jose E. Pimentel
@jedpimentel
Oct 12 2015 11:47
@avishayshushan somehow, it seems like it might be tied twith the issues of the buttons overflowing to the next line. It seems the buttons that don't highlight are the ones that voverflowed from their group (chances are it's something else though)
John Power
@powerjohn
Oct 12 2015 11:47
@avishayshushan get rid of the divs with the class of rows and put a <br> at the end of each row instead and your hover will work
@jedpimentel I think its the divs that are causing the overflow??
Avishay
@avishayshushan
Oct 12 2015 11:49
@powerjohn @jedpimentel i'm using 'float:left'
Jose E. Pimentel
@jedpimentel
Oct 12 2015 11:49
@powerjohn the thing is, they might take a bit more space than you expect, with padding etc. I think the comment on not using bootstrap is a good idea, since it adds some odd padding to sites
Avishay
@avishayshushan
Oct 12 2015 11:49
maybe this is the problem, i never use it before
@jedpimentel which classes are bootstrap?
John Power
@powerjohn
Oct 12 2015 11:50
@avishayshushan if you use the dev tools in chrome andclick on the lines with the divs in the code you will see how much space they take i thinkk they are 50px high
Jose E. Pimentel
@jedpimentel
Oct 12 2015 11:51
@avishayshushan sorry, just checked the settings and saw it's not using bootstrap
Avishay
@avishayshushan
Oct 12 2015 11:52
@samosale @powerjohn @jedpimentel thanks for the advises
CamperBot
@camperbot
Oct 12 2015 11:52
avishayshushan sends brownie points to @samosale and @powerjohn and @jedpimentel :sparkles: :thumbsup: :sparkles:
:star: 352 | @jedpimentel | http://www.freecodecamp.com/jedpimentel
:star: 326 | @samosale | http://www.freecodecamp.com/samosale
:star: 221 | @powerjohn | http://www.freecodecamp.com/powerjohn
Avishay
@avishayshushan
Oct 12 2015 11:52
still not resolve due
John Power
@powerjohn
Oct 12 2015 11:52
@avishayshushan I edited the live code in dev tools removing the divs with class row and add <br> at the end of rows and the hover is working
Denis Zavedeev
@cac03
Oct 12 2015 11:52
@avishayshushan remove the relative position from 'row' elements
Avishay
@avishayshushan
Oct 12 2015 11:53
@cac03 thanks
we got a winner!
CamperBot
@camperbot
Oct 12 2015 11:53
avishayshushan sends brownie points to @cac03 :sparkles: :thumbsup: :sparkles:
:star: 222 | @cac03 | http://www.freecodecamp.com/cac03
Denis Zavedeev
@cac03
Oct 12 2015 11:55
@avishayshushan don't use absolute position if it's not justifyed.
John Power
@powerjohn
Oct 12 2015 11:55
@cac03 good spot
Avishay
@avishayshushan
Oct 12 2015 11:55
@cac03 can you explain a little bit?
Denis Zavedeev
@cac03
Oct 12 2015 11:55
@avishayshushan you can center main div giving that a fixed width and margin: 0 auto;
Avishay
@avishayshushan
Oct 12 2015 11:56
@cac03 it's a great tip, sure gonna use it
John Power
@powerjohn
Oct 12 2015 12:09
@avishayshushan you might find some of these video tuts helpful you need to sign up but this particulr course is free as is 30 days to learn jQuery by the same tutor
@avishayshushan https://webdesign.tutsplus.com/courses/30-days-to-learn-html-css might help if i give the link :)
it helped me get my head around absolute v relative positioning
Michael Kebe
@michaelkebe
Oct 12 2015 12:10
Request for comments (RFC):
function convert(arabic) {
  var numerals = [
    {value: 10, symbol: "X"},
    {value: 9, symbol: "IX"},
    {value: 5, symbol: "V"},
    {value: 4, symbol: "IV"},
    {value: 1, symbol: "I"},
  ];

  var roman = "";
  while (arabic > 0) {
    var numeral = numerals.find(nextNumeral);
    roman += numeral.symbol;
    arabic -= numeral.value;
  }
  return roman;

  function nextNumeral(numeral) {
    return numeral.value <= arabic;
  }
}
From the roman numeral converter bonfire
Aleksandar B.
@aleksandar-b
Oct 12 2015 12:13
@avishayshushan Don't modify class row in css. That is a bootstrap class and it is not recomended to change it. Just add new class.
DTing
@dting
Oct 12 2015 12:13
bf convert
CamperBot
@camperbot
Oct 12 2015 12:13

:fire:Bonfire: Roman Numeral Converter :link:

function convert(num) {
 return num;
}

convert(36);

Convert the given number into a roman numeral.

more info:  bf details | bf links | hint

Aleksandar B.
@aleksandar-b
Oct 12 2015 12:13
@Matko95 I am. What do you want to know?
Mateja Trifunovski
@Matko95
Oct 12 2015 12:14
@samosale nevermind i got it sorted now :) just didn't actually understood the instructions for the strict mode, but i get it now :) thanks for the effort though
CamperBot
@camperbot
Oct 12 2015 12:14
matko95 sends brownie points to @samosale :sparkles: :thumbsup: :sparkles:
:star: 327 | @samosale | http://www.freecodecamp.com/samosale
Bob Moree
@bmoree
Oct 12 2015 12:15
My chrome keeps crashing on the bonfire challenges, I don't think it's related to the challenge itself, cause this is the third time in a row I get (on consecutive challenges..). What to do??
DTing
@dting
Oct 12 2015 12:16
@michaelkebe nice
Aleksandar B.
@aleksandar-b
Oct 12 2015 12:16
@bmoree try to hit f5
DTing
@dting
Oct 12 2015 12:16
havent seen it done that way before
Mateja Trifunovski
@Matko95
Oct 12 2015 12:16
http://codepen.io/Matko95/pen/JYJvvY?editors=001 Here it is, some feedback would be nice :)
DTing
@dting
Oct 12 2015 12:17
@Matko95 looks good
Aleksandar B.
@aleksandar-b
Oct 12 2015 12:17
@Matko95 try to disable buttons while comp is playing
DTing
@dting
Oct 12 2015 12:17
is there anyways to get the outside border the same width as the inner borders?
Mateja Trifunovski
@Matko95
Oct 12 2015 12:18
@dting there probably is, but i kinda like it this way
@samosale yeah, that would be good
DTing
@dting
Oct 12 2015 12:18
cool nice work
Bob Moree
@bmoree
Oct 12 2015 12:18
@samosale The entire tab is totally unresponsive, can't refresh, can't change URL, can't even close the tab. The rest of chrome is working well :-S
Michael Kebe
@michaelkebe
Oct 12 2015 12:19
thanks @dting for the comment
CamperBot
@camperbot
Oct 12 2015 12:19
michaelkebe sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1372 | @dting | http://www.freecodecamp.com/dting
srishi2110git
@srishi2110git
Oct 12 2015 12:19
Zipline: Build a Random Quote Machine
help
CamperBot
@camperbot
Oct 12 2015 12:19

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

Basic Commands:

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

:speech_balloon: meet CamperBot in this room!

:pencil: read more about camperbot on the FCC Wiki

Elizabeth Hatleli
@TheHighPriestess
Oct 12 2015 12:19
I'm having a problem with my Wikipedia zipline. Notice how the FIRST item is correct: title plus excerpt. However, all the following items are not correct. What am I doing wrong? http://codepen.io/highpriestess/pen/gaRBKZ
Aleksandar B.
@aleksandar-b
Oct 12 2015 12:19
@bmoree well, just restart chrome and hit f5
Elizabeth Hatleli
@TheHighPriestess
Oct 12 2015 12:20
It's just appending to what's already there...and screwing it up
I want to create a NEW div for each item
so...is append really what I want?
Aleksandar B.
@aleksandar-b
Oct 12 2015 12:22
@TheHighPriestess did you try html()
?
I think that is the solution
Elizabeth Hatleli
@TheHighPriestess
Oct 12 2015 12:23
hold on..let me try that instead of append
no...that gives me all the titles first and then all the excerpts after that
Aleksandar B.
@aleksandar-b
Oct 12 2015 12:27
@TheHighPriestess you must do forEach
Elizabeth Hatleli
@TheHighPriestess
Oct 12 2015 12:28
I think it's just .each for jquery, no?
Aleksandar B.
@aleksandar-b
Oct 12 2015 12:28
and inside forEach append thelink and all your other variables. But you need to put in array not concatinate
Elizabeth Hatleli
@TheHighPriestess
Oct 12 2015 12:30
i'm drawing a complete blank
how can i put this into an array?
I need to see an example of this
Elizabeth Hatleli
@TheHighPriestess
Oct 12 2015 12:35
I tried this...but it doesn't work:
  $(".info").each(function(index){
        ("<div class='article'><h2>" + thetitle + "</h2><p>" + theexcerpt + "</p></div>");
      });
Elizabeth Hatleli
@TheHighPriestess
Oct 12 2015 12:36
but i don't have an array
i'm trying to create elements and add them to the dom using jquery
Aleksandar B.
@aleksandar-b
Oct 12 2015 12:36
@TheHighPriestess Hold on. I don't know what is the object you are retreaving
Elizabeth Hatleli
@TheHighPriestess
Oct 12 2015 12:37
this one last part is really confusing me...i have no idea how to do it haha
I don't think each is right...because these elements don't exist
Elizabeth Hatleli
@TheHighPriestess
Oct 12 2015 12:39
so how can it iterate over them?
var ourArray = [1,2,3];
ourArray[0] = 3;
// ourArray now equals [1,3,3].
var myArray = [1,2,3];
// Only change code below this line.
myArray[0] = 3;

// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
// You'll learn about functions soon.
if(typeof(myArray) !== "undefined"){(function(){return myArray;})();}
Blauelf
@Blauelf
Oct 12 2015 12:41
@alisiddique What is your question? Did you follow the advices (e.g. where to change the code)?
Ali Siddique
@alisiddique
Oct 12 2015 12:42
This message was deleted
Blauelf
@Blauelf
Oct 12 2015 12:44
So the ourArray[0]=3; shows you how to change single elements in an array. Copy that line and modify it to use myArray instead.
Ali Siddique
@alisiddique
Oct 12 2015 12:44
Thanks @Blauelf @TheHighPriestess
CamperBot
@camperbot
Oct 12 2015 12:44
alisiddique sends brownie points to @blauelf and @thehighpriestess :sparkles: :thumbsup: :sparkles:
:star: 354 | @blauelf | http://www.freecodecamp.com/blauelf
:star: 292 | @thehighpriestess | http://www.freecodecamp.com/thehighpriestess
Aleksandar B.
@aleksandar-b
Oct 12 2015 12:45
I think this is good:
$(".searchbutton").click(function(){

    event.preventDefault;

    var userInput = $(".searchtag").val();

    var URL = "http://en.wikipedia.org/w/api.php?format=json&action=query&generator=search&gsrnamespace=0&gsrlimit=10&prop=pageimages|extracts&pilimit=max&exintro&explaintext&exsentences=1&exlimit=max&gsrsearch=";
  var jsonFormat = "&callback=JSON_CALLBACK";
    var ajaxURL = URL + userInput + jsonFormat;

    console.log(ajaxURL);

  $.ajax(ajaxURL, {
  dataType: "jsonp",
  success: function(data) {

    $('.info').html("");
    var PageDates = Object.keys(data.query.pages);
    console.log(PageDates);
    PageDates.forEach(function(date){
       var thetitle = "";
    var theexcerpt = "";
      var title = data.query.pages[date].title;
      var extract = data.query.pages[date].extract;
      var link = data.query.pages[date].title.replace(/\s/g, "_");

      thetitle = thetitle + "<p>" + title + "</p>";
      theexcerpt = theexcerpt + "<p>" + extract + "</p>";
      linktopage = "http://en.wikipedia.org/wiki/" + link;
      thelink = "<a href='http://en.wikipedia.org/wiki/" + link + "'>" + thetitle + "</a>";


$(".info").append("<div class='article'><h2>" + thetitle + "</h2><p>" + theexcerpt + "</p></div>");

      //$("h2").append(thetitle);
      //$(".excerpt").append(theexcerpt);
      //$(".link").append(thelink);

    })
  }
});
});
Elizabeth Hatleli
@TheHighPriestess
Oct 12 2015 12:45
@samosale What did you change?
Aleksandar B.
@aleksandar-b
Oct 12 2015 12:47
@TheHighPriestess there is some error in my code. You must first on retreaval ajax call delete the content using html(" ")
@TheHighPriestess i have put var thetitle = ""; var theexcerpt = ""; inside forEach
Elizabeth Hatleli
@TheHighPriestess
Oct 12 2015 12:50
oh...i see
Aleksandar B.
@aleksandar-b
Oct 12 2015 12:50
@TheHighPriestess that way it would clear the content from previous itteration
Elizabeth Hatleli
@TheHighPriestess
Oct 12 2015 12:50
yes...hold on
Aleksandar B.
@aleksandar-b
Oct 12 2015 12:51
@samosale and instead of html i have used append
Elizabeth Hatleli
@TheHighPriestess
Oct 12 2015 12:51
@samosale it works!
@samosale thank you
CamperBot
@camperbot
Oct 12 2015 12:51
thehighpriestess sends brownie points to @samosale :sparkles: :thumbsup: :sparkles:
:star: 328 | @samosale | http://www.freecodecamp.com/samosale
Aleksandar B.
@aleksandar-b
Oct 12 2015 12:51
@TheHighPriestess npm
Elizabeth Hatleli
@TheHighPriestess
Oct 12 2015 12:51
yeah..i changed it back to append
i got a bit confused because i'm not used to foreach...and i wasn't thnking of it as a loop
Vaghawan Ojha
@vaghawan
Oct 12 2015 13:06
Can anyone help me with the flicker api call?
The code is something like this. function background(lat, lon, desc) { // call the flicker api with the call back function. var url = "https://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=0677de6a559772c8cb27dd22219dfa0c&lat=" + lat + "&lon=" + lon + "&accuracy=1&tags=" + desc + "&sort=relevance&extras=url_l&format=json"; function jsonFlickrApi(data) { console.log(data); if (data.photos.pages > 0) { var photo = data.photos.photo[0]; document.querySelector("body").style.backgroundImage = "url('" + photo.url_l + "')"; document.querySelector("#image-source").setAttribute("href", "http://www.flickr.com/photos/" + photo.owner + "/" + photo.id); } else { document.querySelector("body").style.backgroundImage = "url('https://fourtonfish.com/tutorials/weather-web-app/images/default.jpg')"; document.querySelector("#image-source").setAttribute("href", "https://www.flickr.com/photos/superfamous/310185523/sizes/o/"); } } $.getJSON(url, jsonFlickrApi,'josnp') }
George Volokitin
@saintgeo23
Oct 12 2015 13:12
hey, guys!
i'm total newbee with web design. now i'm trying to manage first zipline - portfolio page.
would you look at my result? http://codepen.io/saintgeo23/pen/xwdQxJ?editors=010
what big mistakes do you see?
Michael Kebe
@michaelkebe
Oct 12 2015 13:17
@saintgeo23 Try to collapse the navigation bar, when someone uses a mobile device.
George Volokitin
@saintgeo23
Oct 12 2015 13:18
@michaelkebe how?
shitala
@shitala099
Oct 12 2015 13:18
Can anyone tell me the js code that how much a particular word come in a paragraph . pls help me out???anybody
Michael Kebe
@michaelkebe
Oct 12 2015 13:21
George Volokitin
@saintgeo23
Oct 12 2015 13:22
@michaelkebe i tried to make my first page without Bootstrap
Travis
@TravisHi
Oct 12 2015 13:22
but bootstrap is so much easier!
Stefan Stokic
@StefanStokic
Oct 12 2015 13:22
Hi guys, http://codepen.io/KingInTheNorth/pen/EVvxLR <---Can someone help me with the "delete" function of tweets when a tweet is posted?
Michael Kebe
@michaelkebe
Oct 12 2015 13:24
@saintgeo23 Great exercise without bootstrap. Now move over to bootstrap and see the difference. Should be much simpler.
George Volokitin
@saintgeo23
Oct 12 2015 13:26
@TravisHi i know, but i'd like to study html css first. and then go to bootstrap)
Travis
@TravisHi
Oct 12 2015 13:27
smart move @saintgeo23
George Volokitin
@saintgeo23
Oct 12 2015 13:29
@michaelkebe thank you. i'll move of course
CamperBot
@camperbot
Oct 12 2015 13:29
saintgeo23 sends brownie points to @michaelkebe :sparkles: :thumbsup: :sparkles:
:star: 198 | @michaelkebe | http://www.freecodecamp.com/michaelkebe
Aleksandar B.
@aleksandar-b
Oct 12 2015 13:38
@KingInTheNorth what help do you need? I guess it is $(this).parent().parent().parent().parent().remove(). Because your delete button is 5 level deep.
Sidharth Kriplani
@sidkrip
Oct 12 2015 13:43
How do I solve the "Title Case a Sentence" bonfire in Basic Algorithm Scripting?
h4r1m4u
@h4r1m4u
Oct 12 2015 13:45
@sidkrip what do you have so far?
Stefan Stokic
@StefanStokic
Oct 12 2015 13:47
@samosale Yes, but I need to delete the whole panel
tva10
@tva10
Oct 12 2015 13:47
@sidkrip some regexp and replace and this task will be done
Sidharth Kriplani
@sidkrip
Oct 12 2015 13:49
I just split the array, and thought of somehow turning every letter after a whitespace (" ") to the uppercase (after turning the whole array to lowercase i.e). Didn't work out.
Blauelf
@Blauelf
Oct 12 2015 13:49
Post your code.
Sidharth Kriplani
@sidkrip
Oct 12 2015 13:50
I couldn't do this one so I found its code somewhere. How does this work?

String.prototype.replaceAt = function(index, character) {
return this.substr(0, index) + character + this.substr(index+character.length);
};

function titleCase(str) {
var newTitle = str.split(' ');
var updatedTitle = [];
for (var st in newTitle) {
updatedTitle[st] = newTitle[st].toLowerCase().replaceAt(0, newTitle[st].charAt(0).toUpperCase());
}
return updatedTitle.join(' ');
}

Aleksandar B.
@aleksandar-b
Oct 12 2015 13:50
@KingInTheNorth I just have succeed that using your codepen. Should i paste the code here?
Blauelf
@Blauelf
Oct 12 2015 13:51
help format
CamperBot
@camperbot
Oct 12 2015 13:51

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

``` ⇦ Type 3 backticks and 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

VortexLord
@VortexLord
Oct 12 2015 13:51
help
CamperBot
@camperbot
Oct 12 2015 13:51

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

Basic Commands:

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

:speech_balloon: meet CamperBot in this room!

:pencil: read more about camperbot on the FCC Wiki

Jason Wood
@catapixel
Oct 12 2015 13:51
@samosale just paste the link to your codepen (not the code itself)....
@VortexLord what do you need help with?
Blauelf
@Blauelf
Oct 12 2015 13:52
@sidkrip Your code seems to work on my computer.
Stefan Stokic
@StefanStokic
Oct 12 2015 13:53
tva10
@tva10
Oct 12 2015 13:53
@Blauelf so he want how that code works
he founded that somethere
Stefan Stokic
@StefanStokic
Oct 12 2015 13:53
Open in browser ^^
Sidharth Kriplani
@sidkrip
Oct 12 2015 13:53
This isn't my code. And I don't know how it works. yes @tva10
Blauelf
@Blauelf
Oct 12 2015 13:54
@sidkrip You might not need something like replaceAt, and newTitle[st].substr(0,0) is always "" :D
Aleksandar B.
@aleksandar-b
Oct 12 2015 13:54
@KingInTheNorth in the botom of js file write
$('body').on('click', '#deletetweet',function(){
 $(this).parent().parent().parent().parent().remove();

});
Blauelf
@Blauelf
Oct 12 2015 13:54
@tva10 Yeah, I should improve my reading skills :P
tva10
@tva10
Oct 12 2015 13:55
@Blauelf sometimes I need that too
Aleksandar B.
@aleksandar-b
Oct 12 2015 13:55
@KingInTheNorth that is the part of deleting html. You also need to delete it from array.
Sidharth Kriplani
@sidkrip
Oct 12 2015 13:56
while we are at it, (thanks btw, though I still don't understand but I will find a way), what does reverse engineering actually mean in the front end development projects? What is it that has to be done exactly? @Blauelf @tva10
CamperBot
@camperbot
Oct 12 2015 13:56
sidkrip sends brownie points to @blauelf and @tva10 :sparkles: :thumbsup: :sparkles:
:star: 355 | @blauelf | http://www.freecodecamp.com/blauelf
:star: 310 | @tva10 | http://www.freecodecamp.com/tva10
Blauelf
@Blauelf
Oct 12 2015 13:56
@sidkrip It splits the text at the space characters. Then, it converts every word to lower case. The helper function returns a string that is essentially the same as the passed string, but with a certain character replaced.
Sidharth Kriplani
@sidkrip
Oct 12 2015 13:57
ahaan. thanks @Blauelf
CamperBot
@camperbot
Oct 12 2015 13:57
sidkrip sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:warning: sidkrip already gave blauelf points
Jason Wood
@catapixel
Oct 12 2015 13:58
@sidkrip "reverse engineering" for front end development is basically a short way of saying "figure out how to make your site work like the one you see without looking at someone else's code"
Sidharth Kriplani
@sidkrip
Oct 12 2015 13:58
@catapixel and that is to be done by seeing the source code of the of the web site we have to replicate?
Blauelf
@Blauelf
Oct 12 2015 13:59
How is it even possible to not look at the code when you want to inspect it closer? Most of the DOM is directly related to the sources.
Stefan Stokic
@StefanStokic
Oct 12 2015 13:59
@samosale Great, I understand that code! :D
Jason Wood
@catapixel
Oct 12 2015 13:59
@sidkrip No. They don't want you to look at source code. They want you to use your knowledge of html, css, javascript, etc to figure out how to do it yourself
Stefan Stokic
@StefanStokic
Oct 12 2015 13:59
@samosale How could I delete from array just from user clicking delete?
Since there are multiple different tweets
Aleksandar B.
@aleksandar-b
Oct 12 2015 14:00
@KingInTheNorth wait, I will write.
or do you want to figure it out?
Sidharth Kriplani
@sidkrip
Oct 12 2015 14:01
Okay. Alright. I was about to see the source code. though I agree with @Blauelf. But thanks @catapixel
CamperBot
@camperbot
Oct 12 2015 14:01
sidkrip sends brownie points to @blauelf and @catapixel :sparkles: :thumbsup: :sparkles:
:warning: sidkrip already gave blauelf points
:star: 445 | @catapixel | http://www.freecodecamp.com/catapixel
Stefan Stokic
@StefanStokic
Oct 12 2015 14:01
I want to figure it out @samosale
Do you mind helping me through with it though?
Aleksandar B.
@aleksandar-b
Oct 12 2015 14:01
@KingInTheNorth Yes
@KingInTheNorth how do you want to help you?
Jason Wood
@catapixel
Oct 12 2015 14:02
@Blauelf @sidkrip it's just in exercise in "how would you do it". They don't care about aesthetics just the functionality. You shouldn't need to look at the source to replicate functionality. Just use what you've already learned and google around or ask about how to approach the things you don't understand...
Stefan Stokic
@StefanStokic
Oct 12 2015 14:03
@samosale Give me like the pseudocode/an idea of how to start I guess
Blauelf
@Blauelf
Oct 12 2015 14:03
If I should not look at the source code, is DOM inspection allowed at all?
Jason Wood
@catapixel
Oct 12 2015 14:03
@Blauelf not when you're doing these exercises and they explicitly say not to look.
tva10
@tva10
Oct 12 2015 14:04
Black box^^
or Gray Box
Blauelf
@Blauelf
Oct 12 2015 14:04
They say not to look at the sources, that's different, though not completely :P
Thomas Manchester
@Eruditious
Oct 12 2015 14:05
guys, im on the bonfire
Aleksandar B.
@aleksandar-b
Oct 12 2015 14:05
@KingInTheNorth you should first get the content of deleted tweet and store it as variable. Then you loop through the array and check is the array element same as that stored content. If it is delete it.
Jason Wood
@catapixel
Oct 12 2015 14:05
I think the intent is to say...if someone asked you to implement "X" in a spec how would you go about it. If you didn't have something to reference how would you solve the problem/implement the functionality?
Thomas Manchester
@Eruditious
Oct 12 2015 14:05
for reversing string, im getting the right answers popping up, but it's not passing it..
``
Sidharth Kriplani
@sidkrip
Oct 12 2015 14:05
@Eruditious which problem ?
Jason Wood
@catapixel
Oct 12 2015 14:06
@Eruditious let's see the code...
Thomas Manchester
@Eruditious
Oct 12 2015 14:06

``
function reverseString(givenString, delimiter) {
var myArray = givenString.split(delimiter);
myArray = myArray.reverse().join(delimiter);
return myArray;
};

reverseString("hello", "");
reverseString("Howdy", "");
reverseString("Greetings from Earth", "");
``

Blauelf
@Blauelf
Oct 12 2015 14:06
@Eruditious It's triple backticks :D
Thomas Manchester
@Eruditious
Oct 12 2015 14:06
woops
function reverseString(givenString, delimiter) {
  var myArray = givenString.split(delimiter);
  myArray = myArray.reverse().join(delimiter);
  return myArray;
};



reverseString("hello", "");
reverseString("Howdy", "");
reverseString("Greetings from Earth", "");
Blauelf
@Blauelf
Oct 12 2015 14:06
Oh, and that additional "" should probably be ignored, not used.
I would not want to rely on it...
tva10
@tva10
Oct 12 2015 14:07
@Eruditious hm
Thomas Manchester
@Eruditious
Oct 12 2015 14:07
its logging correctly. it is returning a string. i just used what it gave me
Aleksandar B.
@aleksandar-b
Oct 12 2015 14:07
@KingInTheNorth Are you sure you understand the html delete part. Because I have used event delegation. Otherwise it will not work.
Thomas Manchester
@Eruditious
Oct 12 2015 14:07
ive done it on coderbyte before
tva10
@tva10
Oct 12 2015 14:07
may be you don't need delimeter
because there is no delimeter in test cases reverseString("hello")....
Thomas Manchester
@Eruditious
Oct 12 2015 14:07
still, it returns the correct answer lol. it shouldnt matter
Sidharth Kriplani
@sidkrip
Oct 12 2015 14:08
@Eruditious your code is working properly :/
Thomas Manchester
@Eruditious
Oct 12 2015 14:08
maybe its a bug, idk. ill try just rewriting it without it
Sidharth Kriplani
@sidkrip
Oct 12 2015 14:08
*not that emoticon
Blauelf
@Blauelf
Oct 12 2015 14:08
That's what I wanted to say. There is all that "" where it did not use to be.
tva10
@tva10
Oct 12 2015 14:08
@Eruditious look at testcases
@Eruditious there is no delimeter there
@Eruditious reverseString("Greetings from Earth")
Jason Wood
@catapixel
Oct 12 2015 14:10

@Eruditious when I reset the code for the bonfire I see the following:

function reverseString(str) {
  return str;
}

reverseString("hello", "");

It looks like you've added a parameter that their function is not expecting....

Thomas Manchester
@Eruditious
Oct 12 2015 14:10
yeah, i know. its just included in the prompt when they give it to me
function reverseString(givenString){
  givenString.split("").reverse().join("");
  return givenString
}

reverseString("hello");
why wouldnt this work?
oh nvm. i know
Jason Wood
@catapixel
Oct 12 2015 14:12
@Eruditious When you put your code inside their function and replace with their parameters (delimiter needs to be hardcoded to empty string "") your code works...
function reverseString(str) {
  var myArray = str.split("");
  myArray = myArray.reverse().join("");
  return myArray;
}

reverseString("hello", "");
tva10
@tva10
Oct 12 2015 14:12
@Eruditious may be you don't save result there
Thomas Manchester
@Eruditious
Oct 12 2015 14:12
yeah, i didnt update the variable. i had to set givenString = givenString.split...
it passed there
weird though. it should just take the answer if its right or not, not how you do it
Blauelf
@Blauelf
Oct 12 2015 14:13
When using str.split(delimiter) with no delimiter defined, it is the same as str.split(undefined) or basically str.split().
@Eruditious The code you posted does not need that extra line.
function reverseString(givenString){
  return givenString.split("").reverse().join("");
}

reverseString("hello");
Sidharth Kriplani
@sidkrip
Oct 12 2015 14:16
But logically, why isn't it working even though it seems correct?
Jason Wood
@catapixel
Oct 12 2015 14:17
@sidkrip are you asking why this doesn't work?
function reverseString(givenString){
  givenString.split("").reverse().join("");
  return givenString
}
Sidharth Kriplani
@sidkrip
Oct 12 2015 14:17
yep.
I had to store the result into another variable for it to work
Jason Wood
@catapixel
Oct 12 2015 14:18
@sidkrip because this line givenString.split("").reverse().join(""); isn't persistent unless you assign it to a variable or use the return to return it immediately. It does the change and then chucks it away...
Sidharth Kriplani
@sidkrip
Oct 12 2015 14:19
same with this one?

function reverseString(str) {
var myArray = str.split("");
myArray = myArray.reverse().join("");
return myArray;
}

reverseString("hello", "");

Jason Wood
@catapixel
Oct 12 2015 14:21
No that code works because the variable assignments are in place throughout so each line manipulates the myArray variable then returns it
Sidharth Kriplani
@sidkrip
Oct 12 2015 14:22
also, didn't get the three backticks then shift+enter then <paste the code here> then shift+enter then three backticks then enter thing
Jason Wood
@catapixel
Oct 12 2015 14:23
you don't need to create/store the variable though if you just return it immediately and do all the changes in one line return str.split('').reverse().join('');
Blauelf
@Blauelf
Oct 12 2015 14:23
At least join() and split() don't change anything, but they return a changed result. You want to return or store that value.
Sidharth Kriplani
@sidkrip
Oct 12 2015 14:24
@catapixel tried it just now. works fine
Jason Wood
@catapixel
Oct 12 2015 14:24
:thumbsup:
Blauelf
@Blauelf
Oct 12 2015 14:25
reverse() reverses (changes!) the array and returns it for convenience, so you can use it for chaining.
Jason Wood
@catapixel
Oct 12 2015 14:25
@sidkrip @Blauelf makes a good point. reverse() is an "in place" change...split() and join() are not
Sidharth Kriplani
@sidkrip
Oct 12 2015 14:26
which means..?
Blauelf
@Blauelf
Oct 12 2015 14:26
@sidkrip About the backticks, did you follow the link at the bottom of cbot's post? :point_up: 12. Oktober 2015 15:51
Vivek
@vivek28111992
Oct 12 2015 14:27

var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;
function myFunction(){
// Create an if-else statement here to return "heads" if flip is 0. Otherwise return "tails".

// Only change code below this line.
var heads = true;
var tails = false;
if(flip===0)
{
return heads;
}
else (flip===1)
{
return tails;
}

// Only change code above this line.
}

what is problem in this code
Daniel
@clevadani
Oct 12 2015 14:27
Hey guys I need hints on how to tackle the Bonfire: Seek and Destroy
Blauelf
@Blauelf
Oct 12 2015 14:28
@sidkrip You could write
function reverseString(str) {
  var myArray = str.split(""); // <- does not change str
  myArray.reverse(); // <- actually changes myArray!
  var myStr = myArray.join(""); // <- does not change myArray
  return myStr;
}
Sidharth Kriplani
@sidkrip
Oct 12 2015 14:28
else shouldn't have a statement
@vivek28111992
Jason Wood
@catapixel
Oct 12 2015 14:28
@sidkrip an "in place" change means that when it's applied the original is permanently changed without having to use an assignment operator (=). If you wrote array.reverse(); and then on the next line console.log(array) you would see that the array was successfully reversed even though you didn't assign it to anything.
Sidharth Kriplani
@sidkrip
Oct 12 2015 14:28
@Blauelf that was my first attempt. changed it to return str.split("").reverse().join("");
Vivek
@vivek28111992
Oct 12 2015 14:29
@sidkrip still not executing
Sidharth Kriplani
@sidkrip
Oct 12 2015 14:29
@catapixel mhm (Y)
@vivek28111992
if(flip===0)
{
return heads;
}
else
{
return tails;
}
@vivek28111992
which problem is it?
Blauelf
@Blauelf
Oct 12 2015 14:31
@sidkrip :point_up: 12. Oktober 2015 16:26
Vivek
@vivek28111992
Oct 12 2015 14:31
@sidkrip still no luck