24th
Oct 2015
Judy T
@judes3011
Oct 24 2015 00:29 UTC
Hello....can anyone help with this? I keep getting this error and i can't find the solution :(
The random number generated by myFunction should be an integer, not a decimal.

var min = 0;
var max = 9;
function myFunction() {
// Make myFunction return a random number between min and max values instead of a decimal
// Only change code below this line.

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

// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
(function(){return myFunction();})();

Jeanne Erickson Cooley
@JeanneEricksonCooley
Oct 24 2015 00:31 UTC
Doesn't the '10' need to be within the parenthesis?
Judy T
@judes3011
Oct 24 2015 00:32 UTC
do you mean like this?
return Math.random();
Math.floor(Math.random(10));
Math.floor(Math.random() * (max - min + 1)) + min;
still doesn't work :(
Chris Crook
@chrisisacrook
Oct 24 2015 00:34 UTC

I think you need to combine the lines. Also you don't need the 10 in there.

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

Judy T
@judes3011
Oct 24 2015 00:35 UTC
omg. it worked! thanks so much @chrisisacrook and @JeanneEricksonCooley !
CamperBot
@camperbot
Oct 24 2015 00:35 UTC
judes3011 sends brownie points to @chrisisacrook and @jeanneericksoncooley :sparkles: :thumbsup: :sparkles:
:star: 223 | @jeanneericksoncooley | http://www.freecodecamp.com/jeanneericksoncooley
:star: 165 | @chrisisacrook | http://www.freecodecamp.com/chrisisacrook
Rafael J. Rodriguez
@Rafase282
Oct 24 2015 00:35 UTC
what's up?
Jeanne Erickson Cooley
@JeanneEricksonCooley
Oct 24 2015 00:35 UTC
I am double checking mine. But, I think @chrisisacrook is right.
Yup @judes3011, @chrisisacrook is correct.
Jason
@Jauble
Oct 24 2015 00:44 UTC
Anyone know why nothing inside my document.ready() seems to work? http://codepen.io/auble220/pen/avyZZE
Jordan Bourne
@JordanBourne
Oct 24 2015 00:50 UTC
@Jauble you never close the $(document).ready function wait hold on Matt Yamamoto @MattYamamoto Oct 24 2015 00:51 UTC @Jauble you didn't close your time function Jordan Bourne @JordanBourne Oct 24 2015 00:51 UTC Yeah you're just missed a bracket at the end @Jauble if you press F12 you should be able to get to the console in your browser, which will display any sort of syntax errors like that. VeeShostak @VeeShostak Oct 24 2015 01:47 UTC Hey guys! Using jQuery, I am trying to apply a transition effect using .css({ }) one time.... and then apply another transition effect one time with .css({ })- ( I want ot accomplish this once the transition effect in the first .css({ }) declaration is finished) -I was wondering if this would be possible by using .queue, but I can't find a good example of the queue method to understand if it would work Laura Stephenson @lauralstephenson Oct 24 2015 01:50 UTC Waypoint 80 I am confused as to how to make a btn tag. Here is my current code: ..<img src="http://bit.ly/fcc-running-cats" class="img-responsive" class1="btn">Like .. please help Create a new button element with the text "Like". X Your new button should have the class btn. X Make sure all your button elements have a closing tag. Y Do you want the whole code? it is ..*<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css"> <style> .red-text { color: red; } h2 { font-family: Lobster, Monospace; } p { font-size: 16px; font-family: Monospace; } .thick-green-border { border-color: green; border-width: 10px; border-style: solid; border-radius: 50%; } .smaller-image { width: 100px; } </style> <div class="container-fluid"> <h2 class="red-text text-center">CatPhotoApp</h2> <p>Click here for <a href="#">cat photos</a>.</p> <a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a> <img src="http://bit.ly/fcc-running-cats" class="img-responsive" class1="btn">Like <p>Things cats love:</p> <ul> <li>cat nip</li> <li>laser pointers</li> <li>lasagna</li> </ul> <p>Top 3 things cats hate:</p> <ol> <li>flea treatment</li> <li>thunder</li> <li>other cats</li> </ol> <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>..* VeeShostak @VeeShostak Oct 24 2015 01:56 UTC @lauralstephenson you would need to create a new button Element first. <button> </button> Chris Crook @chrisisacrook Oct 24 2015 02:00 UTC @lauralstephenson you need button tags in which you put the type and class descriptions. <button type="" class="">Text</button> VeeShostak @VeeShostak Oct 24 2015 02:04 UTC @lauralstephenson its a new element, so don't place it inside the <img tag> declare it separately <img src="http://bit.ly/fcc-running-cats" class="img-responsive"> <button> </button> then apply the class .btn to it. and add the text "Like" Laura Stephenson @lauralstephenson Oct 24 2015 02:04 UTC Thanks, @VeeShostak and @chrisisacrook ! CamperBot @camperbot Oct 24 2015 02:04 UTC lauralstephenson sends brownie points to @veeshostak and @chrisisacrook :sparkles: :thumbsup: :sparkles: :star: 204 | @veeshostak | http://www.freecodecamp.com/veeshostak :star: 169 | @chrisisacrook | http://www.freecodecamp.com/chrisisacrook idanceicode @idanceicode Oct 24 2015 02:06 UTC I am getting this error: "Your p element should have the text "View more " (with a space after it)." '<p>View more <a href="http://www.freecatphotoapp.com">cat photos </a></p>' I am getting this error: "Your p element should have the text "View more " (with a space after it)." <p>View more <a href="http://www.freecatphotoapp.com">cat photos </a></p> It seems I have done it correctly but maybe there is a bug? Edward Udelle @EdwardUdelle Oct 24 2015 02:08 UTC Thanks @SaintPeter I was having trouble with that script tag and document ready exercise too. Is there a reason for the closing curly brace parenthesis and semi colon being on a separate line? CamperBot @camperbot Oct 24 2015 02:08 UTC edwardudelle sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles: :star: 1178 | @saintpeter | http://www.freecodecamp.com/saintpeter James Smith @matthew02 Oct 24 2015 02:11 UTC @idanceicode Don't really see a problem there. Can you post your entire code? Rex Schrader @SaintPeter Oct 24 2015 02:12 UTC @EdwardUdelle I'm afraid I've lost the context, so I'm not sure how to answer your question. Trish Snyder @TrishSnyder Oct 24 2015 02:17 UTC I’m working on my first zipline on codepen and I need to add an image. I assume I need my images hosted on a public site. Any suggestions? Rex Schrader @SaintPeter Oct 24 2015 02:18 UTC @TrishSnyder I like imgur @TrishSnyder But you can also host them on github Trish Snyder @TrishSnyder Oct 24 2015 02:18 UTC ok. Thanks @SaintPeter CamperBot @camperbot Oct 24 2015 02:18 UTC trishsnyder sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles: :star: 1179 | @saintpeter | http://www.freecodecamp.com/saintpeter Jason @Jauble Oct 24 2015 02:43 UTC @JordanBourne @MattYamamoto Got it to work. Thanks guys CamperBot @camperbot Oct 24 2015 02:43 UTC jauble sends brownie points to @jordanbourne and @mattyamamoto :sparkles: :thumbsup: :sparkles: :star: 386 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto :star: 253 | @jordanbourne | http://www.freecodecamp.com/jordanbourne Randy Torres @randytorres Oct 24 2015 02:53 UTC Hello, Im having trouble on a Waypoint: Make Instances of Objects with a Constructor Function Here is my code Laura Stephenson @lauralstephenson Oct 24 2015 02:53 UTC Boot camp 84, can't seem to: Each of your Bootstrap buttons should be nested within its own div element with the class col-xs-4. Here is my code:..*<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css"> <style> .red-text { color: red; } h2 { font-family: Lobster, Monospace; } p { font-size: 16px; font-family: Monospace; } .thick-green-border { border-color: green; border-width: 10px; border-style: solid; border-radius: 50%; } .smaller-image { width: 100px; } .row .col-xs-4 </style> <div class="container-fluid"> <h2 class="red-text text-center">CatPhotoApp</h2> <p>Click here for <a href="#">cat photos</a>.</p> <a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a> <img src="http://bit.ly/fcc-running-cats" class="img-responsive"> <div class="row"> <button class="btn btn-block btn-primary" "col-xs-4">Like</button> </div> <div class="row"> <button class="btn btn-block btn-info" "col-xs-4">Info</button> </div> <div class="row"> <button class="btn btn-block btn-danger" "col-xs-4">Delete</button> </div> ..* Colter Joles @Co6alt Oct 24 2015 02:55 UTC Hey @randytorres I think I'm stuck on the same one right now. Just not really sure what it's asking me to do Randy Torres @randytorres Oct 24 2015 02:55 UTC var Car = function() { this.wheels = 4; }; // Only change code below this line. var myCar = new Car() //Add the property "engines" to myCar, and make it a number. sorry thats not right var Car = function() { this.wheels = 4; }; // Only change code below this line. var myCar = new Car() this.engines = 1; //Add the property "engines" to myCar, and make it a number. // Only change code above this line. (function() {return JSON.stringify(myCar);})(); var Car = function() { this.wheels = 4; }; // Only change code below this line. var myCar = new Car() this.engines = 1; //Add the property "engines" to myCar, and make it a number. // Only change code above this line. (function() {return JSON.stringify(myCar);})(); @Co6alt I know thats not right but im not sure either Matt Yamamoto @MattYamamoto Oct 24 2015 02:58 UTC @randytorres this is a tricky thing to understand, but in your code it is referring to the global object. Just refernce your obect like this myCar.engine = 1 you have the right idea with dot notation, but this only works the way you are thinking inside the function constructor. Colter Joles @Co6alt Oct 24 2015 02:59 UTC @MattYamamoto So just entering it like that create the property and adds it to the object? Matt Yamamoto @MattYamamoto Oct 24 2015 02:59 UTC yup Mark Pearyer @marcusp619 Oct 24 2015 03:00 UTC @randytorres this deals with the scope and in this instance you are pointing towards the global object. Use dot notation on the object you just created Randy Torres @randytorres Oct 24 2015 03:01 UTC @MattYamamoto @marcusp619 Thanks a lot that definitely makes sense CamperBot @camperbot Oct 24 2015 03:01 UTC randytorres sends brownie points to @mattyamamoto and @marcusp619 :sparkles: :thumbsup: :sparkles: :star: 387 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto :star: 273 | @marcusp619 | http://www.freecodecamp.com/marcusp619 Colter Joles @Co6alt Oct 24 2015 03:01 UTC Thanks @MattYamamoto I've been struggling with this one for a couple days actually. Thanks @randytorres for asking the question too, CamperBot @camperbot Oct 24 2015 03:01 UTC co6alt sends brownie points to @mattyamamoto and @randytorres :sparkles: :thumbsup: :sparkles: :star: 388 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto :star: 173 | @randytorres | http://www.freecodecamp.com/randytorres Randy Torres @randytorres Oct 24 2015 03:01 UTC @Co6alt its nice to know im not the only one who needed help lol Colter Joles @Co6alt Oct 24 2015 03:02 UTC @randytorres Ha yeah I was a bit worried about asking so early into the classes but I feel like this one just skipped a couple steps without me Rex Schrader @SaintPeter Oct 24 2015 03:03 UTC @MattYamamoto Did you ever finish your awesome dot-matrix display? Mark Pearyer @marcusp619 Oct 24 2015 03:03 UTC Read Google then ask @Co6alt Matt Yamamoto @MattYamamoto Oct 24 2015 03:04 UTC @marcusp619 I can't say for sure because I'm not that comfortable with the this keyword, but I think it's more complicated than just scope. Mark Pearyer @marcusp619 Oct 24 2015 03:04 UTC Even if your not understanding it yet always take a look at the documentation. Half our job is looking for answers lol Rex Schrader @SaintPeter Oct 24 2015 03:05 UTC @marcusp619 Truth. Matt Yamamoto @MattYamamoto Oct 24 2015 03:05 UTC @SaintPeter yeah...haha, finally! Actually I couldn't get it to behave as I wanted, but I figured I needed to move on. It has issues on my iPhone (something about the speed of operation). the FCC twitter account retweeted it out today. woot! Mark Pearyer @marcusp619 Oct 24 2015 03:06 UTC @MattYamamoto this often points towards something for example inside a function/object using this points to the function/object Rex Schrader @SaintPeter Oct 24 2015 03:06 UTC @MattYamamoto Awesome, I'll have to check it out. Mark Pearyer @marcusp619 Oct 24 2015 03:07 UTC @MattYamamoto say you have a function within a function and you use this inside the inside function it is pointing towards that function if it can't find what it is looking for it goes up the function chain into the function that is surrounding the inside function Laura Stephenson @lauralstephenson Oct 24 2015 03:07 UTC Um....anyone want to help me? Posting again: Boot camp 84, can't seem to: Each of your Bootstrap buttons should be nested within its own div element with the class col-xs-4. Here is my code:..*<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css"> <style> .red-text { color: red; } h2 { font-family: Lobster, Monospace; } p { font-size: 16px; font-family: Monospace; } .thick-green-border { border-color: green; border-width: 10px; border-style: solid; border-radius: 50%; } .smaller-image { width: 100px; } .row .col-xs-4 </style> <div class="container-fluid"> <h2 class="red-text text-center">CatPhotoApp</h2> <p>Click here for <a href="#">cat photos</a>.</p> <a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a> <img src="http://bit.ly/fcc-running-cats" class="img-responsive"> <div class="row"> <button class="btn btn-block btn-primary" "col-xs-4">Like</button> </div> <div class="row"> <button class="btn btn-block btn-info" "col-xs-4">Info</button> </div> <div class="row"> <button class="btn btn-block btn-danger" "col-xs-4">Delete</button> </div> ..* Mark Pearyer @marcusp619 Oct 24 2015 03:07 UTC Lol even explaining it makes it sound funny Matt Yamamoto @MattYamamoto Oct 24 2015 03:07 UTC @marcusp619 if you just write a function and reference this inside that function it will still reference the global object... this only binds to a different object when used inside another object. At least that's my understanding. @marcusp619 yes, talking about this often sounds funny. But what you describe is the scope chain, but that's different, isn't it? Mark Pearyer @marcusp619 Oct 24 2015 03:10 UTC I'll give an example let me get on my laptop and off my phone Matt Yamamoto @MattYamamoto Oct 24 2015 03:10 UTC This message was deleted wiki formatting CamperBot @camperbot Oct 24 2015 03:12 UTC :point_right: code formatting [wiki] Inline code This an inline <paste code here> code formatting with a single backtick() at start and end around the code. Code Block  ⇦ Type 3 backticks 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 Matt Yamamoto @MattYamamoto Oct 24 2015 03:12 UTC @lauralstephenson @lauralstephenson in any event, you should put another set of divs around your buttons and then give those the col class. Also, when applying multiple classes just use one set of quotes and seperate the classes with spaces. Mark Pearyer @marcusp619 Oct 24 2015 03:18 UTC @MattYamamoto Okay what is will be logged in fn b. function b() { console.log(myVar); } function a() { var myVar = 2; b(); } var myVar = 1; a(); @MattYamamoto what is logged in function b Matt Yamamoto @MattYamamoto Oct 24 2015 03:20 UTC @marcusp619 1 since function b's myVar is referencing the global myVar, right? Mark Pearyer @marcusp619 Oct 24 2015 03:21 UTC @MattYamamoto correct! you got it. Matt Yamamoto @MattYamamoto Oct 24 2015 03:22 UTC @marcusp619 but that's just scoping for functions/variables. Throw a console.log(this) inside either function and you'll get the global object. Mark Pearyer @marcusp619 Oct 24 2015 03:25 UTC @MattYamamoto scope is where a variable is available in a code. Whoops didn't mean to send that yet Laura Stephenson @lauralstephenson Oct 24 2015 03:33 UTC OK, one more time, Waypoint 85, directions are: Your buttons should all be nested within the same div element with the class row.-Y Each of your Bootstrap buttons should be nested within its own div element with the class col-xs-4. x Make sure each of your button elements has a closing tag. Y Make sure each of your div elements has a closing tag. Y My code is: \\ <link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css"> <style> .red-text { color: red; } h2 { font-family: Lobster, Monospace; } p { font-size: 16px; font-family: Monospace; } .thick-green-border { border-color: green; border-width: 10px; border-style: solid; border-radius: 50%; } .smaller-image { width: 100px; } .row .col-xs-* </style> <div class="container-fluid"> <h2 class="red-text text-center">CatPhotoApp</h2> <p>Click here for <a href="#">cat photos</a>.</p> <a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a> <img src="http://bit.ly/fcc-running-cats" class="img-responsive"> <div class=row col-xs-*> <button class="btn btn-block btn-primary col-xs-4">Like</button></div> <div class=row col-xs-*> <button class="btn btn-block btn-info col-xs-4">Info</button></div> <div class=row col-xs-*> <button class="btn btn-block btn-danger col-xs-4">Delete</button> </div> <p>Things cats love:</p> \\ Matt Yamamoto @MattYamamoto Oct 24 2015 03:34 UTC @lauralstephenson format your code using  backticks at the start and end wiki formatting CamperBot @camperbot Oct 24 2015 03:34 UTC :point_right: code formatting [wiki] Inline code This an inline <paste code here> code formatting with a single backtick() at start and end around the code. Code Block  ⇦ Type 3 backticks 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 Matt Yamamoto @MattYamamoto Oct 24 2015 03:35 UTC @lauralstephenson second, did you read my earlier answer? was that helpful? Laura Stephenson @lauralstephenson Oct 24 2015 03:39 UTC I tried. and I can't get the backticks thingy to work, either. Matt Yamamoto @MattYamamoto Oct 24 2015 03:41 UTC @lauralstephenson put three backticks (button near the escape key) on a line then hit shift-enter to go to a new line... past your code... then shift-enter to get to a new line again and then do three backticks again Jorge Rodriguez @rodri0315 Oct 24 2015 03:42 UTC Help with this, Reverse a String: I thought this look right but it is not working. function reverseString(str) { return str; } reverseString("hello").split("").reverse().join(""); CamperBot @camperbot Oct 24 2015 03:42 UTC no wiki entry for: with this reverse a string i thought this look right but it is not working function reversestringstr return strreversestringhellosplitreversejoin :pencil: click here to create one now!after creating your page type update to reload it here Matt Yamamoto @MattYamamoto Oct 24 2015 03:42 UTC @lauralstephenson in any event when you're asked to put something in a div, or to wrap something in a div you need to imagine this <div> ...stuff in here </div> you need both the opening and closing tags to be around the content you are wrapping in the divs James Smith @matthew02 Oct 24 2015 03:42 UTC @rodri0315 .split("").reverse().join("") needs to be in your reverseString function. @rodri0315 and it needs to apply to str. Jorge Rodriguez @rodri0315 Oct 24 2015 03:43 UTC @matthew02 okay, let me try... Laura Stephenson @lauralstephenson Oct 24 2015 03:45 UTC  <div class=row col-xs-4> <button class="btn btn-block btn-primary col-xs-4">Like</button></div> <div class=row col-xs-4> <button class="btn btn-block btn-info col-xs-4">Info</button></div> <div class=row col-xs-4> <button class="btn btn-block btn-danger col-xs-4">Delete</button> </div> Matt Yamamoto @MattYamamoto Oct 24 2015 03:46 UTC @lauralstephenson hold down shift while you press enter Laura Stephenson @lauralstephenson Oct 24 2015 03:46 UTC My stuff seems to be encased in divs. Am I missing one? James Smith @matthew02 Oct 24 2015 03:46 UTC @lauralstephenson Press [shift + enter ⏎] Matt Yamamoto @MattYamamoto Oct 24 2015 03:46 UTC @lauralstephenson you don't need the col-xs-4 class on the buttons themselves, get rid of those Laura Stephenson @lauralstephenson Oct 24 2015 03:47 UTC Okay, @MattYamamoto , thank you, but it still says Each of your Bootstrap buttons should be nested within its own div element with the class col-xs-4. CamperBot @camperbot Oct 24 2015 03:47 UTC lauralstephenson sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles: :star: 389 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto Laura Stephenson @lauralstephenson Oct 24 2015 03:48 UTC What am I doing wrong? VeeShostak @VeeShostak Oct 24 2015 03:49 UTC <div class =" "> one of your bootstrap buttons </div> nest each button in a div @lauralstephenson Then apply the class col-xs-4 to each one of those divs. Takuma @takumab Oct 24 2015 03:51 UTC on this waypoint: Waypoint: Give your JavaScript Slot Machine some Stylish Images and keep getting "Use the provided code three times. One for each slot." I have did exactly what it has asked but it won't let me move to the next Waypoint Matt Yamamoto @MattYamamoto Oct 24 2015 03:51 UTC @lauralstephenson oh yeah, sorry, i didn't look to closely at your code. You're going to need a div wrapping each button, as @VeeShostak is pointing out, AND you also need all of that wrapped in a div with the class "row" @lauralstephenson the "row" div should contain three "col-xs-4" divs... and each of those divs should contain an individual button @takumab is everything green check marks? Kevin Diem @kgdiem Oct 24 2015 03:55 UTC working on learnyounode, at the "HTTP Collect" lesson, anyone know what the concept behind it is? I've tried looking it up but I don't want an answer, I want to know more about what I'm supposed to do Dan Morency @g0shdanit Oct 24 2015 03:55 UTC trying to learn the .pop() but can only get half of the function to po *pop *variable JK IM DUMB Takuma @takumab Oct 24 2015 04:03 UTC @MattYamamoto all except one Sawredjet @sawredjet Oct 24 2015 04:05 UTC I am not sure how to put more than one class in the image element Laura Stephenson @lauralstephenson Oct 24 2015 04:05 UTC thanks @takumab @MattYamamoto got my brain in gear. Need some cola...stat. CamperBot @camperbot Oct 24 2015 04:05 UTC lauralstephenson sends brownie points to @takumab and @mattyamamoto :sparkles: :thumbsup: :sparkles: :warning: lauralstephenson already gave mattyamamoto points :star: 93 | @takumab | http://www.freecodecamp.com/takumab Sawredjet @sawredjet Oct 24 2015 04:06 UTC I am not sure how to put more than one class in the image element Matt Yamamoto @MattYamamoto Oct 24 2015 04:07 UTC @takumab which one? @sawredjet you can use multiple classes by seperating them in the quotes class="one two etc" Sawredjet @sawredjet Oct 24 2015 04:08 UTC challenge 21 Takuma @takumab Oct 24 2015 04:09 UTC "Use the provided code three times. One for each slot." @MattYamamoto Sawredjet @sawredjet Oct 24 2015 04:09 UTC how do you use the quotations exactly? Matt Yamamoto @MattYamamoto Oct 24 2015 04:10 UTC @takumab it's very particular about how you type it in... past in a link to the page (your code) @sawredjet when you set a class on an element, say a div for example, you would do something like <div class="class1 class2">. You can add as many classes as you like, just seperate them with spaces Takuma @takumab Oct 24 2015 04:13 UTC @MattYamamoto$($(".slot")[0]).html("<img src='" + images[slotOne-1] + "'>");$($(".slot")[1]).html("<img src='" + images[slotTwo-1] + "'>");$($(".slot")[2]).html("<img src='" + images @MattYamamoto sorry about that I meant to do something else Matt Yamamoto @MattYamamoto Oct 24 2015 04:18 UTC @takumab use single quotes and double quotes exactly as the example does.. try that. Takuma @takumab Oct 24 2015 04:20 UTC @MattYamamoto ok. Thanks CamperBot @camperbot Oct 24 2015 04:20 UTC takumab sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles: :star: 390 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto Takuma @takumab Oct 24 2015 04:26 UTC @MattYamamoto that worked! Thanks D/S @dantesolis Oct 24 2015 04:41 UTC Good morning peeps mrmgarcia @mrmgarcia Oct 24 2015 04:44 UTC Hi, someone could help me.$(".target:nth-child(2)").addClass("animatedbounce");
it said that the second element should bounce but it doesn't work
James Smith
@matthew02
Oct 24 2015 04:47 UTC
@mrmgarcia Add a space between animated and bounce and see if that does the trick.
mrmgarcia
@mrmgarcia
Oct 24 2015 04:49 UTC
@matthew02 thanks
CamperBot
@camperbot
Oct 24 2015 04:49 UTC
mrmgarcia sends brownie points to @matthew02 :sparkles: :thumbsup: :sparkles:
:star: 356 | @matthew02 | http://www.freecodecamp.com/matthew02
James Smith
@matthew02
Oct 24 2015 04:49 UTC
@mrmgarcia You bet!
Kasun Weerasinghe
@kasunw310
Oct 24 2015 04:49 UTC
hi guys I'm stuck on a waypoint..
Waypoint: Target HTML Elements with Selectors Using jQuery
Use the jQuery addClass() function to give the classes animated and bounce to your button elements.
heres the code for my button elements
<button class="btn btn-default target" id="target1">#target1</button>
i added animated bounce to my button class but nothing
i mean the buttons move and are animated but i can't complete the challenge
D/S
@dantesolis
Oct 24 2015 04:57 UTC
Try resetting the code and doing it again if that doesn’t work what error message are you getting?
Danielle "Dani" Moss
@psykobilliethekid
Oct 24 2015 04:57 UTC
does anyone know if there will be a section on AJAX, JSON, and APIs in the future? i feel like im the only one that's lost in those 3 areas :pensive:
D/S
@dantesolis
Oct 24 2015 04:57 UTC

Help. I’m stuck still in the Bonfire: Palindrome

 

CamperBot
@camperbot
Oct 24 2015 04:57 UTC
no wiki entry for: im stuck still in the bonfire palindrome
:pencil: click here to create one now!after creating your page type update to reload it here
DJ
@qualitymanifest
Oct 24 2015 04:58 UTC
@psykobilliethekid i dont know if there will be, but for what it's worth that part was tough for me too
D/S
@dantesolis
Oct 24 2015 04:59 UTC
sorry was trying to do that…2nd try :smile:
 function palindrome(str) {
// Good luck!
var len = str.toLowerCase().length;
for ( var i = 0; i < Math.floor(len/2); i++ ) {
if (str[i] !== str[len - 1 - i]) {
return false;
}
}
return true;
}
I get true on the console
Danielle "Dani" Moss
@psykobilliethekid
Oct 24 2015 05:00 UTC
@qualitymanifest thanks! at least i know im not the only one
CamperBot
@camperbot
Oct 24 2015 05:00 UTC
psykobilliethekid sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 299 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
D/S
@dantesolis
Oct 24 2015 05:02 UTC
I can’t move pass this challenge
Someone had recommended for me to use regex, but I suck at that
DJ
@qualitymanifest
Oct 24 2015 05:04 UTC
@dantesolis from what i can tell it looks like you're trying to loop over half of str to see if the second half, run backwards, is the same
D/S
@dantesolis
Oct 24 2015 05:05 UTC
correct
DJ
@qualitymanifest
Oct 24 2015 05:05 UTC
@dantesolis you basically have to use regex for this, to get rid of spaces, punctuation, etc.
D/S
@dantesolis
Oct 24 2015 05:05 UTC
DJ
@qualitymanifest
Oct 24 2015 05:05 UTC
@dantesolis since you haven't done that, the first time your loop hits a space or punctuation mark, it returns false
the level of regex understanding you will need for this isn't too crazy. and you really ought to get comfortable with regex anyway
if you use regex you won't even need a loop
D/S
@dantesolis
Oct 24 2015 05:07 UTC
Thanks @qualitymanifest . I guess I might as well stop trying to avoid doing regex
CamperBot
@camperbot
Oct 24 2015 05:07 UTC
dantesolis sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 300 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Kasun Weerasinghe
@kasunw310
Oct 24 2015 05:31 UTC
@dantesolis sorry i forgot to respond but i figured it out, i was reading the challenge wrong lol
thanks though @dantesolis
CamperBot
@camperbot
Oct 24 2015 05:31 UTC
kasunw310 sends brownie points to @dantesolis :sparkles: :thumbsup: :sparkles:
:star: 186 | @dantesolis | http://www.freecodecamp.com/dantesolis
D/S
@dantesolis
Oct 24 2015 05:32 UTC
@qualitymanifest would I need a if stament though?
DJ
@qualitymanifest
Oct 24 2015 05:34 UTC
@dantesolis yes
D/S
@dantesolis
Oct 24 2015 05:35 UTC
ok So i’m in the right track. Thanks man
DJ
@qualitymanifest
Oct 24 2015 05:36 UTC
no problem
Chao
@iseliget
Oct 24 2015 05:54 UTC
Hi. I am working on Bonfire: Chunky Monkey, and the console only says “Your output will go here"
Benjamin Schachter
@benschac
Oct 24 2015 06:03 UTC
@iseliget have you modified the function?
Erik Cohen
@cohenpts
Oct 24 2015 06:04 UTC
This message was deleted
This message was deleted
This message was deleted
This message was deleted
Hans van Riet
@hansinla
Oct 24 2015 06:07 UTC
@cohenpts Because the first time you divide by 1 and the remainder is zero.
Erik Cohen
@cohenpts
Oct 24 2015 06:08 UTC
sorry i deleted @hansinla i thought noone was here and moved my question to the main FCC room

Hey Campers, Happy friday.
I was working on bonfire Smalles Common Multiple
and was just wanting a bit of direction i hope i got to the right place.

 function smallestCommons(arr) {
var commonMultiple = 1;

while (commonMultiple % arr[0] !== 0 && commonMultiple%arr[1] !== 0){
commonMultiple++;
console.log(commonMultiple);
}
return commonMultiple;
}

console.log(smallestCommons([1,5]),
smallestCommons([5, 1]),
smallestCommons([1, 13]));

Why is my While loop not working?

(was the question i deleted)

@hansinla 1%5 is not 0
Hans van Riet
@hansinla
Oct 24 2015 06:11 UTC
This message was deleted
Jaykishan Kacha
@jaykishan10
Oct 24 2015 06:12 UTC

function titleCase(str) {
str0 = str0.toUpperCase();

for(var i=0;i<str.length;i++){
if(str.charAt[i] ==" "){
str.charAt[i+1] = charAt[i+1].toUpperCase();
}
}
return str;
}

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

it is not working
why??
Erik Cohen
@cohenpts
Oct 24 2015 06:14 UTC
str0 = str0.toUpperCase();
is the '0' a typo?
DJ
@qualitymanifest
Oct 24 2015 06:15 UTC
@cohenpts i've been trying to figure out why it's blue... im guessing the chat is formatting something he wrote around 0
Erik Cohen
@cohenpts
Oct 24 2015 06:15 UTC
function titleCase(str) {
str[0] = str[0].toUpperCase();

for(var i=0;i<str.length;i++){
if(str.charAt[i] ==" "){
str.charAt[i+1] = charAt[i+1].toUpperCase();
}
}
return str;
}

titleCase("I'm a little tea pot");
bf titleCase
CamperBot
@camperbot
Oct 24 2015 06:16 UTC
Sorry, can't find a bonfire called titlecase. [ Check the map? ]
Erik Cohen
@cohenpts
Oct 24 2015 06:17 UTC
bf title-case-a-sentence
CamperBot
@camperbot
Oct 24 2015 06:17 UTC

: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

Erik Cohen
@cohenpts
Oct 24 2015 06:18 UTC
bf details
CamperBot
@camperbot
Oct 24 2015 06:18 UTC

: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.
For the purpose of this exercise, you should also capitalize connecting words like 'the' and 'of'.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
Hans van Riet
@hansinla
Oct 24 2015 06:18 UTC
@cohenpts I think you need to use || in your while condition
Erik Cohen
@cohenpts
Oct 24 2015 06:18 UTC
that wouldn't make sense @hansinla i want both condition to be true not just one.
it still doesnt run
@jaykishan10 are you still with us?
Hans van Riet
@hansinla
Oct 24 2015 06:21 UTC
@cohenpts Well, your test doesn’t make sense because you need to find common multiples over the whole range, not just the two parameters in the array.
Erik Cohen
@cohenpts
Oct 24 2015 06:23 UTC
but the tests only supply arrays of 2 arguments
why would i need to check through a range?
i think i get what you are saying
but still the while loop isent being executed
Jaykishan Kacha
@jaykishan10
Oct 24 2015 06:24 UTC
hint
CamperBot
@camperbot
Oct 24 2015 06:24 UTC
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Hans van Riet
@hansinla
Oct 24 2015 06:26 UTC
@cohenpts because you check for !==0
leemarkp
@leemarkp
Oct 24 2015 06:28 UTC
just checking out the help feature
if anybody is interested by the way here's a link to my LinkedIn profile
have a great evening
: )
Erik Cohen
@cohenpts
Oct 24 2015 06:31 UTC
@hansinla should it be ===
?
Chase Thomas
@ChaseMThomas
Oct 24 2015 06:38 UTC
Just posted in general, but this place seems more appropriate....I'm working on a quiz app. I want to make my code so that when the user clicks one of the choices, it's compared with the correct answer. I have pretty much everything in order... but I'm stuck on getting the code to wait for user input... any ideas how to make the code wait for the user to click a button before moving on??? I need to use only javascript, not jQuery. Any help would be amazing, as I've been struggling with this for a couple days. Thanks.
CamperBot
@camperbot
Oct 24 2015 06:38 UTC
if you want to thank someone, put an @ before their name!
DTing
@dting
Oct 24 2015 06:39 UTC
@ChaseMThomas do you have the code hosted somewhere?
Chase Thomas
@ChaseMThomas
Oct 24 2015 06:40 UTC
DTing
@dting
Oct 24 2015 06:42 UTC
@ChaseMThomas you probably make an element that displays if the user got the answer right or wrong
<div id="result"></div>
hmm
Justine
@justine06
Oct 24 2015 06:46 UTC
h2 .red-text {color: red;}
</style>
i can't make the font color red
but when I remove the .red-text code color appears.
Chase Thomas
@ChaseMThomas
Oct 24 2015 06:47 UTC
@dting... not quite sure what you mean... right now I'm attempting to use a function userInput() to send information about which button they clicked. Then I keep trying to make it compare the user input with the correct answer... but the code just keeps jumping past it and I don't know why.
DTing
@dting
Oct 24 2015 06:50 UTC
Chase Thomas
@ChaseMThomas
Oct 24 2015 06:51 UTC
Holy smokes Batman! Thanks @dting!
CamperBot
@camperbot
Oct 24 2015 06:51 UTC
chasemthomas sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1451 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Oct 24 2015 06:53 UTC
the function call to guess was being called with index+1
but the answers are indexed starting at 0
Chase Thomas
@ChaseMThomas
Oct 24 2015 06:54 UTC
Okay, thanks!
CamperBot
@camperbot
Oct 24 2015 06:54 UTC
if you want to thank someone, put an @ before their name!
Chase Thomas
@ChaseMThomas
Oct 24 2015 07:28 UTC
@dting. So let me see if I understand this correctly... (1) You created a function which showed the quote and answers on the screen, and called it. (2) Then you connect the buttons to a function which increased the score if they got it right; no matter what, when clicked, this function increases the count and calls the first function again.... so what I was doing wrong before was putting 1 and 2 in the same function. I was trying to make the user's guess affect this one function, but I failed to make it have any real effect on the overall code, so it did nothing.
Thanks again @dting!
CamperBot
@camperbot
Oct 24 2015 07:29 UTC
chasemthomas sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:warning: chasemthomas already gave dting points
DTing
@dting
Oct 24 2015 07:38 UTC
@ChaseMThomas nps. gluck!
Justine
@justine06
Oct 24 2015 07:46 UTC

<style>
h2
.red-text {

color: red;
}

</style>

<h2>CatPhotoApp</h2>

what is wrong ?

h4r1m4u
@h4r1m4u
Oct 24 2015 07:50 UTC
@justine06 you didn't apply your .red-text class to the <h2> element in your html
<h2 class="some-class">CatPhotoApp</h2> is how you apply .some-class to the <h2>
Chao
@iseliget
Oct 24 2015 07:59 UTC
Does FCC support using Math.max.apply(null,array)?
Never mind. I restarted my browser and it worked.
Justine
@justine06
Oct 24 2015 08:09 UTC
@h4r1m4u thanks a lot...I almost got stuck in here..
h4r1m4u
@h4r1m4u
Oct 24 2015 08:09 UTC
you're welcome
Souvik Maity
@souvikmaity777
Oct 24 2015 09:50 UTC

Waypoint: Fill in the Blank with Placeholder Text

Web developers traditionally use lorem ipsum text as placeholder text. It's called lorem ipsum text because those are the first two words of a famous passage by Cicero of Ancient Rome.

lorem ipsum text has been used as placeholder text by typesetters since the 16th century, and this tradition continues on the web.

Well, 5 centuries is long enough. Since we're building a CatPhotoApp, let's use something called kitty ipsum text.

Replace the text inside your p element with the first few words of this kitty ipsum text: Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

what to do here ?

Ho Chin Chee
@stranger26
Oct 24 2015 09:51 UTC
copy "Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff."
Souvik Maity
@souvikmaity777
Oct 24 2015 09:53 UTC
ok thanks
CamperBot
@camperbot
Oct 24 2015 09:53 UTC
if you want to thank someone, put an @ before their name!
Ho Chin Chee
@stranger26
Oct 24 2015 09:55 UTC
welcome :) @souvikmaity777
Maria
@mariashifa
Oct 24 2015 10:01 UTC
Waypoint: Make Instances of Objects with a Constructor Function
var Car = function() {
this.wheels = 4;
};

// Only change code below this line.
var myCar = new Car();
this.engines = 2;

//Add the property "engines" to myCar, and make it a number.

// Only change code above this line.
(function() {return JSON.stringify(myCar);})();
The property engines of myCar should be a number.--- (not passing this part).. can anybody tell me what i had done wrong :/
h4r1m4u
@h4r1m4u
Oct 24 2015 10:02 UTC
@mariashifa 'this' is only used in the object constructor function
to assign properties to an already created object, you do it like this: myCar.color = "red";
this creates a property 'color' with value 'red'
Maria
@mariashifa
Oct 24 2015 10:03 UTC
why is wheels with "this."?
h4r1m4u
@h4r1m4u
Oct 24 2015 10:03 UTC
because it's part of the object constructor function
so every car object you create with the Car() function will by default have 4 wheels
Maria
@mariashifa
Oct 24 2015 10:04 UTC
but not an engine?
AH ok
h4r1m4u
@h4r1m4u
Oct 24 2015 10:04 UTC
correct. the constructor function doesn't specify anything regarding engines
Maria
@mariashifa
Oct 24 2015 10:04 UTC
so engine is only a property
ok
h4r1m4u
@h4r1m4u
Oct 24 2015 10:05 UTC
if you wanted every car object to have the engine property, you would put it in the constructor function, similar to the wheels
but if you don't want to do that, you can assign the engine property to car objects on a case by case basis after you create the object
Maria
@mariashifa
Oct 24 2015 10:06 UTC
ok thanks @h4r1m4u i think i understand now :)
CamperBot
@camperbot
Oct 24 2015 10:06 UTC
mariashifa sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 303 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 24 2015 10:06 UTC
great :)
Manav Bansal
@mbansal11
Oct 24 2015 10:35 UTC
hello
stuck in "use a css class to style an element"
h4r1m4u
@h4r1m4u
Oct 24 2015 10:38 UTC
what do you have so far? @mbansal11
Manav Bansal
@mbansal11
Oct 24 2015 10:38 UTC

<style>
h2
.red-text{
color: red;
}
</style>

<h2 class= "some-class">CatPhotoApp</h2>

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>

h4r1m4u
@h4r1m4u
Oct 24 2015 10:39 UTC
@mbansal11 in your CSS, you defined a class .red-text, but in your HTML, you assign your <h2> tag class called some-class
Manav Bansal
@mbansal11
Oct 24 2015 10:40 UTC
thanks ....
CamperBot
@camperbot
Oct 24 2015 10:40 UTC
if you want to thank someone, put an @ before their name!
Manav Bansal
@mbansal11
Oct 24 2015 10:40 UTC
@h4r1m4u thanks
CamperBot
@camperbot
Oct 24 2015 10:40 UTC
mbansal11 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 304 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 24 2015 10:41 UTC
no problem
Manav Bansal
@mbansal11
Oct 24 2015 10:51 UTC
@h4r1m4u
h4r1m4u
@h4r1m4u
Oct 24 2015 10:54 UTC
@mbansal11 what do you have so far?
Manav Bansal
@mbansal11
Oct 24 2015 10:57 UTC
@h4r1m4u I'm done for p but for h2 I;'m stuck

<style>
.red-text {
color: red;
}

p {
font-size: 16px;
font-family: Monospace;
}
</style>

<h2 class="red-text" font-family: Lobster;>CatPhotoApp</h2>

h4r1m4u
@h4r1m4u
Oct 24 2015 10:58 UTC
ok. see how the Monospace font is assigned to the <p> in the CSS definition (font-family: Monospace)? you have to do it in a similar way for the <h2> tag
the font-family is a CSS property. it needs to be part of your CSS definition, not inserted into the <h2> directly
Manav Bansal
@mbansal11
Oct 24 2015 11:00 UTC
@h4r1m4u thanks once again, actually I'm new to HTML ...
CamperBot
@camperbot
Oct 24 2015 11:00 UTC
mbansal11 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: mbansal11 already gave h4r1m4u points
h4r1m4u
@h4r1m4u
Oct 24 2015 11:00 UTC
sure, no problem. that's the reason you're taking the course
Manav Bansal
@mbansal11
Oct 24 2015 11:10 UTC
<style>
.red-text {
color: red;
}

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

p {
font-size: 16px;
font-family: Monospace;
}
</style>
how to degrade from lobster to monospace
h4r1m4u
@h4r1m4u
Oct 24 2015 11:12 UTC
@mbansal11 that looks correct to me. did you remember to comment out the call to google which imports the lobster font? it should be all the way at the top of the code pane
Manav Bansal
@mbansal11
Oct 24 2015 11:15 UTC
<style>
.red-text {
color: red;
}

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

p {
font-size: 16px;
font-family: Monospace;
}
</style>
h4r1m4u
@h4r1m4u
Oct 24 2015 11:16 UTC
in the previous waypoints, you imported the Lobster font by having this at the top your code:
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
this waypoint tells you to: "Now comment out your call to Google Fonts, so that the Lobster font isn't available. Notice how it degrades to the Monospace font."
did you comment it out?
Manav Bansal
@mbansal11
Oct 24 2015 11:17 UTC
yes
h4r1m4u
@h4r1m4u
Oct 24 2015 11:19 UTC
ah, hang on. the problem is with the commented out font-family: Lobster; bit. in CSS, you don't use <!-- and --> to comment thing out
you use
This message was deleted
/* and */
<!-- and --> is used for comments only in HTML
Manav Bansal
@mbansal11
Oct 24 2015 11:22 UTC
@h4r1m4u Thanks Done
hmm have you complete this course
CamperBot
@camperbot
Oct 24 2015 11:22 UTC
mbansal11 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: mbansal11 already gave h4r1m4u points
h4r1m4u
@h4r1m4u
Oct 24 2015 11:23 UTC
not everything, no. i'm finishing the intermediate front end development projects now. i'm taking it for the javascript parts. i've been working with HTML and CSS for 10 years
as well as other languages. just working on improving my JS now
Manav Bansal
@mbansal11
Oct 24 2015 11:24 UTC
Ok i want to know that when i will be done with html i will be able to design my own website ?
h4r1m4u
@h4r1m4u
Oct 24 2015 11:25 UTC
the first zipline in the basic front end development section is designing your own portfolio site
it really depends on how much you put into the course, the course guides you and gives you a study structure, but there's a lot of studying you need to yourself by asking questions and googling
anyhow dinner time, going AFK
good luck with the next waypoints
Manav Bansal
@mbansal11
Oct 24 2015 11:27 UTC
@h4r1m4u thanks
CamperBot
@camperbot
Oct 24 2015 11:27 UTC
mbansal11 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: mbansal11 already gave h4r1m4u points
Dung Tran Manh
@dungtm007
Oct 24 2015 11:39 UTC

Hi guys
I passed all tests, only this

"Use the provided code three times. One for each slot."

Don't know why ? Is there anyone can help ? :)

It's in "Waypoint: Give your JavaScript Slot Machine some Stylish Images"
$($('.slot')[0]).html('<img src = "'+ images[slotOne - 1] + '">');
$($('.slot')[1]).html('<img src = "'+ images[slotTwo - 1] + '">');
$($('.slot')[2]).html('<img src = "'+ images[slotThree - 1] + '">');
Avishay
@avishayshushan
Oct 24 2015 11:42 UTC
Can you post the html?
Dung Tran Manh
@dungtm007
Oct 24 2015 11:43 UTC
Oh I found it, just the format:
'<img src = "'+ => should be '<img src = "' +
there should be a whitespace between ' and +
Thanks @avishayshushan for your pleasure :)
CamperBot
@camperbot
Oct 24 2015 11:44 UTC
dungtm007 sends brownie points to @avishayshushan :sparkles: :thumbsup: :sparkles:
:star: 314 | @avishayshushan | http://www.freecodecamp.com/avishayshushan
Avishay
@avishayshushan
Oct 24 2015 11:44 UTC
Ok np
Dung Tran Manh
@dungtm007
Oct 24 2015 11:44 UTC
Anyway, the engine is not so smart :D
it's not the syntax error
piaffe
@piaffe
Oct 24 2015 11:47 UTC
I have been stuck now for so long, that i cant even remember anymore what i have allready tried... I just dont get this.

´´<script>
function runSlots(){
var slotOne;
var slotTwo;
var slotThree;

var images = ["http://i.imgur.com/9H17QFk.png", "http://i.imgur.com/9RmpXTy.png", "http://i.imgur.com/VJnmtt5.png"];

// Only change code below this line.

{ slotOne
return Math.random();
Math.floor(Math.random() * (3 - 1 + 1)) + 1;

slotTwo
return Math.random();
Math.floor(Math.random() * (3 - 1 + 1)) + 1;

slotThree
return  Math.random();
Math.floor(Math.random() * (3 - 1 + 1)) + 1;
}

// Only change code above this line.

$(".logger").html("");$(".logger").html("Not A Win")

if(slotOne !== undefined && slotTwo !== undefined && slotThree !== undefined){
$(".logger").html(slotOne + " " + slotTwo + " " + slotThree); } return [slotOne, slotTwo, slotThree]; }$(document).ready(function(){
$(".go").click(function(){ runSlots(); }); }); </script> ´´ I think this is waypoint 158 BackBencherNewBie @BackBencherNewBie Oct 24 2015 11:53 UTC <link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css"> <style> .red-text { color: red; font-family: Lobster, Monospace; } p { font-size: 16px; font-family: Monospace; } .thick-green-border { border-color: green; border-width: 5px; border-style: solid; border-radius: 50%; } .smaller-image { width: 100px; } </style> <h2 class="red-text">CatPhotoApp</h2> <img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat"> <p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p> <p>View more <a href="http://www.freecatphotoapp.com">Cat Photos</a></p> Your p element should have the text "View more " (with a space after it). Help CamperBot @camperbot Oct 24 2015 11:53 UTC 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! Dung Tran Manh @dungtm007 Oct 24 2015 11:55 UTC find js CamperBot @camperbot Oct 24 2015 11:55 UTC find js :zero: how jsonp is different from json :one: js regex resources :two: js resources :three: zipline use the twitchtv json api :four: js array prototype filter :five: js array prototype indexof :six: js array prototype map :seven: js array prototype pop :eight: js array prototype push :nine: js array prototype shift :one::zero: js array prototype some :one::one: js array prototype tostring :one::two: js boolean :one::three: js string prototype split :one::four: js string prototype tolowercase :one::five: js string prototype touppercase :one::six: js arguments :one::seven: js closures :one::eight: js falsy :one::nine: js for in loop limited to first 20 entries. type find js again for more enteries. Avishay @avishayshushan Oct 24 2015 11:57 UTC @piaffe what the function should do? and i dont know what { Slot one What is this syntax? and your function always return the first return line piaffe @piaffe Oct 24 2015 11:59 UTC @BackBencherNewBie <p>View more <a href="http://www.freecatphotoapp.com">cat photos</a> </p> @avishayshushan Waypoint: Create a JavaScript Slot Machine We are now going to try and combine some of the stuff we've just learned and create the logic for a slot machine game. For this we will need to generate three random numbers between 1 and 3 to represent the possible values of each individual slot. Store the three random numbers in slotOne, slotTwo and slotThree. Generate the random numbers by using the system we used earlier (an explanation of the formula can be found here): Math.floor(Math.random() * (3 - 1 + 1)) + 1; ´´<script> function runSlots(){ var slotOne; var slotTwo; var slotThree; var images = ["http://i.imgur.com/9H17QFk.png", "http://i.imgur.com/9RmpXTy.png", "http://i.imgur.com/VJnmtt5.png"]; // Only change code below this line. function { slotOne return Math.random(); Math.floor(Math.random() * (3 - 1 + 1)) + 1;  slotTwo return Math.random(); Math.floor(Math.random() * (3 - 1 + 1)) + 1; slotThree return Math.random(); Math.floor(Math.random() * (3 - 1 + 1)) + 1; } // Only change code above this line.$(".logger").html("");
$(".logger").html("Not A Win") if(slotOne !== undefined && slotTwo !== undefined && slotThree !== undefined){$(".logger").html(slotOne + " " + slotTwo + " " + slotThree);
}
return [slotOne, slotTwo, slotThree];

}

$(document).ready(function(){$(".go").click(function(){
runSlots();
});
});
</script>

<div>
<div class = "container inset">
<img src="https://s3.amazonaws.com/freecodecamp/freecodecamp_logo.svg.gz" alt="learn to code javascript at Free Code Camp logo" class="img-responsive nav-logo">
<h2>FCC Slot Machine</h2>
</div>
<div class = "slots inset">
<div class = "slot inset">

</div>
<div class = "slot inset">

</div>
<div class = "slot inset">

</div>
</div>
<br/>
<div class = "outset">
<button class = "go inset">
Go
</button>
</div>
<br/>
<div class = "foot inset">
<span class = "logger"></span>
</div>
</div>
</div>

<style>
.container {
background-color: #4a2b0f;
height: 400px;
width: 260px;
margin: 50px auto;
}
border: 2px solid #fff;
height: 55px;
margin: 14px auto;
background-color: #457f86
}
height: 30px;
margin: auto;
}
font-size: 14px;
margin: 0 0;
color: #fff;
text-align: center;
}
.slots{
display: flex;
background-color: #457f86;
border: 2px solid #fff;
}
.slot{
flex: 1 0 auto;
background: white;
height: 75px;
margin: 8px;
border: 2px solid #215f1e;
}
.go {
width: 100%;
color: #fff;
background-color: #457f86;
border: 2px solid #fff;
box-sizing: none;
outline: none!important;
}
.foot {
height: 150px;
background-color: 457f86;
border: 2px solid #fff;
}

.logger {
color: white;
margin: 10px;
}

.outset {
-webkit-box-shadow: 0px 0px 15px -2px rgba(0,0,0,0.75);
-moz-box-shadow: 0px 0px 15px -2px rgba(0,0,0,0.75);
box-shadow: 0px 0px 15px -2px rgba(0,0,0,0.75);
}

.inset {
-webkit-box-shadow: inset 0px 0px 15px -2px rgba(0,0,0,0.75);
-moz-box-shadow: inset 0px 0px 15px -2px rgba(0,0,0,0.75);
box-shadow: inset 0px 0px 15px -2px rgba(0,0,0,0.75);
}
</style>´´

Avishay
@avishayshushan
Oct 24 2015 12:03 UTC
@piaffe can you try just slotOne= ....
Without the return lines?
piaffe
@piaffe
Oct 24 2015 12:03 UTC
Why the whole code doesnt appear here like it should?
Avishay
@avishayshushan
Oct 24 2015 12:04 UTC
Help format
CamperBot
@camperbot
Oct 24 2015 12:04 UTC

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

piaffe
@piaffe
Oct 24 2015 12:05 UTC
@avishayshushan Thank you! It worked. :smile:
CamperBot
@camperbot
Oct 24 2015 12:05 UTC
piaffe sends brownie points to @avishayshushan :sparkles: :thumbsup: :sparkles:
:star: 315 | @avishayshushan | http://www.freecodecamp.com/avishayshushan
BackBencherNewBie
@BackBencherNewBie
Oct 24 2015 12:05 UTC
Thanks @piaffe
CamperBot
@camperbot
Oct 24 2015 12:05 UTC
backbenchernewbie sends brownie points to @piaffe :sparkles: :thumbsup: :sparkles:
:star: 159 | @piaffe | http://www.freecodecamp.com/piaffe
Avishay
@avishayshushan
Oct 24 2015 12:06 UTC
@piaffe great!
Serhii Borovskyi
@serhiicss
Oct 24 2015 12:06 UTC
This message was deleted
var Car = function() {
this.gear = 1;
return 'The Current Gear Is: ' + styleMe;
}
this.getGear = function() {
};
};
BackBencherNewBie
@BackBencherNewBie
Oct 24 2015 12:07 UTC
@piaffe Still not working :(
Serhii Borovskyi
@serhiicss
Oct 24 2015 12:08 UTC
Can anyone explain that code does?
Avishay
@avishayshushan
Oct 24 2015 12:08 UTC
@serhiicss it makes properties and methods
For the car ibject
Object
I think...
Serhii Borovskyi
@serhiicss
Oct 24 2015 12:09 UTC
ok so Car is an object
with a property of gear
Avishay
@avishayshushan
Oct 24 2015 12:09 UTC
@BackBencherNewBie what is the result u should get
Serhii Borovskyi
@serhiicss
Oct 24 2015 12:09 UTC
that equals to 1
right?
BackBencherNewBie
@BackBencherNewBie
Oct 24 2015 12:10 UTC
@avishayshushan Your p element should have the text "View more " (with a space after it).
Avishay
@avishayshushan
Oct 24 2015 12:10 UTC
@serhiicss yes
And have getGear method
BackBencherNewBie
@BackBencherNewBie
Oct 24 2015 12:11 UTC
question no is 22 from HTML5 and CSS
Serhii Borovskyi
@serhiicss
Oct 24 2015 12:11 UTC
@avishayshushan cool! Now, what does addStyle function do?
piaffe
@piaffe
Oct 24 2015 12:11 UTC
@BackBencherNewBie
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
.red-text {
color: red;
}

h2 {
font-family: Lobster, Monospace;
}

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

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

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

<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">

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
BackBencherNewBie
@BackBencherNewBie
Oct 24 2015 12:12 UTC
thanks @piaffe Now its working :0
CamperBot
@camperbot
Oct 24 2015 12:12 UTC
backbenchernewbie sends brownie points to @piaffe :sparkles: :thumbsup: :sparkles:
:warning: backbenchernewbie already gave piaffe points
Fennek
@fennekbe
Oct 24 2015 12:39 UTC
Can someone help me out? Im at the following challenge: Waypoint: Make Instances of Objects with a Constructor Function
Im adding the following to my code: myCar.Engines = 1;
but it says engines is not a number
How do I paste code here like the guy a few lines above me did btw?
wiki format
Coira Ellison
@Coira
Oct 24 2015 12:41 UTC
@fennekbe engines with lower case 'e' perhaps?
CamperBot
@camperbot
Oct 24 2015 12:41 UTC

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

Fennek
@fennekbe
Oct 24 2015 12:42 UTC
ah alright
I'll do that next time :)
let me try lower case
@Coira Lower case worked, I reality it doesn't really matter, just style right?
in reality*
Coira Ellison
@Coira
Oct 24 2015 12:44 UTC
@fennekbe yep, just style :)
Fennek
@fennekbe
Oct 24 2015 12:44 UTC
alright
@Coira Thank you :)
CamperBot
@camperbot
Oct 24 2015 12:44 UTC
fennekbe sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 282 | @coira | http://www.freecodecamp.com/coira
Maria
@mariashifa
Oct 24 2015 12:45 UTC
hi
Bonfire:reverse string
function reverseString(str) {
return str;
}

reverseString("hello");
var string = "hello";
var array = string.split('');
string.split("").reverse().join("");

reverseString("Howdy");
var string = "Howdy";
var array = string.split('');
string.split("").reverse().join("");

reverseString("Greetings from Earth");
var string = "Greetings from Earth";
var array = string.split('');
string.split("").reverse().join("");
does anybody know my mistake here
where does one begin?
Maria
@mariashifa
Oct 24 2015 12:46 UTC
lol
first you don't need to hardcode the string and move what you have to the function
Tom Hunter
@Teemeister
Oct 24 2015 12:57 UTC
Hello World
CamperBot
@camperbot
Oct 24 2015 12:57 UTC

welcome to FreeCodeCamp @Teemiaster!

Tom Hunter
@Teemeister
Oct 24 2015 12:58 UTC
Woooohoooo! Thanks @camperbot you'r the best! :D
CamperBot
@camperbot
Oct 24 2015 12:58 UTC
teemiaster sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 408 | @camperbot | http://www.freecodecamp.com/camperbot
Tom Hunter
@Teemeister
Oct 24 2015 13:00 UTC
/nick
@kpaccess
Oct 24 2015 13:15 UTC
hello @Teemiaster welcome to the group.
Tom Hunter
@Teemeister
Oct 24 2015 13:21 UTC
Hi @kpaccess! Thanks :)
Vardan Gupta
@vardan1992
Oct 24 2015 13:36 UTC
Add the classes animated and hinge to your body element.What does that mean?
h4r1m4u
@h4r1m4u
Oct 24 2015 13:38 UTC
@vardan1992 this is paragraph with no class: <p>some text</p>. this is a paragraph with class 'red' and 'big': <p class="red big">some text</p>
now do the same to <body>, with classes 'animated' and 'hinge'
Vardan Gupta
@vardan1992
Oct 24 2015 13:39 UTC
hinge is a class?
h4r1m4u
@h4r1m4u
Oct 24 2015 13:39 UTC
"Add the classes animated and hinge to your body element." yes, both animated and hinge are name of classes in your waypoint
Vardan Gupta
@vardan1992
Oct 24 2015 13:42 UTC
oh wow!!.thanks for the help man :)
CamperBot
@camperbot
Oct 24 2015 13:42 UTC
if you want to thank someone, put an @ before their name!
h4r1m4u
@h4r1m4u
Oct 24 2015 13:42 UTC
you're welcome
Vardan Gupta
@vardan1992
Oct 24 2015 13:42 UTC
@h4r1m4u thanks
CamperBot
@camperbot
Oct 24 2015 13:42 UTC
vardan1992 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 305 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Fennek
@fennekbe
Oct 24 2015 14:05 UTC

I'm trying to reverse the string in bonfire. I'll paste my code below and it works, but I feel like it's not the proper way to do it.

'''
function reverseString(str) {
var i = 0;
var strReversed = "";
var strTemporary = "";
while (i < str.length){
strTemporary = str[str.length - i - 1];
strReversed += strTemporary;
i++;
}
return strReversed;
}

reverseString("hello");
'''

CamperBot
@camperbot
Oct 24 2015 14:05 UTC
:bulb: to format code use backticks!  more info
Fennek
@fennekbe
Oct 24 2015 14:05 UTC
and i messed it up, hold on :p
function reverseString(str) {
var i = 0;
var strReversed = "";
var strTemporary = "";
while (i < str.length){
strTemporary = str[str.length - i - 1];
strReversed += strTemporary;
i++;
}
return strReversed;
}

reverseString("hello");
there you go
Is this an alright way to do it?
h4r1m4u
@h4r1m4u
Oct 24 2015 14:08 UTC
@fennekbe there are more elegant solutions, but this looks like it should work
Fennek
@fennekbe
Oct 24 2015 14:08 UTC
That's what I figured. What would you personally do different? @h4r1m4u
h4r1m4u
@h4r1m4u
Oct 24 2015 14:09 UTC
does it pass all the tests?
Fennek
@fennekbe
Oct 24 2015 14:09 UTC
It does, yes
h4r1m4u
@h4r1m4u
Oct 24 2015 14:09 UTC
@fennekbe that's cool then. my solution has one line
Fennek
@fennekbe
Oct 24 2015 14:10 UTC
@h4r1m4u Sharing is caring
h4r1m4u
@h4r1m4u
Oct 24 2015 14:10 UTC
i split the string into an array of individual characters, reverse the order of the array and then join the array elements
i'll PM you
Fennek
@fennekbe
Oct 24 2015 14:11 UTC
@h4r1m4u alright, thank you :)
CamperBot
@camperbot
Oct 24 2015 14:11 UTC
fennekbe sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 306 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
DTing
@dting
Oct 24 2015 14:37 UTC
@fennekbe Here is the major concern when dealing with += to build up a string http://programmers.stackexchange.com/a/90231/19454
Fennek
@fennekbe
Oct 24 2015 14:38 UTC
CamperBot
@camperbot
Oct 24 2015 14:38 UTC
fennekbe sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1457 | @dting | http://www.freecodecamp.com/dting
Shair Mir
@ShairMir
Oct 24 2015 14:40 UTC
I'm looking for some JS DOM tutorials, and the ones I found (one linked to from MDN) dates back to 2008, does that matter?
Juan Martínez
@justinian336
Oct 24 2015 14:41 UTC
Hey guys, anyone willing to help me set up my cloud9 account for the basejumps?
Michael Bomholt
@bomholtm
Oct 24 2015 14:51 UTC
@justinian336 im not at basejumps yet
but i use cloud9
different topic: does anyone knows a good javascript book as additional resource. one with exercises would be great.
Michael Bomholt
@bomholtm
Oct 24 2015 14:57 UTC
i enjoy doing bonfires and would like a book about javascript where you also can do exercises with pen and paper while not home
Jawbh
@CaBra503
Oct 24 2015 15:04 UTC
I have found some books that I like are the "HeadFirst" series
Juan Martínez
@justinian336
Oct 24 2015 15:04 UTC
Thanks @bomholt it seems like the indications in the "Get set for basejumps" waypoint are not working, and everyone is encountering problems to setup yeoman on cloud 9
CamperBot
@camperbot
Oct 24 2015 15:04 UTC
justinian336 sends brownie points to @bomholt :sparkles: :thumbsup: :sparkles:
:star: 387 | @bomholt | http://www.freecodecamp.com/bomholt
Juan Martínez
@justinian336
Oct 24 2015 15:04 UTC
just wondering if someone found a solution
DTing
@dting
Oct 24 2015 15:05 UTC
i did all my basejumps locally
Jawbh
@CaBra503
Oct 24 2015 15:05 UTC
for excample @bomholt "HeadFirst JavaScript" Has everything that you're looking for, a very interactive experience for a book, Several Different exercises
Juan Martínez
@justinian336
Oct 24 2015 15:06 UTC
@dting what os did you use?
DTing
@dting
Oct 24 2015 15:07 UTC
i personally used vagrant to create a vm but thats rather complex
some people just install node and do everything locally on their machines
Jawbh
@CaBra503
Oct 24 2015 15:07 UTC
@bomholt I Just private messaged you
DTing
@dting
Oct 24 2015 15:07 UTC
other people are using clementine to do the basejumps on c9
Michael Bomholt
@bomholtm
Oct 24 2015 15:08 UTC
@CaBra503 thanks
CamperBot
@camperbot
Oct 24 2015 15:08 UTC
bomholt sends brownie points to @cabra503 :sparkles: :thumbsup: :sparkles:
:star: 203 | @cabra503 | http://www.freecodecamp.com/cabra503
DTing
@dting
Oct 24 2015 15:08 UTC
also people said that if you install the packages one at a time
Michael Bomholt
@bomholtm
Oct 24 2015 15:08 UTC
@justinian336 yea sorry dont know yeoman :/
DTing
@dting
Oct 24 2015 15:08 UTC
sometimes the install will work for yeoman and fullstack angular
Juan Martínez
@justinian336
Oct 24 2015 15:11 UTC
@dting thanks for the info, I tried installing in Ubuntu but I also had lots of trouble
CamperBot
@camperbot
Oct 24 2015 15:11 UTC
justinian336 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1459 | @dting | http://www.freecodecamp.com/dting
Juan Martínez
@justinian336
Oct 24 2015 15:11 UTC
Let me try clementine
DTing
@dting
Oct 24 2015 15:11 UTC
Juan Martínez
@justinian336
Oct 24 2015 15:12 UTC
Looks promising, will give it a check
Thanks anyway @bomholt
CamperBot
@camperbot
Oct 24 2015 15:13 UTC
justinian336 sends brownie points to @bomholt :sparkles: :thumbsup: :sparkles:
:warning: justinian336 already gave bomholt points
Rob LeGrand
@rob-legrand
Oct 24 2015 15:13 UTC
Anyone done (or started on) the Angular.js Waypoints?
@SaintPeter
Oct 24 2015 15:25 UTC
@rob-legrand Plenty of folks. Do you have questions?
21igor
@21igor
Oct 24 2015 15:53 UTC

Hi to all!
I have a question - where to place the class
.green-background {
background-color: green;
}
to assign this class to my div block

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

Stacia
@snlowery
Oct 24 2015 15:54 UTC
You should be able to style the divs individually
so <div class=“green-background”>
or you could do the entire background and apply it to your body element
Shirish
@techlab23
Oct 24 2015 15:55 UTC
its actually gray-background
<div class="gray-background">
21igor
@21igor
Oct 24 2015 15:59 UTC
@snlowery
and where to place
.green-background {
background-color: green;
}
@techlab23
Stacia
@snlowery
Oct 24 2015 16:01 UTC

At the top of the html doc in style brackets. so

<style>
.green-background {
background-color: green;
}
</style>

Shirish
@techlab23
Oct 24 2015 16:01 UTC
@snlowery that should do it
21igor
@21igor
Oct 24 2015 16:09 UTC
@snlowery
Stacia
@snlowery
Oct 24 2015 16:13 UTC
@21igor did it work?
Shirish
@techlab23
Oct 24 2015 16:14 UTC
@21igor Make sure your <style> </style> tags are placed before <body></body> tags
21igor
@21igor
Oct 24 2015 16:16 UTC
snlowery
I see my desired grey background, but the system does not let me go to the next exersize ((

here all the code:

<style>
.red-text {
color: red;
}

h2 {
font-family: Lobster, Monospace;
}

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

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

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

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

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

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

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

Shirish
@techlab23
Oct 24 2015 16:18 UTC
@21igor replace <div class=grey-background> with <div class="grey-background">
Stacia
@snlowery
Oct 24 2015 16:19 UTC
Yup, that should do it
21igor
@21igor
Oct 24 2015 16:21 UTC
((
same result
I tryed to clear cash too
and to reset my code
Shirish
@techlab23
Oct 24 2015 16:23 UTC
@21igor this is my code which is passing
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
.red-text {
color: red;
}

h2 {
font-family: Lobster, Monospace;
}

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

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

.smaller-image {
width: 100px;
}

.gray-background {
background-color: gray;
}
</style>

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

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

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

<form action="/submit-cat-photo">
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
@21igor only difference is spelling of "grey" to gray
@21igor i used gray-background instead of grey-background
21igor
@21igor
Oct 24 2015 16:27 UTC
))))))))))) it helps !
@techlab23
Shirish
@techlab23
Oct 24 2015 16:28 UTC
@21igor great. Glad that worked !!
Stacia
@snlowery
Oct 24 2015 16:28 UTC
You got it?
21igor
@21igor
Oct 24 2015 16:30 UTC
but it is very strange. English is a foreign language for me. Withboth grEy and grAy I had a gray background. What is the reason&
?
Shirish
@techlab23
Oct 24 2015 16:31 UTC
@21igor in the instructions they mentioned gray-background
so the verifying system checks for gray-background instead of grey-background
21igor
@21igor
Oct 24 2015 16:32 UTC
ok! )
Shirish
@techlab23
Oct 24 2015 16:32 UTC
therefore, if you type grey instead of gray it wont pass :)
@Maqsood-Honey
Oct 24 2015 16:32 UTC
Your p element should contain the first few words of the provided kitty ipsum text.
what is mean
Shirish
@techlab23
Oct 24 2015 16:33 UTC
@Maqsood-Honey means you should copy paste the kitty ipsum text provided in tutorial
21igor
@21igor
Oct 24 2015 16:34 UTC
is there a difference between grEy and grAy in generaly? Both give the nessesary background
Shirish
@techlab23
Oct 24 2015 16:36 UTC
@21igor I'm not an expert in english either. I think it's just british vs american english difference just like in british english: colour then in american english: color
@Maqsood-Honey
Oct 24 2015 16:36 UTC
not work @techlab23
Shirish
@techlab23
Oct 24 2015 16:37 UTC
@Maqsood-Honey copy paste this in side your <p> </p> element
Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.
like this
<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
@Maqsood-Honey
Oct 24 2015 16:40 UTC
its done but i can't understand
Shirish
@techlab23
Oct 24 2015 16:41 UTC
The text inside your <p></p> element is called kitty ipsum text
@Maqsood-Honey
Oct 24 2015 16:42 UTC
why and what is this?
Shirish
@techlab23
Oct 24 2015 16:42 UTC
that's what you need to do to pass the excersize
Mark Pearyer
@marcusp619
Oct 24 2015 16:43 UTC
Ipsum is just filler text @Maqsood-Honey
Lorem ipsum I believe is the original
Shirish
@techlab23
Oct 24 2015 16:48 UTC
Loremipsum site: http://www.lipsum.com/
Mark Pearyer
@marcusp619
Oct 24 2015 16:52 UTC
@techlab23 not really much to ipsum I have it setup in my editor to where I can type "Lorem" and it will give me a paragraph of filler text
databasit
@databasit
Oct 24 2015 16:53 UTC
hi
Shirish
@techlab23
Oct 24 2015 16:53 UTC
@marcusp619 oh yeah i think if you must be using ST. i set it up as snippet
databasit
@databasit
Oct 24 2015 16:55 UTC
how can I do the waypoint : Nest an Anchor Element within a Paragraph. Actually i have this code: <p> View<a href="smaller-image thick-green-border"></a> more </p> , but system launch me the error " Your p element should have the text "View more " (with a space after it) " I need help please. Thanks!
CamperBot
@camperbot
Oct 24 2015 16:55 UTC
if you want to thank someone, put an @ before their name!
Shirish
@techlab23
Oct 24 2015 16:56 UTC
change your <p> tag with this
<p> View more <a href="smaller-image thick-green-border"></a></p>
databasit
@databasit
Oct 24 2015 16:57 UTC
ok, let me try thanks!
CamperBot
@camperbot
Oct 24 2015 16:57 UTC
if you want to thank someone, put an @ before their name!
عبد الرحمن
@AbdulrahmanEng
Oct 24 2015 17:00 UTC
If you're using the Sublime Text editor you can download the Emmet package which comes with Lorem ipsum and HTML, CSS, JS, C++... code elements if you know the shortcuts.
Shirish
@techlab23
Oct 24 2015 17:01 UTC
@EyjafjallajokullM89 i love Emmet. it's a real game changer
try typing ! then tab after installing emmet. it will spit out your filler HTML structure
عبد الرحمن
@AbdulrahmanEng
Oct 24 2015 17:02 UTC
I hope they add AngularJS support.
problem in 3rd
Shirish
@techlab23
Oct 24 2015 17:03 UTC
I think they would do it with Emmet extensions
@Maqsood-Honey
Oct 24 2015 17:04 UTC
eg?
Shirish
@techlab23
Oct 24 2015 17:06 UTC
@Maqsood-Honey replace your <p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
with
@Maqsood-Honey
Oct 24 2015 17:06 UTC
yes
Shirish
@techlab23
Oct 24 2015 17:06 UTC
<p> class="red-text">kitty ipsum text: Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
@Maqsood-Honey
Oct 24 2015 17:06 UTC
and how you highlighted my name?
Shirish
@techlab23
Oct 24 2015 17:07 UTC
use @ and select the name from the list
this will highlight the name
@Maqsood-Honey
Oct 24 2015 17:08 UTC
@techlab23 yes
@techlab23 highlighted or not?
Shirish
@techlab23
Oct 24 2015 17:08 UTC
you got it :)
@Maqsood-Honey
Oct 24 2015 17:08 UTC
thanks
CamperBot
@camperbot
Oct 24 2015 17:08 UTC
if you want to thank someone, put an @ before their name!
@Maqsood-Honey
Oct 24 2015 17:09 UTC
@camperbot
Shirish
@techlab23
Oct 24 2015 17:17 UTC
var Car = function() {
this.wheels = 4;
};

// Only change code below this line.
var myCar = new Car();

//Add the property "engines" to myCar, and make it a number.

myCar.engines = 2;

// Only change code above this line.
(function() {return JSON.stringify(myCar);})();
@Johnny34 this should do it
Kenan
@Johnny34
Oct 24 2015 17:17 UTC
ohh.. okay :D
ShafM
@ShafM
Oct 24 2015 17:44 UTC
Hi guys
Cody Bouscaren
@codybousc
Oct 24 2015 17:46 UTC
find smallest common multiple
CamperBot
@camperbot
Oct 24 2015 17:46 UTC

find smallest common multiple

ShafM
@ShafM
Oct 24 2015 17:47 UTC
@techlab23 can you help me
yat
@sodyat
Oct 24 2015 17:47 UTC
hi guys
Your h2 element should use the font Lobster.
Your h2 element should degrade to the font Monospace when Lobster is not available.
need help
thx
CamperBot
@camperbot
Oct 24 2015 17:47 UTC
if you want to thank someone, put an @ before their name!
yat
@sodyat
Oct 24 2015 17:50 UTC
i can.....
Sue
@Sueswebdesign
Oct 24 2015 17:51 UTC
I cannot figure out how to change the size of the photo even though I followed the example. Wrong placement? Help? :)
Sue
@Sueswebdesign
Oct 24 2015 18:02 UTC
h2 {
font-family: Lobster, Monospace;
}
Avishay
@avishayshushan
Oct 24 2015 18:14 UTC
@Sueswebdesign is this the waypoint with the smaller-image class?
Den McHenry
@denmch
Oct 24 2015 18:19 UTC
@Sueswebdesign Can you post your code?
Sue
@Sueswebdesign
Oct 24 2015 18:22 UTC
Yes. Here is the whole project so far:
Augustas
@AugustasV
Oct 24 2015 18:26 UTC
Sameen Anna Belle
Oct 24 2015 18:26 UTC
I am having trouble with filling in the black with placeholder text
Ho Chin Chee
@stranger26
Oct 24 2015 18:56 UTC
Yan Kozlovskiy
@YanKozlovskiy
Oct 24 2015 18:58 UTC
i have a string that i want to pass in
a string full of numbers
how would i add them all up?
Ho Chin Chee
@stranger26
Oct 24 2015 18:59 UTC
convert them into integer then add them up
Myroslav
@werber
Oct 24 2015 19:00 UTC
why in for statement arguments behave strange? arguments1 always increments itself.
function destroyer(arr) {
console.log(arguments);
var a = arr;
for (var i = 1; i < arguments.length; i++) {
a.filter(function(el, index, array){
console.log(i, arguments);
});
}
return a;
}

console.log(destroyer([1, 2, 3, 1, 2, 3], 2, 3));
Yan Kozlovskiy
@YanKozlovskiy
Oct 24 2015 19:00 UTC
@stranger26 how would i convert them to integer?
Yan Kozlovskiy
@YanKozlovskiy
Oct 24 2015 19:02 UTC
thank you @stranger26
CamperBot
@camperbot
Oct 24 2015 19:02 UTC
yankozlovskiy sends brownie points to @stranger26 :sparkles: :thumbsup: :sparkles:
:star: 76 | @stranger26 | http://www.freecodecamp.com/stranger26
Ho Chin Chee
@stranger26
Oct 24 2015 19:02 UTC
welcome, just hope it helps :)
Yan Kozlovskiy
@YanKozlovskiy
Oct 24 2015 19:03 UTC
but what if i want it in an array?
Ho Chin Chee
@stranger26
Oct 24 2015 19:04 UTC
im not sure if you can just parseInt() an entire array, i would say looping through each of the item in the array to parseInt()
@Maqsood-Honey
Oct 24 2015 19:07 UTC
Import the Lobster font. mean?
Ho Chin Chee
@stranger26
Oct 24 2015 19:11 UTC
copy paste the line of code with Google Fonts
Jason Wood
@catapixel
Oct 24 2015 19:12 UTC
@stranger26 parseInt() parses a string so you wouldn't be able to pass an array directly to it
Sue
@Sueswebdesign
Oct 24 2015 19:15 UTC

<style>
.red-text {
color: red;
}

h2 {
font-family: Lobster, Monospace;
}

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

</style>

<h2 class="red-text">CatPhotoApp</h2>
<img src="https://bit.ly/fcc-relaxing-cat">

<p class="red-text">Shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

Ho Chin Chee
@stranger26
Oct 24 2015 19:16 UTC
@catapixel thanks for the info :)
CamperBot
@camperbot
Oct 24 2015 19:16 UTC
stranger26 sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 513 | @catapixel | http://www.freecodecamp.com/catapixel
Cody Bouscaren
@codybousc
Oct 24 2015 19:16 UTC
smallest common multiple
Sue
@Sueswebdesign
Oct 24 2015 19:16 UTC
Here is the example I was given:<style> .larger-image { width: 500px; } </style>.
Cody Bouscaren
@codybousc
Oct 24 2015 19:16 UTC
find smallest common multiple
CamperBot
@camperbot
Oct 24 2015 19:16 UTC
find smallest common multiple
nothing found
Jason Wood
@catapixel
Oct 24 2015 19:17 UTC
@Sueswebdesign what are you trying to do?
Ho Chin Chee
@stranger26
Oct 24 2015 19:17 UTC
i think its reducing the width to 100px
give the img a class "smaller-image"
then declare that in style, then define width: 100px
that should work
Fennek
@fennekbe
Oct 24 2015 19:19 UTC
function palindrome(str) {
var palLength = str.length;
return true;
}
palindrome("eye");
Can someone tell me why this throws an error 'palLength is not defined' please?
Jason Wood
@catapixel
Oct 24 2015 19:20 UTC
@fennekbe I just ran your code as you have pasted it and it doesn't throw an error. What error are you getting?
Ho Chin Chee
@stranger26
Oct 24 2015 19:20 UTC
are you trying to call palLength globally?
Fennek
@fennekbe
Oct 24 2015 19:21 UTC
It's bonfire: check for palindromes challenge
Ho Chin Chee
@stranger26
Oct 24 2015 19:21 UTC
i think you should declare "var palLength" out of your function
Fennek
@fennekbe
Oct 24 2015 19:21 UTC
i get error palLengt is not defined
Jason Wood
@catapixel
Oct 24 2015 19:21 UTC
either way it doesn't throw an error. Yes, it fails tests but no error.
Fennek
@fennekbe
Oct 24 2015 19:21 UTC
doesn't for you?
i have no other code, just this
Jason Wood
@catapixel
Oct 24 2015 19:22 UTC
Copy your code that you have pasted, use the reset button on the bonfire, paste it back in, and run again. Let me know if you still get an error "not defined"
Fennek
@fennekbe
Oct 24 2015 19:22 UTC
yeah that worked
Jason Wood
@catapixel
Oct 24 2015 19:23 UTC
:thumbsup:
Fennek
@fennekbe
Oct 24 2015 19:23 UTC
Well that's 20 minutes I could've spent on something else haha
Jason Wood
@catapixel
Oct 24 2015 19:23 UTC
:wink2:
Fennek
@fennekbe
Oct 24 2015 19:23 UTC
Thanks either way ;p
CamperBot
@camperbot
Oct 24 2015 19:23 UTC
if you want to thank someone, put an @ before their name!
Fennek
@fennekbe
Oct 24 2015 19:23 UTC
@catapixel thanks
CamperBot
@camperbot
Oct 24 2015 19:23 UTC
fennekbe sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 514 | @catapixel | http://www.freecodecamp.com/catapixel
Fennek
@fennekbe
Oct 24 2015 19:23 UTC
some brownies
whatever they mean to one
Jason Wood
@catapixel
Oct 24 2015 19:24 UTC
appreciate it.
It's good karma :wink: :beers:
Fennek
@fennekbe
Oct 24 2015 19:25 UTC
:)
Later when I'm done with these series, is it still fine to stick around here for questions unrelated to the codecamp?
Chris
@Shifthawke
Oct 24 2015 19:27 UTC
@fennekbe sure. We have the main room and casual for non fcc
Fennek
@fennekbe
Oct 24 2015 19:27 UTC
Alright :)
John
@funksy
Oct 24 2015 19:31 UTC
is it unusual to finish a challenge and then post your finished code here to make sure you didn't do something way more complicated than necessary?
Fennek
@fennekbe
Oct 24 2015 19:35 UTC
i do it sometimes
@funksy
John
@funksy
Oct 24 2015 19:37 UTC

thanks for the response @fennekbe

here's my finished code for "Return Largest Numbers in Arrays". Open to critique if it could be streamlined or simpler

'''
function largestOfFour(arr) {
var largestArray = [];
/searches each nested array individually/
for(var i = 0; i < arr.length; i++){
var largestOfOne = 0;
/iterates through the nested array to find the largest value/
for(var i2 = 0; i2 < arr[i].length; i2++){
if(largestOfOne <= arr[i][i2]){
largestOfOne = arr[i][i2];
}
}
/pushes the largest value of the nested array to a new array/
largestArray.push(largestOfOne)
}
return largestArray;
'''

CamperBot
@camperbot
Oct 24 2015 19:37 UTC
funksy sends brownie points to @fennekbe :sparkles: :thumbsup: :sparkles:
:star: 183 | @fennekbe | http://www.freecodecamp.com/fennekbe
John
@funksy
Oct 24 2015 19:37 UTC
well, I screwed that up... lol
Fennek
@fennekbe
Oct 24 2015 19:38 UTC
 these ones
John
@funksy
Oct 24 2015 19:38 UTC
ahhhhh, thanks @fennekbe
CamperBot
@camperbot
Oct 24 2015 19:38 UTC
funksy sends brownie points to @fennekbe :sparkles: :thumbsup: :sparkles:
:warning: funksy already gave fennekbe points
Fennek
@fennekbe
Oct 24 2015 19:38 UTC
not regular quotes
John
@funksy
Oct 24 2015 19:38 UTC
function largestOfFour(arr) {
var largestArray = [];
/*searches each nested array individually*/
for(var i = 0; i < arr.length; i++){
var largestOfOne = 0;
/*iterates through the nested array to find the largest value*/
for(var i2 = 0; i2 < arr[i].length; i2++){
if(largestOfOne <= arr[i][i2]){
largestOfOne = arr[i][i2];
}
}
/*pushes the largest value of the nested array to a new array*/
largestArray.push(largestOfOne)
}
return largestArray;
again, just looking for ways to streamline or make it simpler if it can be
Rafael J. Rodriguez
@Rafase282
Oct 24 2015 19:39 UTC
don't worry about it too much @funksy as you learn new tools you can rewrite your code
Fennek
@fennekbe
Oct 24 2015 19:40 UTC
just try to use the hints that the website gives you
I've done many challenges that that hints I didnt use, which worked fine. But didnt really teach me anything
Rafael J. Rodriguez
@Rafase282
Oct 24 2015 19:41 UTC
it is the natural thing to do here, solve the problem with what you have, and as you learn new ways to solve it then you can simplify your own code
John
@funksy
Oct 24 2015 19:41 UTC
ok , thanks @fennekbe @Rafase282
CamperBot
@camperbot
Oct 24 2015 19:41 UTC
funksy sends brownie points to @fennekbe and @rafase282 :sparkles: :thumbsup: :sparkles:
:warning: funksy already gave fennekbe points
:star: 569 | @rafase282 | http://www.freecodecamp.com/rafase282
Ed Sztukowski
@Burgustu
Oct 24 2015 19:46 UTC
when you all first started the bonfires, did you often have to search for a solution and work at it from there? Like for the title case a sentence bonfire, I have some vague ideas of what to do, and I'm reading the suggestions they give, but feel like I get stuck and then just google "title case a sentence in javascript" to help me out from there
Im still spending time figuring out how it works and all
Rafael J. Rodriguez
@Rafase282
Oct 24 2015 19:47 UTC
nope, starting from the solution was not how I did it
John
@funksy
Oct 24 2015 19:47 UTC
@Burgustu I try to think of a way to solve the problem, and then I think about the code to make it happen
Rafael J. Rodriguez
@Rafase282
Oct 24 2015 19:47 UTC
what @funksy said
Marc-Alexandru Baetica
@marcbaetica
Oct 24 2015 19:48 UTC
@funksy
function largestOfFour(arr) {

//our final 4 champion element array with the champion variable
var finArray = [];
var champion = 0;

//for each small array
arr.forEach(function (smallArray) {
//iterate through small array and find champion
smallArray.forEach(function (x) {
if (champion < x) {
champion = x;
}
});
//store champion into the final array and reset champion
finArray.push(champion);
champion = 0;
});

return finArray;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
icurby00
@icurby00
Oct 24 2015 19:48 UTC

in the waypoint make a dead link using hash symbol but i did the task but it wouldn't accept it here is the current code: <link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

<style>
.red-text {
color: red;
}

h2 {
font-family: Lobster, Monospace;
}

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

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

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

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

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

John
@funksy
Oct 24 2015 19:48 UTC
@Burgustu I also think its a good idea to do a return at the end of each section you write to make sure its doing what you think it should
Marc-Alexandru Baetica
@marcbaetica
Oct 24 2015 19:48 UTC
@funksy check what is sent you above :)
Ed Sztukowski
@Burgustu
Oct 24 2015 19:48 UTC
@funksy thanks for the suggestion!
CamperBot
@camperbot
Oct 24 2015 19:48 UTC
burgustu sends brownie points to @funksy :sparkles: :thumbsup: :sparkles:
:star: 187 | @funksy | http://www.freecodecamp.com/funksy
John
@funksy
Oct 24 2015 19:49 UTC
@marc, thanks! Totally forgot about forEach()
CamperBot
@camperbot
Oct 24 2015 19:49 UTC
funksy sends brownie points to @marc :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for marc
Marc-Alexandru Baetica
@marcbaetica
Oct 24 2015 19:49 UTC
no problem buddy :) good luck and keep pushing hard :)
John
@funksy
Oct 24 2015 19:50 UTC
oops, thanks @marcbaetica (just to make sure you get the brownies ;)
CamperBot
@camperbot
Oct 24 2015 19:50 UTC
funksy sends brownie points to @marcbaetica :sparkles: :thumbsup: :sparkles:
:star: 79 | @marcbaetica | http://www.freecodecamp.com/marcbaetica
Marc-Alexandru Baetica
@marcbaetica
Oct 24 2015 19:50 UTC
and it's @marcbaetica if you want to thank me with brownies lool
CamperBot
@camperbot
Oct 24 2015 19:50 UTC
sorry marcbaetica, you can't send brownie points to yourself! :sparkles: :sparkles:
Marc-Alexandru Baetica
@marcbaetica
Oct 24 2015 19:50 UTC
hehe thanks buddy :) @funksy
@funksy thanks
CamperBot
@camperbot
Oct 24 2015 19:50 UTC
marcbaetica sends brownie points to @funksy :sparkles: :thumbsup: :sparkles:
:star: 188 | @funksy | http://www.freecodecamp.com/funksy
Marc-Alexandru Baetica
@marcbaetica
Oct 24 2015 19:50 UTC
lol
Nacho Lozano Rosendo
@nacholozano
Oct 24 2015 20:04 UTC
I cant get set for basejumps HELP
Cannot find module 'graceful-fs'
when i run 'grunt serve'
Fennek
@fennekbe
Oct 24 2015 20:13 UTC
Is there an easy way to search for all punctuation symbols with string.replace ?
John
@funksy
Oct 24 2015 20:17 UTC
Check this place Regular Expressions @fennekbe
Fennek
@fennekbe
Oct 24 2015 20:18 UTC
Tried, didn't make me any wiser
ah no, it's a different page actually
Myroslav
@werber
Oct 24 2015 20:18 UTC
@fennekbe /[\W]/ ?
Fennek
@fennekbe
Oct 24 2015 20:19 UTC
@werber how does that work exactly? what are the brackets and the ^for?
Myroslav
@werber
Oct 24 2015 20:20 UTC
I edited my post. Matches any character that is not a word character from the basic Latin alphabet. Equivalent to [^A-Za-z0-9_].
John
@funksy
Oct 24 2015 20:21 UTC
@fennekbe Just be aware that underscores are considered to be included in the basic Latin alphabet in this case
Myroslav
@werber
Oct 24 2015 20:21 UTC
@fennekbe Or you can write /[^A-Za-z0-9]/
Fennek
@fennekbe
Oct 24 2015 20:23 UTC
@werber @funksy It does work, but I don't quite understand how it works if I were to write that on my own. What's the purpose of the angle brackets in this?
and the ^?
Is it just part of the 'name'?
like an ascii code?
John
@funksy
Oct 24 2015 20:24 UTC
@fennekbe The page I linked above explains it.
@fennekbe and 33-36 of the Basic Javascript challenges also explain its use a bit
Tim Bell
@MindfulBell
Oct 24 2015 20:28 UTC
Wondering if anyone can help me with something. Trying to make an auto-complete search and having difficulty with the timing aspect of it and how the functions are working...
Fennek
@fennekbe
Oct 24 2015 20:29 UTC
alright, thank you @funksy @werber
CamperBot
@camperbot
Oct 24 2015 20:29 UTC
fennekbe sends brownie points to @funksy and @werber :sparkles: :thumbsup: :sparkles:
:star: 190 | @funksy | http://www.freecodecamp.com/funksy
:star: 207 | @werber | http://www.freecodecamp.com/werber
Sameen Anna Belle
Oct 24 2015 20:31 UTC
I am having trouble with re-sizing the image to 100 px i was wondering if anyone can help
Myroslav
@werber
Oct 24 2015 20:33 UTC
@sambadillo96 show problem part of code
Sameen Anna Belle
Oct 24 2015 20:34 UTC
@werber Create a class called smaller-image and use it to resize the image so that it's only 100 pixels wide.
Myroslav
@werber
Oct 24 2015 20:34 UTC
use width and height and assign 100px
Sameen Anna Belle
Oct 24 2015 20:35 UTC
i don't see a height
Myroslav
@werber
Oct 24 2015 20:36 UTC
should be something like that .smaller-image { width: 100px; height: 100px; }
Sameen Anna Belle
Oct 24 2015 20:37 UTC
oh okay thank you
CamperBot
@camperbot
Oct 24 2015 20:37 UTC
if you want to thank someone, put an @ before their name!
Ed Sztukowski
@Burgustu
Oct 24 2015 20:51 UTC
so if I add something to an array with .push(), how can I look at the contents of that array? Since the pushed array just returns the length now
Myroslav
@werber
Oct 24 2015 20:53 UTC
You can iterate over it
Michael Cheung
@m6cheung
Oct 24 2015 20:54 UTC
how does arr.some work?
i tried to make it return the actually array element but it only returns tru everytime
true**
Myroslav
@werber
Oct 24 2015 20:55 UTC
@m6cheung The some() method tests whether some element in the array passes the test implemented by the provided function.
Michael Cheung
@m6cheung
Oct 24 2015 20:56 UTC
[2,4,5].some(function(el) {
if(function(el) {return num % 2 === 0}) {
return el;
}
});
i thought i specified to to return the actual element but it returns true instead?
Myroslav
@werber
Oct 24 2015 20:57 UTC
@m6cheung in this case you may should use filter()
that returns an array that contains elements that passed the condition
Michael Cheung
@m6cheung
Oct 24 2015 20:57 UTC
@werber the problem is i know other ways to do the problem, but the bbonfire Finders Keepers recommends using arr.some
Myroslav
@werber
Oct 24 2015 21:00 UTC
Alternatively , you can test (.some() )array is it contain number, an then use indexOf to get index of number in array
Fennek
@fennekbe
Oct 24 2015 21:04 UTC

uh
´´´
O_O
posting here is harder than programming
Myroslav
@werber
Oct 24 2015 21:05 UTC
Shift + Enter to new line))
Fennek
@fennekbe
Oct 24 2015 21:05 UTC
  for (var i = 0; i <= str.length; i++) {
str = str.toLowerCase().replace(/\W/, "").replace("_", "").replace("_", "").replace(" ", "");
}
When I do it like this, it doesn't remove all symbols
but when I put str.lengt + 10 then it does. Any ideas?
length*
@SaintPeter
Oct 24 2015 21:06 UTC
@fennekbe Make your regular expression global, IE: /\W/g - by default String.replace only replaces the first instance of a string. The only way to replace more than one is to use a global regex
Matt Yamamoto
@MattYamamoto
Oct 24 2015 21:06 UTC
@fennekbe why not just use the global flag
dang it @SaintPeter ! you're too fast!
@SaintPeter
Oct 24 2015 21:07 UTC
@MattYamamoto :D
Fennek
@fennekbe
Oct 24 2015 21:07 UTC
Regardless of that, if i run through it as many times as i have symbols, it should work, no?
Rory Smith
@alanbuchanan
Oct 24 2015 21:07 UTC
@fennekbe you don't need that in a for loop, and you've got duplicate .replace("_", "")
gjoko1
@gjoko1
Oct 24 2015 21:07 UTC
Hey guys
Matt Yamamoto
@MattYamamoto
Oct 24 2015 21:07 UTC
throw a console.log in there to watch it and make sure it's doing what you think
@fennekbe
Rory Smith
@alanbuchanan
Oct 24 2015 21:08 UTC
gjoko1
@gjoko1
Oct 24 2015 21:08 UTC
I'm doing my Personal portfolio as part of the challenge , but I'm little bit stuck with the bootstrap grid cos it doesn't act as needed when window is resized
Rory Smith
@alanbuchanan
Oct 24 2015 21:09 UTC
@gjokomm could you post your code and a screenshot of what you mean
gjoko1
@gjoko1
Oct 24 2015 21:09 UTC
The classes I have are - col-xs-12 col-md-8 , but the col isn't gettin full width on mobile sized window
Here's codepen link debuging version - http://s.codepen.io/gjokom/debug/jbwobJ
@alanbuchanan the problem is in the 2nd "slide" in my bio div
Fennek
@fennekbe
Oct 24 2015 21:11 UTC

@alanbuchanan @MattYamamoto @SaintPeter I appreciate trying to help but I'm really just trying to understand the logic here, even if the method i'm using isn't the most prefered one.

If I test with .replace it takes 1 symbol out. If I loop through for the amount of symbols I have in my var, it should remove all the ones that I want it to, right? But it doesn't

Matt Yamamoto
@MattYamamoto
Oct 24 2015 21:11 UTC
@fennekbe what is the string you are using?
Rory Smith
@alanbuchanan
Oct 24 2015 21:11 UTC
@fennekbe that's what they meant when they said use global
@fennekbe if you use the global operator it'll go through the entire string, which means you don't need a loop
Fennek
@fennekbe
Oct 24 2015 21:12 UTC
function palindrome(str) {
// Good luck!
for (var i = 0; i <= str.length; i++) {
str = str.toLowerCase().replace(/\W/, "").replace("_", "").replace(" ", "");
}

var reverse = str.split('').reverse().join('');

if ( str.toString() == reverse .toString()) {
return true;
} else {
return false;
}
}

palindrome("0_0 (: /-\ :) 0-0");
Here's the whole thing
and yes i guess i don't need .toString
@MattYamamoto
Matt Yamamoto
@MattYamamoto
Oct 24 2015 21:14 UTC
@fennekbe thorw a console.log in there. . .there's a - lurking in the string still
Rory Smith
@alanbuchanan
Oct 24 2015 21:14 UTC
@gjokomm what's wrong with the second slide? do you want the textbox to take up the entire width of the page?
Fennek
@fennekbe
Oct 24 2015 21:14 UTC
@alanbuchanan I'm aware now that I can do it with the global operator. Thank you. But regardless of that I would still like to know why mine doesn't work
CamperBot
@camperbot
Oct 24 2015 21:14 UTC
fennekbe sends brownie points to @alanbuchanan :sparkles: :thumbsup: :sparkles:
:star: 418 | @alanbuchanan | http://www.freecodecamp.com/alanbuchanan
Fennek
@fennekbe
Oct 24 2015 21:15 UTC
@MattYamamoto Exactly, but when I increase my loop count, the extra - goes away. Which is confusing to me
Also i'm not entirely sure how to use the log function properly so I will need a moment to figure it out
gjoko1
@gjoko1
Oct 24 2015 21:15 UTC
@alanbuchanan When the page is opened from mobile device I want the col with my bio to get full width (12 cols width) while if opened from device with larger screen I want it to be half width (6 cols)
Oliver Mensah
@OMENSAH
Oct 24 2015 21:16 UTC
A
Myroslav
@werber
Oct 24 2015 21:17 UTC
@fennekbe str = str.toLowerCase().replace(/\W/g, "") return str == str.split('').reverse().join('') ? true : false; When you do many calls of replace, you just chain it all together, but it not effectively.
Rory Smith
@alanbuchanan
Oct 24 2015 21:20 UTC
@gjokomm where do you want the image to be when it goes xs? underneath the text?
Matt Yamamoto
@MattYamamoto
Oct 24 2015 21:21 UTC
@fennekbe the issue is that you are changing str whose reference (by length) is how long your loop should run. in each iteteration of the loop your end condition changes. So the loop is not running the number of times you expect
gjoko1
@gjoko1
Oct 24 2015 21:23 UTC
@alanbuchanan Yes
Fennek
@fennekbe
Oct 24 2015 21:23 UTC
does it check for that value every time the loop restarts? So to do this properly I would create a variable outside of the loop, with the value of str.length in it and then use this variable to define the loop lenght? @MattYamamoto
Or no
that still wouldn't work
Matt Yamamoto
@MattYamamoto
Oct 24 2015 21:24 UTC
@fennekbe if you were to try it the way your are implementing it... yes. although this is not an endorsement to do it that way.
but yeah, that would work.
Fennek
@fennekbe
Oct 24 2015 21:25 UTC
@MattYamamoto Oh okay. I will use that global operator though. I just didn't understand why it didn't work the way I was doing that. Now I do :) thank you
CamperBot
@camperbot
Oct 24 2015 21:25 UTC
fennekbe sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 392 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Fennek
@fennekbe
Oct 24 2015 21:25 UTC
so basicly after every loop, the length of my string got shorter, cause a symbol got removed, right?
Just to make sure I understood it correctly
Matt Yamamoto
@MattYamamoto
Oct 24 2015 21:26 UTC
@fennekbe yup, you got it.
Fennek
@fennekbe
Oct 24 2015 21:26 UTC
Alright, thanks again :)
CamperBot
@camperbot
Oct 24 2015 21:26 UTC
if you want to thank someone, put an @ before their name!
Matt Yamamoto
@MattYamamoto
Oct 24 2015 21:26 UTC
so by adding 10, as you tried, you just gave it enough more iterations to finish
Fennek
@fennekbe
Oct 24 2015 21:26 UTC
Yeah :)
Rory Smith
@alanbuchanan
Oct 24 2015 21:31 UTC
@gjokomm can't figure it out, sorry. let me know what it was when you crack it though :)
Ed Sztukowski
@Burgustu
Oct 24 2015 21:32 UTC
What's a better way to add indexes to an array other than push? I want to be able to return the indexes of an array, but push returns the length so that's a no go
Myroslav
@werber
Oct 24 2015 21:33 UTC
All indexes or just the last one
?
Ed Sztukowski
@Burgustu
Oct 24 2015 21:33 UTC
all indexes
so return the full array that has new indexes added to it
Myroslav
@werber
Oct 24 2015 21:36 UTC
As variant, you can use after adding element, forEach, that can get you array index of element while iterating over that array -> foEach(function(element, index, array)) {}
Then you can build list with all indexes
Ed Sztukowski
@Burgustu
Oct 24 2015 21:36 UTC
thanks, i'll look up forEach!
CamperBot
@camperbot
Oct 24 2015 21:36 UTC
if you want to thank someone, put an @ before their name!
tommy
@tommygebru
Oct 24 2015 21:41 UTC
Hey everyone , how can I change my gitter preferences like my account name?
Matt Yamamoto
@MattYamamoto
Oct 24 2015 21:41 UTC
@gjokomm it's the display: flex, which I'm not familiar with, on your vcenter class that is causing the issue. And I think there are issues with your row-fluid and row-slide css classes.... are those from the animate library you're using? I think you just have some compatability issues with everything you're trying to use.
@SaintPeter
Oct 24 2015 21:41 UTC
@teamegebru I believe that's all handled through GitHub
@teamegebru Note that after you do that you may need to re-sync your FCC account with GitHub
tommy
@tommygebru
Oct 24 2015 21:43 UTC
Thanks @SaintPeter , can I give you brownie points? Also does that mean I lose brownie points?
CamperBot
@camperbot
Oct 24 2015 21:43 UTC
teamegebru sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1190 | @saintpeter | http://www.freecodecamp.com/saintpeter
@SaintPeter
Oct 24 2015 21:43 UTC
@teamegebru Brownie points are not a zero sum game :D
@teamegebru They come from the heart, not your account.
@teamegebru (And you just did)
tommy
@tommygebru
Oct 24 2015 21:44 UTC
cool, brownie points for everyone
@SaintPeter
Oct 24 2015 21:44 UTC
wiki brownie points
CamperBot
@camperbot
Oct 24 2015 21:44 UTC

:point_right: brownie points [wiki]

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

There are three ways you can get Brownie Points:

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

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

tommy
@tommygebru
Oct 24 2015 21:45 UTC
Is camperBot a droid or can I give it brownie points?
Rory Smith
@alanbuchanan
Oct 24 2015 21:45 UTC
both
Michael Cheung
@m6cheung
Oct 24 2015 21:45 UTC
bonfire Smallest
CamperBot
@camperbot
Oct 24 2015 21:45 UTC

function smallestCommons(arr) {
return arr;
}

smallestCommons([1,5]);

Find the smallest number that is evenly divisible by all numbers in the provided range.

more info:  bf details | bf links | hint

tommy
@tommygebru
Oct 24 2015 21:46 UTC
thats unsettleing
Michael Cheung
@m6cheung
Oct 24 2015 21:46 UTC
CamperBot
@camperbot
Oct 24 2015 21:46 UTC
Michael Cheung
@m6cheung
Oct 24 2015 21:46 UTC
bf hint
CamperBot
@camperbot
Oct 24 2015 21:46 UTC
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Joshua
@JBressi
Oct 24 2015 22:02 UTC
hey guys i understand this is a coding chat but i have an android flash issue if someone might be able to help? please and thank you :)
CamperBot
@camperbot
Oct 24 2015 22:02 UTC
if you want to thank someone, put an @ before their name!
Joshua
@JBressi
Oct 24 2015 22:03 UTC
or if someone knows where i can get a good copy of the firmware
Cy
@cylokko
Oct 24 2015 22:14 UTC
hello guys - sos ! jquery does not run when my page loads
@SaintPeter
Oct 24 2015 22:15 UTC
@cylokko On Codepen?
Tim Bell
@MindfulBell
Oct 24 2015 22:15 UTC
@SaintPeter any idea how I can have the auto-complete div hover over the entries and not push them down? http://codepen.io/MindfulBell/pen/XmVmLR
@SaintPeter
Oct 24 2015 22:16 UTC
@MindfulBell Use absolote positioning
Cy
@cylokko
Oct 24 2015 22:16 UTC
yes
Yan Kozlovskiy
@YanKozlovskiy
Oct 24 2015 22:17 UTC
How can we convert an array of strings ['1', '2', '3'] to [1, 2, 3]?
Cy
@cylokko
Oct 24 2015 22:17 UTC
@SaintPeter - yes
@SaintPeter
Oct 24 2015 22:17 UTC
@MindfulBell If you use position: absolute INSIDE a div that is position: relative, the absolute will be relative to the relative div . . if that makes sense. And because it's absolute, it will "hover" over everything.
@cylokko Did you add jQuery in the javascript part of the "Settings" interface?
Cy
@cylokko
Oct 24 2015 22:19 UTC
@SaintPeter - i am just starting this whole coding journey - the lesson prompt asked me to post a question on the board. Thanks for your prompt response
CamperBot
@camperbot
Oct 24 2015 22:19 UTC
cylokko sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1193 | @saintpeter | http://www.freecodecamp.com/saintpeter
Aleksander Gębicki
@Takumar
Oct 24 2015 22:19 UTC
@YanKozlovskiy maybe using parseInt() and loop.
Yan Kozlovskiy
@YanKozlovskiy
Oct 24 2015 22:19 UTC
i tried but i'm getting undefined
:(
@SaintPeter
Oct 24 2015 22:20 UTC
@cylokko Sure thing :D
Tim Bell
@MindfulBell
Oct 24 2015 22:23 UTC
@SaintPeter Hmmm OK I sort of get that, but now all my text is floating way to the left...http://codepen.io/MindfulBell/pen/XmVmLR
Do I have to figure out the exact position for that div to be "centered"?
i.e. pixels etc?
And how do I make a nice box to hover over past entries?
@SaintPeter
Oct 24 2015 22:24 UTC
@MindfulBell Looking at your code now, give me a sec
Tim Bell
@MindfulBell
Oct 24 2015 22:24 UTC
YOU DA BEST
@SaintPeter
Oct 24 2015 22:25 UTC
@MindfulBell Ok, you need to create a sub-container that holds both your input box and your auto-complete div. position that sub-container properly and give the auto-complete div a top offset to push it below your input box.
@MindfulBell I'm not sure how easy that will ultimately turn out to be. I'm playing with it and it's non-trivial :D
Tim Bell
@MindfulBell
Oct 24 2015 22:29 UTC
doesn't the div "query container" hold that
@SaintPeter
Oct 24 2015 22:30 UTC
@MindfulBell The problem is that that container is really wide.
@MindfulBell So your autocomplete ends up off to the side
Tim Bell
@MindfulBell
Oct 24 2015 22:31 UTC
yea i fixed that...
just made that smaller and gave the entries their own huge width
@SaintPeter
Oct 24 2015 22:32 UTC
ok
@MindfulBell Did it work, then?
Tim Bell
@MindfulBell
Oct 24 2015 22:33 UTC
well i mean it's still shifted to the left, just not as far
You'd think adding a div below a search box that hovers over stuff wouldn't be too hard
@SaintPeter
Oct 24 2015 22:33 UTC
@MindfulBell You can give some left position to the autocomplete box
@MindfulBell Nope. It's hard :D
@MindfulBell OH OH OH
Aleksander Gębicki
@Takumar
Oct 24 2015 22:34 UTC
@YanKozlovskiy for sure exists better solution, but this will also work:
arr = ['1', '2', '3'];

for (var i=0; i < arr.length; i++) {
arr[i] = parseInt(arr[i]);
}
@SaintPeter
Oct 24 2015 22:35 UTC

@MindfulBell make the autocomplete box completely independant and use this css:

position: absolute;
margin-left: auto;
margin-right: auto;
left: 0;
right: 0;

That'll center the whole thing on the screen.

Tim Bell
@MindfulBell
Oct 24 2015 22:36 UTC
@SaintPeter when you say independent, what do you mean? not within a div?
@SaintPeter
Oct 24 2015 22:36 UTC
@MindfulBell Yeah - or, actually, if you leave it where it was, that might center it up inside your box
@MindfulBell With your current code, put that into the .auto-complete box and it centered right up.
Tim Bell
@MindfulBell
Oct 24 2015 22:38 UTC
@SaintPeter ok that worked thanks. But now I need to make it pop out and be on top of the entries that will appear below it
CamperBot
@camperbot
Oct 24 2015 22:38 UTC
mindfulbell sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1195 | @saintpeter | http://www.freecodecamp.com/saintpeter
Tim Bell
@MindfulBell
Oct 24 2015 22:39 UTC
@SaintPeter I gave it a background color of white and it covers the stuff below it, but the left most letter won't stay in the box...
ugh
@SaintPeter
Oct 24 2015 22:40 UTC
@MindfulBell .auto-entries has a margin of -10px
@MindfulBell
.auto-entries {
margin: -10px;  /* Gotta fix this */
height: 20px;
}
Tim Bell
@MindfulBell
Oct 24 2015 22:42 UTC
I think I got it.
that hasn't given me problems...
I want things to be closer together
i don't like the spaced out search and line-height made it weird
i'll fiddle
Mark Puetz
@Funkybunch2006
Oct 24 2015 22:50 UTC
@all how do I enter a directory that exists on my desktop in Git (iTerm2)
Tiffany White
@twhite96
Oct 24 2015 22:53 UTC
@Funkybunch2006 wouldn't you just enter that director y right in bash?
Mark Puetz
@Funkybunch2006
Oct 24 2015 22:54 UTC
@twhite96 I don't know how. Totally new Git user. It's throwing me for a loop. Tutorials not helping much
Tiffany White
@twhite96
Oct 24 2015 22:55 UTC
You can use cd ~/De and hit Tab
It will fill out the directory for you
and then hit enter @Funkybunch2006
You will then be in the Desktop directory
cd stands for change directory in bash
The tilda ~ is your home folder and then
Filling out part of the directory and hitting Tab is known as Tab completion
Or...you could just drag and drop your Desktop folder into iTerm
Mark Puetz
@Funkybunch2006
Oct 24 2015 22:57 UTC
@twhite96 really? Let me play with this... thanks @twhite96
CamperBot
@camperbot
Oct 24 2015 22:57 UTC
funkybunch2006 sends brownie points to @twhite96 and @twhite96 :sparkles: :thumbsup: :sparkles:
:star: 73 | @twhite96 | http://www.freecodecamp.com/twhite96
:star: 73 | @twhite96 | http://www.freecodecamp.com/twhite96
Tiffany White
@twhite96
Oct 24 2015 22:58 UTC
You're welcome @Funkybunch2006
Tim Bell
@MindfulBell
Oct 24 2015 22:58 UTC
So what do I do to make a button have a finger pointy thing when you hover over it?
got it
Yan Kozlovskiy
@YanKozlovskiy
Oct 24 2015 23:22 UTC
function decoder(key, code) {
return code.map(function(number) {
return key[number];
});
}

decoder("ABCDEFGHIJKLMNOPQRSTUVWXYZ", [2, 14, 3, 8, 13, 6]);
What can I do to make my code return a string instead of an array?
Jordan Bourne
@JordanBourne
Oct 24 2015 23:30 UTC
@YanKozlovskiy toString() or join()
Joel M. Swensen
@JoelMSwensen
Oct 24 2015 23:48 UTC
Hey all, I’m still banging my head on this. Can anyone clue me in on how to access the quoteSend var in the anonymous function so I can use it in the api string?
$( document ).ready(function() { // function random()$('#btn1').click(function(){
var rand = Math.floor((Math.random() * 10));
var quoteSend = quotes[rand];
$('#output').html(quotes[rand]); });$('#twitterQuote').html('<a class="twitter-share-button" href="https://twitter.com/intent/tweet?text=' + quoteSend + '"> Tweet</a>');

});
DTing
@dting
Oct 24 2015 23:49 UTC
@JoelMSwensen declare the var outside the callback function
$( document ).ready(function() { // function random() var quoteSend;$('#btn1').click(function(){
var rand = Math.floor((Math.random() * 10));
quoteSend = quotes[rand];
$('#output').html(quotes[rand]); });$('#twitterQuote').html('<a class="twitter-share-button" href="https://twitter.com/intent/tweet?text=' + quoteSend + '"> Tweet</a>');
});
Joel M. Swensen
@JoelMSwensen
Oct 24 2015 23:50 UTC
oh, I was declairing it like var quoteSend = ‘’; when i put it outside
DTing
@dting
Oct 24 2015 23:50 UTC
or
$( document ).ready(function() { // function random()$('#btn1').click(function(){
var rand = Math.floor((Math.random() * 10));
var quoteSend = quotes[rand];
$('#output').html(quotes[rand]);$('#twitterQuote').html('<a class="twitter-share-button" href="https://twitter.com/intent/tweet?text=' + quoteSend + '"> Tweet</a>');
});
});
move the setting inside the click callback
Yan Kozlovskiy
@YanKozlovskiy
Oct 24 2015 23:51 UTC
function decoder(key, code) {

for (var i = 0; i <= code.length; i++) {
if (code[i] < 0 || code[i] === code[i].toString()) {
return "Error: You must enter a number greater than or equal to 0";
}
}

return code.map(function(number) {
return key[number];
}).join('');
}

decoder("ABCDEFGHIJKLMNOPQRSTUVWXYZ", [2, 14, 3, 8, 13, 6]);
It's saying that it's undefined even though it is defined in the argument. What is happening here?
DTing
@dting
Oct 24 2015 23:51 UTC
that is probably more what you want since you want to set that button everytime the quote changes
Matt Yamamoto
@MattYamamoto
Oct 24 2015 23:52 UTC
@JoelMSwensen also, based on the class of your a tag I'm assuming your using the twitter button widget. If you're using Codepen then you'll have issues.
Joel M. Swensen
@JoelMSwensen
Oct 24 2015 23:52 UTC
@dting both of these are problematic
I’m not using codepen yet, I can’t stand that workspace
Matt Yamamoto
@MattYamamoto
Oct 24 2015 23:52 UTC
haha... then nvm
DTing
@dting
Oct 24 2015 23:53 UTC
whats the problem?
Joel M. Swensen
@JoelMSwensen
Oct 24 2015 23:53 UTC
here, let me update the github so I can show the whole project such that it is
Mayank
@mayank-gupta
Oct 24 2015 23:53 UTC
i am at step 111. Can't go to the next step even though the tests run fine
Not sure what i am missing here
DTing
@dting
Oct 24 2015 23:54 UTC
@YanKozlovskiy you are iterating the code one step too far
    for (var i = 0; i <= code.length; i++) {
should be
    for (var i = 0; i < code.length; i++) {
Yan Kozlovskiy
@YanKozlovskiy
Oct 24 2015 23:55 UTC
thank you
CamperBot
@camperbot
Oct 24 2015 23:55 UTC
if you want to thank someone, put an @ before their name!
Yan Kozlovskiy
@YanKozlovskiy
Oct 24 2015 23:55 UTC
what is a good pointer on how to know when to use the =?
i always get confused
DTing
@dting
Oct 24 2015 23:56 UTC
arrays are 0 indexed
that means it starts with 0
Yan Kozlovskiy
@YanKozlovskiy
Oct 24 2015 23:56 UTC
oh i see thank you so much @dting
CamperBot
@camperbot
Oct 24 2015 23:56 UTC
yankozlovskiy sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1461 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Oct 24 2015 23:57 UTC
you could also write i <= code.length-1 but that is 3 extra characters and not more clear so most people will just use < and no -1