These are chat archives for FreeCodeCamp/Help

19th
Feb 2016
Gerti
@S3condG3ar
Feb 19 2016 00:00
@Melinaduffy90 itry this out
@Melinaduffy90 #orange-text {color: orange; }
Melina Duffy
@Melinaduffy90
Feb 19 2016 00:02
@S3condG3ar: You're awesome! thanks a bunch!
CamperBot
@camperbot
Feb 19 2016 00:02
melinaduffy90 sends brownie points to @s3condg3ar :sparkles: :thumbsup: :sparkles:
:star: 202 | @s3condg3ar | http://www.freecodecamp.com/s3condg3ar
Sebastian lhådö
@miniskurken
Feb 19 2016 00:03
Okey so i'm pretty much done with the portfolio task but there is one slight problem, how do you make it possible to open links with codepen?
:&
Sloth
@RMo-Sloth
Feb 19 2016 00:03
@Rogers187 and you should add the css styles in the css tab of codepen and add teh stylesheets using the settings option in codepen.
Steve
@taxicabman
Feb 19 2016 00:03
Hi - I'm on the 'Change the Font Size of an element' challenge. Whatever I do, I cannot get past it. Any suggestions? The instructions are a bit ambiguous!
Timofey Votyakov
@tvotyakov
Feb 19 2016 00:04
@S3condG3ar try to think. Lets send 4 inside your function as you wrote it above. First of all It will check if (val < 10). Is val < 10 true in this case? Yes. That's why it is call return 'Less than 10';
Sloth
@RMo-Sloth
Feb 19 2016 00:06
@miniskurken use target="blank"
Sebastian lhådö
@miniskurken
Feb 19 2016 00:06
i've tried but still wont work for my buttons :(
Timofey Votyakov
@tvotyakov
Feb 19 2016 00:06
@S3condG3ar but you should return 'Less than 5' because of challenge requirements. Lets try what if we will change if (val < 10) and if (val < 5). In this case if (val < 5) will execute first and will return 'Less than 5' if value will less than 5.
Sebastian lhådö
@miniskurken
Feb 19 2016 00:07
but i can give it another go
philipsiu
@philipsiu
Feb 19 2016 00:07
function largestOfFour(arr) {
  // You can do this!
  var lrg = 0;
  var lrgArr = [];
  for (var i = 0; i < arr.length; i++) {
    for (var j = 0; j < arr[i].length; j++) {
      if (arr[i][j] > lrg) {
        lrg = arr[i][j];

      }
    }
  }
  return lrg;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
I cannot figure out how to have the largest number in each subarray get pushed into a blank variable.
Gerti
@S3condG3ar
Feb 19 2016 00:09
@Melinaduffy90 glad to help u :D
@tvotyakov ill try it out :D
Alexander Køpke
@alexanderkopke
Feb 19 2016 00:10
@philthyfill if you sort each of the arrays so the largest number is first, then it would only be a matter of pushing the first number of each array over to lrgArr
Steve
@taxicabman
Feb 19 2016 00:11
Figured it out - for an old timer newbie, it's nice to know this community is here
Tony
@Rogers187
Feb 19 2016 00:11
@RobMo I just tried to copy and paste it over. But when I cut it out of the html side I lost some font sizes and lost my h1 css
philipsiu
@philipsiu
Feb 19 2016 00:12
@alexanderkopke Thanks. I'll give that a shot.
CamperBot
@camperbot
Feb 19 2016 00:12
philthyfill sends brownie points to @alexanderkopke :sparkles: :thumbsup: :sparkles:
:star: 480 | @alexanderkopke | http://www.freecodecamp.com/alexanderkopke
Alexander Køpke
@alexanderkopke
Feb 19 2016 00:13
@philthyfill however, your way should work too. Your second for loop finds the biggest number of each array, so after that loop you just push lrg to lrgArr
Sloth
@RMo-Sloth
Feb 19 2016 00:14
@Rogers187 did you remove the <style></style> ?
Tony
@Rogers187
Feb 19 2016 00:15
@RobMo no
Aireal
@aireal32
Feb 19 2016 00:15
Okay I need some help- what does it mean when they say delete all trailing tags --> ??
Sloth
@RMo-Sloth
Feb 19 2016 00:16
should work after doing that ;) @Rogers187
Alexander Køpke
@alexanderkopke
Feb 19 2016 00:16
 for (var i = 0; i < arr.length; i++) {
    for (var j = 0; j < arr[i].length; j++) {
      if (arr[i][j] > lrg) {
        lrg = arr[i][j];

      }
    }
lrgArr.push(lrg); 
lrg =0;// you need to reset lrg to 0
  }
Aireal
@aireal32
Feb 19 2016 00:17
Ha I got it nevermind
Alexander Køpke
@alexanderkopke
Feb 19 2016 00:17
@philthyfill that would be my take on it. But it is only an idea or direction for you to look at if you want to. good luck!
Gerti
@S3condG3ar
Feb 19 2016 00:17
@tvotyakov ty man i solved that :D
Timofey Votyakov
@tvotyakov
Feb 19 2016 00:18
@S3condG3ar glad to see it
Taylor
@tknovember
Feb 19 2016 00:24
Does anyone here have a good grasp of API’s? I am trying to build the wikipedia project and my get request returns this error every time: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
Tony
@Rogers187
Feb 19 2016 00:27
@RobMo didn't help
philipsiu
@philipsiu
Feb 19 2016 00:29
@alexanderkopke That's an interesting way to see it. So how does the looping work. If I'm looping through the first sub-arras, [4,5,1,3], and my var leg = 0 outside of all the loops. The first number, 4, gets put into the variable lrg. Does the second loop finish with the first sub-array before it pushes the the highest number into my new array, lrgArr?
Sloth
@RMo-Sloth
Feb 19 2016 00:29
@Rogers187 send me a link to what you ve got now?
Megha Dubey
@dubeymegha
Feb 19 2016 00:34
Hello.. I have a trouble in clicking run tests .It is not working .What should I do ??
javalip
@javalip
Feb 19 2016 00:41
@dubeymegha - After fixing all the assignment on lessons, When I had that problem, I went to a different lesson on map and came back to the one that wasn't working. It worked for me.
Tameera Corporal
@TameeraCorporal
Feb 19 2016 00:47
@dubeymegha copy all of your code first and then hit F5 to reset the console. . it has worked for me alot!!
Megha Dubey
@dubeymegha
Feb 19 2016 00:49
Hey .. Thanks.. I have moved on and working on other projects that are working but previous one is still unchanged. when I am clicking to the "Run Tests" its not showing the next one.
Ivan Marinov
@MadBulgarian
Feb 19 2016 01:10
I need help!
FarionLord
@FarionLord
Feb 19 2016 01:11
anything below bootstrap I can help @xWhiteGx
Sloth
@RMo-Sloth
Feb 19 2016 01:12
@Rogers187 I m not sure how I fixed the error but it works like this. Do make your own save because I ll remove the fork soonish.
http://codepen.io/RobMo/pen/adrJzw
FarionLord
@FarionLord
Feb 19 2016 01:12
<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>

  <div class="row">
    <div class="col-xs-6">
     <div class="col-xs-6">
   </div>
    </div>
  </div>
</div>
Help? "Nest two div class="col-xs-6" elements within your div class="row" element."
Tim Gaines
@timdoes
Feb 19 2016 01:15
<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">
    <div class="col-xs-6"></div>
    <div class="col-xs-6"></div>
  </div>
</div>
Krystal Lord
@QUICKRYS4
Feb 19 2016 01:17
blobI'm pretty sure I have a </div> tag. But the exercise won't let me run the test...am I missing something? thnx
Tony
@Rogers187
Feb 19 2016 01:17
@RobMo yep that worked. Thanks again. And yes it does look a lot better.
CamperBot
@camperbot
Feb 19 2016 01:17
rogers187 sends brownie points to @robmo :sparkles: :thumbsup: :sparkles:
:star: 202 | @robmo | http://www.freecodecamp.com/robmo
Mark David Teo
@volaix
Feb 19 2016 01:23
Can anyone help me understand how I can get the "2 and 3"?
function destroyer(arr) {
  // Remove all the values
  return arr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
currently it only returns [1,2,3,1,2,3]
and not the full [1,2,3,1,2,3],2,3
Krystal Lord
@QUICKRYS4
Feb 19 2016 01:25
Hi? Can anyone help me? : )
Franco Zapata
@Francozt01
Feb 19 2016 01:26
@volaix read about "arguments" parameter
Aleksander Gębicki
@Takumar
Feb 19 2016 01:26
hi @volaix , you have to read about arguments: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments
You cannot access 2 and 3 values without that.
Moisés Man
@moigithub
Feb 19 2016 01:27
wiki arguments
CamperBot
@camperbot
Feb 19 2016 01:27

:point_right: algorithm arguments optional [wiki]

Explanation:

It can be quite complicated to understand what needs to be done. There are always many ways to do something when coding but regardless of the algorithm used, we have to create a program that does the following:

  • It has to add two numbers passed as parameters and return the sum.
  • It has to check if any of the numbers are actual numbers, otherwise return undefined and stop the program right there.
  • It has to check if it has one or two arguments passed. More are ignored.
  • If it has only one argument then it has to return a function that uses that number and expects another one, to then add it.

:pencil: read more about algorithm arguments optional on the FCC Wiki

Moisés Man
@moigithub
Feb 19 2016 01:27
wrong one :)
Franco Zapata
@Francozt01
Feb 19 2016 01:27
lol
Mark David Teo
@volaix
Feb 19 2016 01:27
@Takumar oh hey! I see you all the time aha
Aleksander Gębicki
@Takumar
Feb 19 2016 01:27
@QUICKRYS4 which challenge is it?
Mark David Teo
@volaix
Feb 19 2016 01:28
@Takumar @Francozt01 but yeah, ugh. Ive read the arguments thing. Or atleast skimmed through.
Franco Zapata
@Francozt01
Feb 19 2016 01:28
@volaix tukumar is Mr.Help
Aleksander Gębicki
@Takumar
Feb 19 2016 01:28
@volaix not all the time but quite often :-) Recently not so often :-)
Franco Zapata
@Francozt01
Feb 19 2016 01:28
:D
Mark David Teo
@volaix
Feb 19 2016 01:28
I'll have another look
Krystal Lord
@QUICKRYS4
Feb 19 2016 01:28
@Takumar Nest Many Elements within a single Div element
Jean Gardy
@jeangardy509
Feb 19 2016 01:29
blob
Mark David Teo
@volaix
Feb 19 2016 01:29
ok thanks @Takumar @Francozt01 imma nap or something lol
CamperBot
@camperbot
Feb 19 2016 01:29
volaix sends brownie points to @takumar and @francozt01 :sparkles: :thumbsup: :sparkles:
:star: 2337 | @takumar | http://www.freecodecamp.com/takumar
:star: 546 | @francozt01 | http://www.freecodecamp.com/francozt01
Jean Gardy
@jeangardy509
Feb 19 2016 01:30
blob
I do not see my Github information on the right side of codepen. Please see screenshot
Aleksander Gębicki
@Takumar
Feb 19 2016 01:31
@QUICKRYS4 I have checked this challenge and you have added DIV in good place. Are you sure you haven't changed anything else in your code?
Try to refresh your browser, if that will not work, use "Reset" button and try again adding <div> and </div> to your code.
FarionLord
@FarionLord
Feb 19 2016 01:32
@timdoes thanks
CamperBot
@camperbot
Feb 19 2016 01:32
farionlord sends brownie points to @timdoes :sparkles: :thumbsup: :sparkles:
:star: 15 | @timdoes | http://www.freecodecamp.com/timdoes
Aleksander Gębicki
@Takumar
Feb 19 2016 01:32
@volaix you are welcome :-)
You have to understand well arguments before continuing this challenge.
Treat it similar to basic array, you can access its elements using index.
Krystal Lord
@QUICKRYS4
Feb 19 2016 01:33
@Takumar I have refreshed the page...I didn't change anything else in the code. Will I lose all my previous code once I "reset" it?
Mark David Teo
@volaix
Feb 19 2016 01:33
@jeangardy509 it's not there anymore
Aleksander Gębicki
@Takumar
Feb 19 2016 01:33
@QUICKRYS4 yes, but that's only two lines of code, <div> and </div> to add :-)
With "Reset" button you will clean code in your current challenge!
Mark David Teo
@volaix
Feb 19 2016 01:33
@jeangardy509 instead click 'sign in' and there should be an option when you sign in to use your github account
Krystal Lord
@QUICKRYS4
Feb 19 2016 01:34
@Takumar okay phew! I'm so attached to my little piece of code :smile:
Jean Gardy
@jeangardy509
Feb 19 2016 01:34
@volaix thanks bud but that's what i did and the info isn't there anymore
CamperBot
@camperbot
Feb 19 2016 01:34
jeangardy509 sends brownie points to @volaix :sparkles: :thumbsup: :sparkles:
:star: 267 | @volaix | http://www.freecodecamp.com/volaix
Aleksander Gębicki
@Takumar
Feb 19 2016 01:35
@QUICKRYS4 I understand. Good coder should be proud of his/her code :-)
Krystal Lord
@QUICKRYS4
Feb 19 2016 01:35
@Takumar so the reset worked! It was "space" sensitive...jeez
@Takumar Thank you!!
CamperBot
@camperbot
Feb 19 2016 01:35
quickrys4 sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 2338 | @takumar | http://www.freecodecamp.com/takumar
Jean Gardy
@jeangardy509
Feb 19 2016 01:35
@volaix the direction say to do exactly that and once you I get to that point. it's not showing up
Aleksander Gębicki
@Takumar
Feb 19 2016 01:36
@QUICKRYS4 you are welcome :-)
Unfortunately sometimes there are such small problems with any learning platform.
Aireal
@aireal32
Feb 19 2016 01:47
I need help!! I am trying to change a color to blue so far is have
<style> h2 {color:blue;} </style> Am I missing something?
Shea Stock
@vashea
Feb 19 2016 01:50
how do i nest all HTML elements in a .container-fluid
Aleksander Gębicki
@Takumar
Feb 19 2016 01:51
@vashea put everything after </style> tag between:
<div class="container-fluid"> and </div>
Connor Bronson
@carbonbuild
Feb 19 2016 01:51
@aireal32 Are you trying to change the font color?
lawrencebass
@lawrencebass
Feb 19 2016 01:52
Doesn't look like you are, can you post your code in chat @aireal32
Aleksander Gębicki
@Takumar
Feb 19 2016 01:52
@aireal32 your code is making all h2 headings blue, is this what you are trying to do?
Thierry
@tcharlem
Feb 19 2016 01:54
@aireal32 in your CSS file remove <style> and </style>
Shea Stock
@vashea
Feb 19 2016 01:55
@Takumar okay! I've got that outside of the style, what do i put inside the style? .container-fluid { ;} ?
Nikola
@H0g4r
Feb 19 2016 01:55
hello, can you help me, how to change navbar background color when i scrol down page, i would like background color change auotmatic
Aleksander Gębicki
@Takumar
Feb 19 2016 01:55
@vashea no, you don't have to define such class, it is already defined for you.
Just try to nest HTML code in DIV, that's all.
S.L. Ting
@palden
Feb 19 2016 01:56

@aireal32 , in a html file:

<style> h2 {color:blue;} </style>
<h2> This is in blue. </h2>

hope this helps :smile:

Connor Bronson
@carbonbuild
Feb 19 2016 01:58
Is there a way to skip HTML challenges?
Aleksander Gębicki
@Takumar
Feb 19 2016 01:58
@carbonbuild just click on your MAP anywhere where you want to continue.
Connor Bronson
@carbonbuild
Feb 19 2016 01:59
@Takumar I found it, thank you!
CamperBot
@camperbot
Feb 19 2016 01:59
carbonbuild sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 2341 | @takumar | http://www.freecodecamp.com/takumar
Aleksander Gębicki
@Takumar
Feb 19 2016 01:59
@carbonbuild you are welcome :-)
lawrencebass
@lawrencebass
Feb 19 2016 02:04
Hey @H0g4r , I just tried this out. You can do it using JQuery
$(window).scroll(function() {
    var height = $(window).scrollTop();
    var scroll_distance = 100;
    if(height  > scroll_distance) {
        // do something
      $(".navbar").css("background-color", "yellow");
    } else {
      $(".navbar").css("background-color", "blue");
    }
});
Shea Stock
@vashea
Feb 19 2016 02:05
@Takumar Ahh! I got it, i had the closing tab right after div element not at the end of all the coding. Thanks for your help
CamperBot
@camperbot
Feb 19 2016 02:05
vashea sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 2343 | @takumar | http://www.freecodecamp.com/takumar
Aireal
@aireal32
Feb 19 2016 02:05
@palden you are AWESOME! ha I couldn't get it!
Aleksander Gębicki
@Takumar
Feb 19 2016 02:09
@vashea good job! :thumbsup: :-)
philipsiu
@philipsiu
Feb 19 2016 02:38
function end(str, target) {
  // "Never give up and good luck will find you."
  // -- Falcor
  if (str.substr(-1) == target) {
    return true;
  } else {
    return false;
  }
}

end("Bastian", "n");
I'm having trouble with the challenge "Confirm the Ending".
My code only matches the -1 of the string. Is there a technique where I can match the last word of the string, just not the letter?
Nahid Muzammil
@NahidRM
Feb 19 2016 02:40
Isn't the end of a string the null character? /0
Taurus Colvin
@colvint
Feb 19 2016 02:42
@philthyfill you could use the string length
lawrencebass
@lawrencebass
Feb 19 2016 02:42
@philthyfill str.substr(str.length-target.length)
Taurus Colvin
@colvint
Feb 19 2016 02:44
var strLen = str.length;
if (str[strLen] === target) {
// …
}
…
lawrencebass
@lawrencebass
Feb 19 2016 02:44
That way if the target is greater than length 1 you can still verify that it is part of the ending @philthyfill , also use === instead of == in your if statement
philipsiu
@philipsiu
Feb 19 2016 02:49
@colvint Thanks
CamperBot
@camperbot
Feb 19 2016 02:49
philthyfill sends brownie points to @colvint :sparkles: :thumbsup: :sparkles:
:star: 61 | @colvint | http://www.freecodecamp.com/colvint
philipsiu
@philipsiu
Feb 19 2016 02:49
@lawrencebass thanks
CamperBot
@camperbot
Feb 19 2016 02:49
philthyfill sends brownie points to @lawrencebass :sparkles: :thumbsup: :sparkles:
:star: 340 | @lawrencebass | http://www.freecodecamp.com/lawrencebass
bitgrower
@bitgrower
Feb 19 2016 02:50
or you could use ES6 and use endsWith ... :)
Lonloren
@Lonloren
Feb 19 2016 02:50

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

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

lawrencebass
@lawrencebass
Feb 19 2016 02:51
@colvint str[strLen] is not in the scope of the string, example: if str = "bob" then str.length = 3, if you tried to return str[str.length], you wouldn't get anything back because the last value in str is str.length-1 which in this case is index2
Im missing something simple it seems like
bitgrower
@bitgrower
Feb 19 2016 02:53
What is that, @EskimoBurd ?
Kinshuk Sen
@kinshuksen
Feb 19 2016 02:54
I dont think that's how you define buttons @EskimoBurd
bitgrower
@bitgrower
Feb 19 2016 02:54
I don't click on sites to unknown sites from people I don't know without some excellent reasons
Kinshuk Sen
@kinshuksen
Feb 19 2016 02:54
@bitgrower its just a screenshot to his error :)
bitgrower
@bitgrower
Feb 19 2016 02:54
ahhhhh ... okay ...
thanks!
Kinshuk Sen
@kinshuksen
Feb 19 2016 02:54
nps
lawrencebass
@lawrencebass
Feb 19 2016 02:55
Use <button></button> to define buttons @EskimoBurd
Matt Burd
@EskimoBurd
Feb 19 2016 02:55
yea lol dont be paranoid :)
ah ok
i was breezing through them by myself and got cocky hehe
bitgrower
@bitgrower
Feb 19 2016 02:55
@lawrencebass -- wrong person ...
lawrencebass
@lawrencebass
Feb 19 2016 02:56
Opps lol @bitgrower
bitgrower
@bitgrower
Feb 19 2016 02:56
yeah, easy to do with gitter's popup thingie ... happens to me all the time ... auto-completion in some bizarre way, but not one I've figured out ... I suspect recency has something to do with it ...
Matt Burd
@EskimoBurd
Feb 19 2016 02:56
yea all good ty ty, with full time job and school this can be confusing
budimanfix
@budimanfix
Feb 19 2016 02:57

Hi folks, what i missing here : function lookUp(firstName, prop){
// Only change code below this line

for (var i = 0;i < contacts.length; i++) {
if (contacts[i].firstName === firstName)
{
if (contacts[i][prop]) {
return contacts[i][prop]; }
else {
return "No such property";
}

Brian
@sludge256
Feb 19 2016 02:57
@bitgrower oops @bitgrower @bitgrower oops again
lawrencebass
@lawrencebass
Feb 19 2016 02:57
Lol ^
bitgrower
@bitgrower
Feb 19 2016 02:57
LOL @sludge256 -- too bad you weren't talking about tax in the same sentence ... :)
CamperBot
@camperbot
Feb 19 2016 02:57
bitgrower sends brownie points to @sludge256 :sparkles: :thumbsup: :sparkles:
:star: 1553 | @sludge256 | http://www.freecodecamp.com/sludge256
Kinshuk Sen
@kinshuksen
Feb 19 2016 02:58
@budimanfix where are you getting contacts from?
it doesnt seem to be in scope
lawrencebass
@lawrencebass
Feb 19 2016 02:59
He didn't post the full code @kinshuksen , contacts is an array of objects
Kinshuk Sen
@kinshuksen
Feb 19 2016 03:00
Oh ok. 2 dimensional array?
lawrencebass
@lawrencebass
Feb 19 2016 03:01
I think its 1 dimensional if I remember correctly @kinshuksen , Hey can you post the full formatted code @budimanfix
help format
CamperBot
@camperbot
Feb 19 2016 03:01

: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

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

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

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

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

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

Thomas Noe
@t3h2mas
Feb 19 2016 03:01
Hey guys, curious if anyone sees an issue with my diff code...
function myIn(a, v) {
  return (a.indexOf(v) !== -1);
}

function diff(arr1, arr2) {
  var newArr = [];
  // Same, same; but different.
  newArr.concat(arr1, arr2);
  newArr = newArr.filter(function (item) {
    if (myIn(arr1, item) && myIn(arr2, item))
      return false;
    return true;
  });
  return newArr;
}

diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);
bitgrower
@bitgrower
Feb 19 2016 03:03
@t3h2mas -- which challenge ?
Thomas Noe
@t3h2mas
Feb 19 2016 03:03
diff-two-arrays
bitgrower
@bitgrower
Feb 19 2016 03:03
thanks
Liam Bang
@Liam345
Feb 19 2016 03:04
function titleCase(str) {

  str.splice(2,1,"i","x");


  return str;

}
titleCase("I'm a little tea pot");
Kinshuk Sen
@kinshuksen
Feb 19 2016 03:05
@budimanfix I am assuming (without seeing the full code), you have to use a . to access properties of an array
Liam Bang
@Liam345
Feb 19 2016 03:05
Why does it say that that str.splice is not function
lawrencebass
@lawrencebass
Feb 19 2016 03:05
@t3h2mas newArr = newArr.concat(arr1, arr2)
bitgrower
@bitgrower
Feb 19 2016 03:05
@t3h2mas -- something is wrong with your newArry.concat -- but I'm not sure what ...
@Liam345 -- usually because your str variable is not holding a value which splice works on ... like, a string, or a number ...
Thomas Noe
@t3h2mas
Feb 19 2016 03:06
Derp
much tax @lawrencebass @bitgrower
CamperBot
@camperbot
Feb 19 2016 03:06
t3h2mas sends brownie points to @lawrencebass and @bitgrower :sparkles: :thumbsup: :sparkles:
:star: 567 | @bitgrower | http://www.freecodecamp.com/bitgrower
:star: 341 | @lawrencebass | http://www.freecodecamp.com/lawrencebass
lawrencebass
@lawrencebass
Feb 19 2016 03:07
Did that fix it? @t3h2mas
Thomas Noe
@t3h2mas
Feb 19 2016 03:07
Yep
lawrencebass
@lawrencebass
Feb 19 2016 03:07
Ait cool @t3h2mas
bitgrower
@bitgrower
Feb 19 2016 03:08
lol ... the old try to assign a variable to a functional construct gotcha ...
bitgrower @bitgrower adds a rule to her "what to look for when debugging list" ... don't assign a functional programming construct to a variable unless you've got a good idea why you would want to do such an usually unusually thing ...
budimanfix
@budimanfix
Feb 19 2016 03:10

@lawrencebass function lookUp(firstName, prop){
// Only change code below this line

for (var i = 0;i < contacts.length; i++) {
if (contacts[i].firstName === firstName)
{
if (contacts[i][prop]) {
return contacts[i][prop]; }
else {
return "No such property";
}

}

}
}
// Only change code above this line

// Change these values to test your function
lookUp("Akira", "likes");

Matt Burd
@EskimoBurd
Feb 19 2016 03:11

https://gyazo.com/a32986b89ff6f15ed8fd0f9442ccd1df

should i be having 2 classes, one for btn and one for btn-default

bitgrower
@bitgrower
Feb 19 2016 03:11
@Liam345 -- also, after looking at your code, you need to read up on what splice does ...
lawrencebass
@lawrencebass
Feb 19 2016 03:13
@budimanfix try using contacts[i].hasOwnProperty(prop) in your second if statement to check if the property exists instead of contact[i][prop]
Thomas Noe
@t3h2mas
Feb 19 2016 03:13
@EskimoBurd yeah
lawrencebass
@lawrencebass
Feb 19 2016 03:15
Actually might not even matter @budimanfix
Andy Bonner
@AbdiViklas
Feb 19 2016 03:17
Um--I got to the point of the "tribute page" project--and the URL of the model is 404'd! http://codepen.io/FreeCodeCamp/full/wMQrXV
Kinshuk Sen
@kinshuksen
Feb 19 2016 03:18
@EskimoBurd you have to mark the classes within the same " btn btn-default"
with a space separating them
Thomas Noe
@t3h2mas
Feb 19 2016 03:19
it's up on my end @AbdiViklas
Andy Bonner
@AbdiViklas
Feb 19 2016 03:20
@t3h2mas Huh? The same URL I just pasted works for you?
Thomas Noe
@t3h2mas
Feb 19 2016 03:21
Yes.
idietmoran
@idietmoran
Feb 19 2016 03:22
@AbdiViklas works for me
Andy Bonner
@AbdiViklas
Feb 19 2016 03:23
WEIRD. Okay, trying a different browser...
idietmoran
@idietmoran
Feb 19 2016 03:23
@AbdiViklas check your console for errors
Wayne2jm
@Wayne2jm
Feb 19 2016 03:24
good evening room
bitgrower
@bitgrower
Feb 19 2016 03:24
depends on where you are, @Wayne2jm ... :)
Wayne2jm
@Wayne2jm
Feb 19 2016 03:24
that is true
Andy Bonner
@AbdiViklas
Feb 19 2016 03:25
Interesting, it works in Chrome. I was in Firefox at first.
idietmoran
@idietmoran
Feb 19 2016 03:25
@AbdiViklas im on firefox dev edition it works fine. are you running noscript or https everywhere by chance?
Stefano Long
@Tefo123
Feb 19 2016 03:25
hello, whats wrong with my code
Wayne2jm
@Wayne2jm
Feb 19 2016 03:25

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

.gray-background {
background-color: gray;
}

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


</style>

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

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

<a href="#"><img class="smaller-image thick-green-border" alt="A cute orange cat lying on its back" 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 class="background-color" action="/submit-cat-photo" id="cat-photo-form">
<label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>

Stefano Long
@Tefo123
Feb 19 2016 03:26
<div class="col-xs-6">
<div class="row">
<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>
</div>
</div>
Wayne2jm
@Wayne2jm
Feb 19 2016 03:26
Im having issues with the use an ID attribute to style an element
Andy Bonner
@AbdiViklas
Feb 19 2016 03:26
@idietmoran I'm afraid that's a little ahead of my experience so far. I don't think I'm running any extension like that that should affect JS. I am running Adblock...
(I mean, I can open the console, but I don't know what I'm looking at)
Wayne2jm
@Wayne2jm
Feb 19 2016 03:27
I get all tests correct except "Do not give your form any class or style attributes"
any help would be appreciated. thanks
lawrencebass
@lawrencebass
Feb 19 2016 03:28
@budimanfix Hey man, added a few changes to your code. This should work, I was right about using hasOwnProperty() after all, see comments of the changes
function lookUp(firstName, prop){
// Only change code below this line
 for (var i = 0;i < contacts.length; i++) {
    if (contacts[i].firstName === firstName) {
      if (contacts[i].hasOwnProperty(prop)) { // Using hasOwnProperty to check if the property exists in the the current Object
         return contacts[i][prop]; 
      } else {
            return "No such property";
      }
    } else { // Added else statement
        result = "No such contact";
    } 
  }
  return result; //Should only return if no contact was found after looping through the whole array
}
Andy Bonner
@AbdiViklas
Feb 19 2016 03:29
@Wayne2jm I'll try. Could you post a screenshot?
Manish Giri
@Manish-Giri
Feb 19 2016 03:29
@Wayne2jm your error message is pretty self explanatory isn’t it?

@Wayne2jm
it says

Do not give your form any class or style attributes

and that’s what you have given

<form class="background-color" action="/submit-cat-photo" id="cat-photo-form”>
Wayne2jm
@Wayne2jm
Feb 19 2016 03:31
thanks @Manish-Giri
CamperBot
@camperbot
Feb 19 2016 03:31
wayne2jm sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star: 643 | @manish-giri | http://www.freecodecamp.com/manish-giri
Manish Giri
@Manish-Giri
Feb 19 2016 03:31
@Wayne2jm your form element should have the action attribute, and an id attribute if so mentioned
Wayne2jm
@Wayne2jm
Feb 19 2016 03:31
I deleted the class="background-color" and it workied
worked
Manish Giri
@Manish-Giri
Feb 19 2016 03:32
@Wayne2jm also note that background-color is a css property, you don’t really want to use it as a class name
Wayne2jm
@Wayne2jm
Feb 19 2016 03:32
thank you for your help and that information is kindly noted
Manish Giri
@Manish-Giri
Feb 19 2016 03:33
@Wayne2jm welcome!
cadenas86
@cadenas86
Feb 19 2016 03:33
Make sure you have nested all HTML elements in .container-fluid.
Can some please help me with the code above
I cant figure out how to nest my html in div
lawrencebass
@lawrencebass
Feb 19 2016 03:34
@cadenas86
<div class="container-fluid">

</div>
cadenas86
@cadenas86
Feb 19 2016 03:34
i did that already
@lawrencebass
lawrencebass
@lawrencebass
Feb 19 2016 03:35
Okay what have you gotten so far, can you post your code @cadenas86
cadenas86
@cadenas86
Feb 19 2016 03:37
never mind i figured it out lol i feel stupid It was <div class=container-fluid>Html code </div>
@lawrencebass
i had put my closing tag before my html code nit after
@lawrencebass
lawrencebass
@lawrencebass
Feb 19 2016 03:38
You were able to figure it out though, no need to feel stupid @cadenas86
Stefano Long
@Tefo123
Feb 19 2016 03:41

i need help; what´s wrong with my code:<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

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

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

<div class="container-fluid">
<div class="row">
<div class="col-xs-8">
<h2 class="text-primary text-center">CatPhotoApp</h2>
</div>
<div class="col-xs-4">
<a href="#"><img class="img-responsive thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>
</div>
</div>
<img src="http://bit.ly/fcc-running-cats" class="img-responsive">
<div class="row">
<div class="col-xs-4">
<button class="btn btn-block btn-primary"><i class="fa fa-thumbs-up"></i> Like</button>
</div>
<div class="col-xs-4">
<button class="btn btn-block btn-info"><i class="fa fa-info-circle"></i> Info</button>
</div>
<div class="col-xs-4">
<button class="btn btn-block btn-danger"><i class="fa fa-trash"></i> Delete</button>
</div>
</div>
<p>Things cats <span class="text-danger">love:</span></p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
<div class="row">
<div class="col-xs-6">
<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>
</div>
</div>

lawrencebass
@lawrencebass
Feb 19 2016 03:41
What do the instructions ask for? @Tefo123
cadenas86
@cadenas86
Feb 19 2016 03:42
Thank you for your help @lawrencebass
CamperBot
@camperbot
Feb 19 2016 03:42
cadenas86 sends brownie points to @lawrencebass :sparkles: :thumbsup: :sparkles:
:star: 342 | @lawrencebass | http://www.freecodecamp.com/lawrencebass
lawrencebass
@lawrencebass
Feb 19 2016 03:43
No problem, anytime :smile: @cadenas86
Stefano Long
@Tefo123
Feb 19 2016 03:44
all test are good only these"Nest each of your radio buttons inside its own div with the class col-xs-6.
lawrencebass
@lawrencebass
Feb 19 2016 03:46
What challenge are you working on @Tefo123
Stefano Long
@Tefo123
Feb 19 2016 03:46
Responsively Style Radio Buttons
Leah O'Rourke
@lorourke14
Feb 19 2016 03:47
I need help with my code. I'm on part 23, they're asking me to create a class called smaller-image, but I'm not sure where I would put the code for it in my line of code

This is my code so far:

<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;
}
</style>

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

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

cadenas86
@cadenas86
Feb 19 2016 03:48
<a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a> @lorourke14
create the class inside the after img
@lorourke14
Leah O'Rourke
@lorourke14
Feb 19 2016 03:50
I don't think I'm not that far in yet
Wayne2jm
@Wayne2jm
Feb 19 2016 03:50
@lorourke14 place it in within the style
Leah O'Rourke
@lorourke14
Feb 19 2016 03:50
I only have to make the width 100px
Wayne2jm
@Wayne2jm
Feb 19 2016 03:50
.smaller-image {
width: 100px;
}
lawrencebass
@lawrencebass
Feb 19 2016 03:50
Oh okay, I see, what you need to do is add you radio buttons in here @Tef0123
    <div class= "row">
          <div class="col-xs-6">
                 //Add first radio button
          </div>
          <div class="col-xs-6">
              //Add second radio button
           </div>
    </div>
Leah O'Rourke
@lorourke14
Feb 19 2016 03:51
@Wayne2jm I did that, but it didn't work
This is what my style looks like
<style>
.red-text {
color: red;
}

h2 {
font-family: Lobster, Monospace;
}

p {
font-size: 16px;
font-family: Monospace;
}
.smaller-image {
width: 100px;
}
</style>
Stefano Long
@Tefo123
Feb 19 2016 03:52
a ok, thanks @lawrencebass
CamperBot
@camperbot
Feb 19 2016 03:52
tefo123 sends brownie points to @lawrencebass :sparkles: :thumbsup: :sparkles:
:star: 343 | @lawrencebass | http://www.freecodecamp.com/lawrencebass
lawrencebass
@lawrencebass
Feb 19 2016 03:53
Look again at my previous post @Tefo123
cadenas86
@cadenas86
Feb 19 2016 03:54
@lorourke14 you still have to create the class inside the html code of the img
Leah O'Rourke
@lorourke14
Feb 19 2016 03:54
Oh! I got it
Thanks! I realized I missed an instruction
Wayne2jm
@Wayne2jm
Feb 19 2016 03:54
youre awesome @cadenas86
javalip
@javalip
Feb 19 2016 03:57
Hi, The question I am doing is - "Create an a element that links to http://freecatphotoapp.com and has "cat photos" as its anchor text."
lawrencebass
@lawrencebass
Feb 19 2016 03:57
Sure @javalip what you got so far?
javalip
@javalip
Feb 19 2016 03:58
sorry the question is,
Now nest your existing a element within a new p element (just after the existing h2 element) so that the surrounding paragraph says "View more cat photos", but where only "cat photos" is a link, and the rest of the text is plain text.
Here is my answer-
Michael Aubrey
@mca62511
Feb 19 2016 03:58

I'm trying to learn the very basics of React. Any idea why its not rendering?

http://codepen.io/mca62511/pen/MKdmrB/

javalip
@javalip
Feb 19 2016 03:59
<p> View more
<a href="http://www.freecatphotoapp.com"> cat photos</a>
</p>
It still complains saying "Your p element should have the text "View more " (with a space after it)."
Please help
Kailee Gray
@kaileeagray
Feb 19 2016 04:01
@javalip <p>Click here for <a href="http://www.freecatphotoapp.com">cat photos</a></p>
@javalip try to remove the return
lawrencebass
@lawrencebass
Feb 19 2016 04:01
@javalip Try this
  <p>View more <a href="http://www.freecatphotoapp.com">cat photos</a></p>
Michael Aubrey
@mca62511
Feb 19 2016 04:01
Well, how about a similar example. Here's a different sentence with a link in it.
<p>Please check out <a href="http://michaelcharl.es">my website!</a></p>
We should probably avoid giving direct answers
mine is bad enough
lawrencebass
@lawrencebass
Feb 19 2016 04:03
He already has the answer @mca62511, just has incorrect spacing ^
Michael Aubrey
@mca62511
Feb 19 2016 04:03
ah
javalip
@javalip
Feb 19 2016 04:03
@lawrencebass - Did you mean to put in one line? IF so, I tried, the editor is small so its wrapping to second line
Michael Aubrey
@mca62511
Feb 19 2016 04:04
It doesn't need to be on one line
but there definitely needs t o be a space after the word "more"
lawrencebass
@lawrencebass
Feb 19 2016 04:04
I just did that so you could see that I only add a space after word and removed the one before cat @javalip
Michael Aubrey
@mca62511
Feb 19 2016 04:05
with HTML all the spacing, paragraphs, indenting, etc is basically just to make it more readable for humans.
cadenas86
@cadenas86
Feb 19 2016 04:05
thank you @Wayne2jm i love this place, everyone helping each other out
CamperBot
@camperbot
Feb 19 2016 04:05
cadenas86 sends brownie points to @wayne2jm :sparkles: :thumbsup: :sparkles:
:star: 51 | @wayne2jm | http://www.freecodecamp.com/wayne2jm
javalip
@javalip
Feb 19 2016 04:06
@lawrencebass , @mca62511
<p>View more <a href="http://www.freecatphotoapp.com">cat photos</a></p>
Michael Aubrey
@mca62511
Feb 19 2016 04:06
looks good to me
javalip
@javalip
Feb 19 2016 04:06
Ya it still complains
I will continue without submitting.
lawrencebass
@lawrencebass
Feb 19 2016 04:07
Try changing the link to http://freecatphotoapp.com
Michael Aubrey
@mca62511
Feb 19 2016 04:07
What's the name of the challenge?
I'll go look for it
javalip
@javalip
Feb 19 2016 04:08
@lawrencebass - chaning link didnt work. Thanks
CamperBot
@camperbot
Feb 19 2016 04:08
javalip sends brownie points to @lawrencebass :sparkles: :thumbsup: :sparkles:
:star: 344 | @lawrencebass | http://www.freecodecamp.com/lawrencebass
Michael Aubrey
@mca62511
Feb 19 2016 04:08
@javalip what is the name of the challenge?
javalip
@javalip
Feb 19 2016 04:08
@mca62511 Nest an Anchor Element within a Paragraph
Thats the smae of challenge
name*
lawrencebass
@lawrencebass
Feb 19 2016 04:11
Try refreshing your browser perhaps @javalip
Michael Aubrey
@mca62511
Feb 19 2016 04:11
@javaclip I just tried it with the code you pasted here, and it worked fine
@javaclip My guess is that there's something else wrong in the rest of the code that is raising the error somehow
@javalip Try clicking the "Reset" button on the left, and then paste in the code you just pasted now over the old cat photos link.
OH! I think I know what you did.
@javaclip Do you still have <a href="http://www.freecatphotoapp.com">cat photos</a> in addition to your new <p>View more <a href="http://www.freecatphotoapp.com">cat photos</a></p>?
javalip
@javalip
Feb 19 2016 04:14
@lawrencebass , @mca62511 - I continued and other challenges are gettign submitted. So I assume its not a browser issue?
Michael Aubrey
@mca62511
Feb 19 2016 04:14
@javalip You're supposed to either delete the old one or write the new p tags/sentence around it
javalip
@javalip
Feb 19 2016 04:14
Oh ok
Let me try removing the other one
Michael Aubrey
@mca62511
Feb 19 2016 04:14
@javalip If you add <p>View more <a href="http://www.freecatphotoapp.com">cat photos</a></p> without deleting the old one, it will still throw the error
lawrencebass
@lawrencebass
Feb 19 2016 04:15
Yep ^
javalip
@javalip
Feb 19 2016 04:15
@mca62511 - Yes I removed the other one. IT worked. Thanks
CamperBot
@camperbot
Feb 19 2016 04:15
javalip sends brownie points to @mca62511 :sparkles: :thumbsup: :sparkles:
:star: 335 | @mca62511 | http://www.freecodecamp.com/mca62511
Michael Aubrey
@mca62511
Feb 19 2016 04:16
yay
rejoice and be glad
:dancers:
lawrencebass
@lawrencebass
Feb 19 2016 04:18
What's Japan like?, always wanted to go to Tokyo @mca62511
Michael Aubrey
@mca62511
Feb 19 2016 04:19
@lawrencebass That's a big question: How would you answer. "What's your country like?" I will say that I am enjoying myself. I love the food. And I live very comfortably.
I basically live in the boonies of Japan though. Public transportation is shit (for Japan), but the countryside is gorgeous.
lawrencebass
@lawrencebass
Feb 19 2016 04:21
Yeah I'd like to definitely try the food @mca62511 :smile:
Michael Aubrey
@mca62511
Feb 19 2016 04:22
My girlfriend's dad is a sushi chef, and she hates sushi/sashimi... which means when I visit I sometimes get gobs of sushi that would otherwise be super expensive.
Even the fried stuff here feels healthier, although that might just be in my head.
lawrencebass
@lawrencebass
Feb 19 2016 04:22
That's awesome, sushi is life lol Is it hard to pickup the language @mca62511 ?, I know a few phrases from watching Anime a lot haha
Michael Aubrey
@mca62511
Feb 19 2016 04:24
It just takes a huge time investment, I think that's the hardest part.

Also, it is very easy to find comfortable bubbles of English to live in. At work I teach English, so I use English mostly all day. My girlfriend speaks English. I've got a ton of English speaking friends...

...I know someone who has lived in this country for 10 years and still doesn't speak Japanese beyond greetings and basic phrases.

And so you have to be intentional about forcing yourself into situations where you'll use Japanese.
Or just don't make foreign friends.
Jon Selig
@JonSelig
Feb 19 2016 04:30
@EskimoBurd The text in the headers is wrong
change "left wall" to "#left-well"
Michael Aubrey
@mca62511
Feb 19 2016 04:39
@rohitChoudharyIndia Nice job, simple and effective. Maybe consider rounding the temperature to the nearest tenth or something? Right now it is telling me, "2.420000000000001 C"
Rohit Choudhary
@rohitChoudharyIndia
Feb 19 2016 04:40
thanks @mca62511
CamperBot
@camperbot
Feb 19 2016 04:40
rohitchoudharyindia sends brownie points to @mca62511 :sparkles: :thumbsup: :sparkles:
:star: 336 | @mca62511 | http://www.freecodecamp.com/mca62511
Matt Burd
@EskimoBurd
Feb 19 2016 04:44
Jon Selig
@JonSelig
Feb 19 2016 04:45
@EskimoBurd You forgot the # in front of both header texts
Matt Burd
@EskimoBurd
Feb 19 2016 04:46
Ok thought it was only needed inside of the class element ty ty
Sarah
@gingersnapp
Feb 19 2016 05:03
can someone review my JSON API code and offer some edits? this is for the quote machine
 $(document).ready(function() {

   $('#thebutton').on('click', function() {
     $.getJSON("http://quotesondesign.com/api/3.0/api-3.0.json", function(JSON) {
  alert(JSON);
     $('.messageSpot').html(JSON.stringify(json));
     });
   });
 });
Pawan
@pawan92
Feb 19 2016 05:06
i need same help ^^^
Andre Alonzo
@paycoguy
Feb 19 2016 05:08
@gingersnapp what issue are you having with the code?
Sam
@SamOBry
Feb 19 2016 05:08
can someone help me with target elements by class using jquery
Cristián Berríos
@crisberrios
Feb 19 2016 05:13
$('.yourClass')
that's pretty much it
Sam
@SamOBry
Feb 19 2016 05:29

@crisberrios

```

MohitSha
@MohitSha
Feb 19 2016 05:34
Hi there

<style>
.red-text {
color: red;
}
p {
font-size: 16px;
}
</style>

<h2 class="red-text">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>

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

Do not add a class attribute to your new p element.
Last line as an error- don't let me in further
Please help
?
Pradeep CE
@cepradeep
Feb 19 2016 05:42
Does anyone want to pair-program DNA Pairing? http://www.freecodecamp.com/challenges/dna-pairing
Franco Zapata
@Francozt01
Feb 19 2016 05:42
@MohitSha it looks fine refresh ur browser
Brian
@sludge256
Feb 19 2016 05:43
put red-text back into the first p element if it's not working
Franco Zapata
@Francozt01
Feb 19 2016 05:43
@MohitSha u first p element should be red with class="red-text" as ur h2
Gustavo Chávez
@gchavez2
Feb 19 2016 06:08
@colvint hi! Yes awesome guy, captcha was part of his phd, after listening to open problems form a yahoo engineer. Then captcha turn into duolingo for human-powered translation. To cure diseases is new to me... will read about that. Thanks for taking a look!
CamperBot
@camperbot
Feb 19 2016 06:08
gchavez2 sends brownie points to @colvint :sparkles: :thumbsup: :sparkles:
:star: 62 | @colvint | http://www.freecodecamp.com/colvint
Thomas Noe
@t3h2mas
Feb 19 2016 06:09
What level do you have to get on duolingo to do the translating
Gustavo Chávez
@gchavez2
Feb 19 2016 06:10
since the very beginning... there will be something like... "do you want to practice bit translating this"?
@t3h2mas since the very beginning... there will be something like... "do you want to practice bit translating this"?
Thomas Noe
@t3h2mas
Feb 19 2016 06:11
Haven't seen it on the app. Is it website specific
Don Price
@KingHippo
Feb 19 2016 06:18
Anyone care to critique my solution for Sum All Numbers in a Range?
function sumAll(arr) {

  var array = [];

  for (var i = 0; i < arr.length; i++) {
      array.push(arr[i]);
  }
  var max = Math.max(...array);
  var min = Math.min(...array);
  var total = 0;

  while(min <= max) {
    total += min;
    min++;
  }
  return total;
}

sumAll([1,4]);
Thomas Noe
@t3h2mas
Feb 19 2016 06:19
whoa does ...array unpack it?
budimanfix
@budimanfix
Feb 19 2016 06:19
@lawrencebass Thank you
Thomas Noe
@t3h2mas
Feb 19 2016 06:20
@KingHippo consider using reduce
Liat Zavodivker
@taildovaz
Feb 19 2016 06:20
Struggling with create bulleted unordered list
Thomas Noe
@t3h2mas
Feb 19 2016 06:20
instead of your while loop
@taildovaz code?
Don Price
@KingHippo
Feb 19 2016 06:20
@t3h2mas I'll give that a look. Thanks!
CamperBot
@camperbot
Feb 19 2016 06:20
kinghippo sends brownie points to @t3h2mas :sparkles: :thumbsup: :sparkles:
:star: 145 | @t3h2mas | http://www.freecodecamp.com/t3h2mas
Liat Zavodivker
@taildovaz
Feb 19 2016 06:20

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

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

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

<a href="#"><img class="smaller-image thick-green-border" alt="A cute orange cat lying on its back" src="https://bit.ly/fcc-relaxing-cat"></a>

<u1>
<li>string</li>
<li>naps</li>
<li>purring</li>
</u1>

I am new so this is probably not the right way to do this
Thomas Noe
@t3h2mas
Feb 19 2016 06:21
@taildovaz answer me this: what would u1 stand for
Liat Zavodivker
@taildovaz
Feb 19 2016 06:24
@t3h2mas okay I think I figured it out!
Thomas Noe
@t3h2mas
Feb 19 2016 06:24
:thumbsup:
budimanfix
@budimanfix
Feb 19 2016 06:27
@lawrencebass Thank you so much Men :+1:
CamperBot
@camperbot
Feb 19 2016 06:27
budimanfix sends brownie points to @lawrencebass :sparkles: :thumbsup: :sparkles:
:star: 345 | @lawrencebass | http://www.freecodecamp.com/lawrencebass
zhouxh
@zhouxh
Feb 19 2016 06:39
function convert(num) {
 var arr =String(num).split('');
 var re = "";
 console.log(arr);
 if(arr.length>0){
    var g = arr.splice(arr.length-1);
    switch(Number(g)){
      case 1:
        re = 'I';
        break;
      case 2:
        re = 'II';
        break;
      case 3:
        re = 'III';
        break;
      case 4:
        re = 'IV';
        break;
      case 5:
        re = 'V';
        break;
      case 6:
        re = 'VI';
        break;
      case 7:
        re = 'VII';
        break;
      case 8:
        re = 'VIII';
        break;
      case 9:
        re = 'IX';
        break;
    }
 }
 if(arr.length>0){
    var s = arr.splice(arr.length-1);
    switch(Number(s)){
      case 1:
        re = 'X'+re;
        break;
      case 2:
        re = 'XX'+re;
        break;
      case 3:
        re = 'XXX'+re;
        break;
      case 4:
        re = 'XL'+re;
        break;
      case 5:
        re = 'L'+ re;
        break;
      case 6:
        re = 'LX'+re;
        break;
      case 7:
        re = 'LXX'+re;
        break;
      case 8:
        re = 'LXXX'+re;
        break;
      case 9:
        re = 'XC'+re;
        break;
    }
 }
 if(arr.length>0){
    var b = arr.splice(arr.length-1);
    switch(Number(b)){
      case 1:
        re = 'C'+re;
        break;
      case 2:
        re = 'CC'+re;
        break;
      case 3:
        re = 'CCC'+re;
        break;
      case 4:
        re = 'CD'+re;
        break;
      case 5:
        re = 'D'+ re;
        break;
      case 6:
        re = 'DC'+re;
        break;
      case 7:
        re = 'DCC'+re;
        break;
      case 8:
        re = 'DCCC'+re;
        break;
      case 9:
        re = 'CM'+re;
        break;
    }
 }
 if(arr.length>0){
    var q = arr.splice(0);
    if(Number(q)>0){
        for (var i=0;i<Number(q) ;i++)
        {
            re ='M'+re;
        }
    }
 }

 return re;

}

convert(36);
this is for "Roman Numeral Converter"
are there other simple way?
idietmoran
@idietmoran
Feb 19 2016 06:57
@zhouxh make an object
for exampe
var num = { 
    ' i': 1,
    'ii': 2,
   'iii': 3
}
zhouxh
@zhouxh
Feb 19 2016 06:58
thanks @idietmoran
CamperBot
@camperbot
Feb 19 2016 06:58
zhouxh sends brownie points to @idietmoran :sparkles: :thumbsup: :sparkles:
:star: 304 | @idietmoran | http://www.freecodecamp.com/idietmoran
Iamdray
@Iamdray
Feb 19 2016 07:09
Hello FCC!
Dennis Squire
@LunaWolf00
Feb 19 2016 07:10
Hi there I'm just starting out with coding
Iamdray
@Iamdray
Feb 19 2016 07:10
Welcome to FCC @LunaWolf00 Nice to have you here.
vijaytadimeti
@vijaytadimeti
Feb 19 2016 07:10
welcome to coding then!
Iamdray
@Iamdray
Feb 19 2016 07:11
I've also been on a couple sites but i've decided to stick to FCC since yesterday and i started from scratch.
Dennis Squire
@LunaWolf00
Feb 19 2016 07:12
Thanks, I'm having trouble with the first challenge and could use some help if anyone has time for some quick questions
Iamdray
@Iamdray
Feb 19 2016 07:12
I can't say i'll always be here but what do you need?
Dennis Squire
@LunaWolf00
Feb 19 2016 07:13
Trying to uncomment a code
vijaytadimeti
@vijaytadimeti
Feb 19 2016 07:13
<!-- --> include them with your code
to uncomment
sorry ,to comment
Iamdray
@Iamdray
Feb 19 2016 07:14
Remove them to uncomment too.
Dennis Squire
@LunaWolf00
Feb 19 2016 07:14

<h1>Hello World</h1>
<!--CatPhotoApp-->

<h2>CatPhotoApp</h2>
<!--Hello Paragraph-->

<p>Hello Paragraph</p>
-->

So would
Iamdray
@Iamdray
Feb 19 2016 07:15
Remove the <!-- and --> at the beginning of the CatPhotoApp and at the end of Hello Paragraph
vijaytadimeti
@vijaytadimeti
Feb 19 2016 07:15
remove the <!-- and --> to uncomment
Dennis Squire
@LunaWolf00
Feb 19 2016 07:15
k ill try it
Iamdray
@Iamdray
Feb 19 2016 07:16
ok. Let's know if you've got it.
David Enos
@bluedangerforyou
Feb 19 2016 07:17
guys im stuck here, javascript word blanks

function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
var result = "";
// Your code below this line

result = (myNoun + "slowly", myAdjective + "hit", myVerb + "ran", myAdverb + "slowly");
// Your code above this line
return result;
}

// Change the words here to test your function
wordBlanks("dog", "big", "ran", "quickly");

am I missing something?
i am also tried removing the () from result =
Iamdray
@Iamdray
Feb 19 2016 07:18
uh.. I haven't gone into Js yet. Sorry.
David Enos
@bluedangerforyou
Feb 19 2016 07:19
@Iamdray no worries
Coy Sanders
@coymeetsworld
Feb 19 2016 07:19
@bluedangerforyou on result = line, don't use commas, use + operator
Vidyuth Dandu
@vidyuthd
Feb 19 2016 07:19
@bluedangerforyou the result will evaluate to the last expression and the last expression is myAdverb + "slowly"
remove the commas
David Enos
@bluedangerforyou
Feb 19 2016 07:20
@coymeetsworld @vidyuthd thanks, but why? What do the commas do?
CamperBot
@camperbot
Feb 19 2016 07:20
bluedangerforyou sends brownie points to @coymeetsworld and @vidyuthd :sparkles: :thumbsup: :sparkles:
:star: 275 | @coymeetsworld | http://www.freecodecamp.com/coymeetsworld
:star: 5 | @vidyuthd | http://www.freecodecamp.com/vidyuthd
Coy Sanders
@coymeetsworld
Feb 19 2016 07:20
yeah, + is the concatenate operator, commas are used for separating arguments in something like a function
Dennis Squire
@LunaWolf00
Feb 19 2016 07:20
lol Still a little lost on my end
Coy Sanders
@coymeetsworld
Feb 19 2016 07:21
you're also missing spaces in the strings but you'll see that when you fix it
like you should have myNoun + " slowly " + myAdjective ....etc
Vidyuth Dandu
@vidyuthd
Feb 19 2016 07:21
yep, but since you want to concantate the entire word . '+' is the operator for you
',' operator is used in a javascript statement , not in expression. expression is evluated like 1+2
David Enos
@bluedangerforyou
Feb 19 2016 07:22
oh so I am trying in the entire words
Coy Sanders
@coymeetsworld
Feb 19 2016 07:23
you also dont need the parenthesis either
David Enos
@bluedangerforyou
Feb 19 2016 07:24
do I remove the ()
Coy Sanders
@coymeetsworld
Feb 19 2016 07:25
yeah, you don't need them, i think it may still work with them but no reason for it to be in there
usually use parenthesis either for specifying a function, or doing math (order of operations stuff)
David Enos
@bluedangerforyou
Feb 19 2016 07:27
@coymeetsworld thanks makes since
CamperBot
@camperbot
Feb 19 2016 07:27
bluedangerforyou sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:warning: bluedangerforyou already gave coymeetsworld points
Dennis Squire
@LunaWolf00
Feb 19 2016 07:29
Still having trouble uncommenting
any help?
Coy Sanders
@coymeetsworld
Feb 19 2016 07:30
whats the issue?
Dennis Squire
@LunaWolf00
Feb 19 2016 07:31
I was able to make everything visible but it say delete all the trailing -->

<h1>Hello World</h1>

<h2>CatPhotoApp</h2>

<p>Hello Paragraph</p>
-->

X^2 = X
@m-cullen
Feb 19 2016 07:32
Hi guys, algorithm question, that ok?
David Enos
@bluedangerforyou
Feb 19 2016 07:32
here is my code now

function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
var result = "";
// Your code below this line

result = myNoun + "slowly " myAdjective + "hit " myVerb + "ran " myAdverb + "slowly "
// Your code above this line
return result;
}

// Change the words here to test your function
wordBlanks("dog", "big", "ran", "quickly");

Coy Sanders
@coymeetsworld
Feb 19 2016 07:32
@LunaWolf00 you still have a --> at the end of your code snippet, remove that
David Enos
@bluedangerforyou
Feb 19 2016 07:33
but it says expected assigment call or function or function call
Coy Sanders
@coymeetsworld
Feb 19 2016 07:33
@bluedangerforyou you need to add a semicolon at the end of result = statement
Vidyuth Dandu
@vidyuthd
Feb 19 2016 07:33
@LunaWolf00 for adding comments in html, it should be <!-- tag> commented text <--!>
for ex : <!--p> commented out p <--!>
David Enos
@bluedangerforyou
Feb 19 2016 07:33
i did
receiving error still
Coy Sanders
@coymeetsworld
Feb 19 2016 07:33
oh youre missing more + operators
it needs to go between each item, whether its a "string" or a variable
David Enos
@bluedangerforyou
Feb 19 2016 07:34
at the bottom?
Coy Sanders
@coymeetsworld
Feb 19 2016 07:34
so where it says "slowly" myAdjective
there needs to be a plus between those
David Enos
@bluedangerforyou
Feb 19 2016 07:34
oh
Vidyuth Dandu
@vidyuthd
Feb 19 2016 07:34
@bluedangerforyou you missed the "+" operator
David Enos
@bluedangerforyou
Feb 19 2016 07:34
i feel so dumb haha
Vidyuth Dandu
@vidyuthd
Feb 19 2016 07:34
result = myNoun + "slowly " myAdjective + "hit " myVerb + "ran " myAdverb + "slowly "
Coy Sanders
@coymeetsworld
Feb 19 2016 07:34
so basicallly you are saying I am concatenating the word slowly to the variable myAdjective
to make it one string
and you're assigning that to the variable myResult
Vidyuth Dandu
@vidyuthd
Feb 19 2016 07:38
@LunaWolf00 also if you want to remove comments you gotta remove both <!-- and -->
David Enos
@bluedangerforyou
Feb 19 2016 07:38
so am I suppose to create a new varible? The question is so vague in this exercise
Coy Sanders
@coymeetsworld
Feb 19 2016 07:38
no you're fine
you just have a syntax error that's all
fix the result= line and you should be fine
David Enos
@bluedangerforyou
Feb 19 2016 07:40
myResult =
Coy Sanders
@coymeetsworld
Feb 19 2016 07:40
yeah that line
basically everytime you use the concatenate operator (+) on two strings, you're saying you want to join them together into one
X^2 = X
@m-cullen
Feb 19 2016 07:43

In the Chrome console I get the correct output for 4 of the 5 tests.
https://jsfiddle.net/Lm7zpb7b/2/

But on the fCC challenge page I only get 2 of the 5 tests correct:
http://www.freecodecamp.com/challenges/arguments-optional

So, 2 things here:
1) Why do I get the right result in my console, but not on the fCC challenge?
and
2) What am I doing wrong for test 5, because I get that wrong in both places?
add(2)([3]) should return undefined

Any help is appreciated! Please help! :)

CamperBot
@camperbot
Feb 19 2016 07:43
:bulb: to format code use backticks! ``` more info
David Enos
@bluedangerforyou
Feb 19 2016 07:46
man, still no go
been stuck on this one for a day haha
X^2 = X
@m-cullen
Feb 19 2016 07:48
@bluedangerforyou arguments-optional? or you talking to someone else?
David Enos
@bluedangerforyou
Feb 19 2016 07:49
@m-cullen havent learned functions
yet
this is just concat strings exercise but i am missing something
X^2 = X
@m-cullen
Feb 19 2016 07:49
which exercise is it? can you send the link please?
word blanks in js
Vidyuth Dandu
@vidyuthd
Feb 19 2016 07:50
@m-cullen for add(2,[3])
2+[3] = 23
"23" actually
X^2 = X
@m-cullen
Feb 19 2016 07:51
@vidyuthd yes, that's the output I'm getting
Vidyuth Dandu
@vidyuthd
Feb 19 2016 07:51
since javascripts does to string on array,
Sam
@SamOBry
Feb 19 2016 07:51
anyone up?
X^2 = X
@m-cullen
Feb 19 2016 07:52
@vidyuthd I run a typeof check on the argument ...
@vidyuthd typeof arguments[0] !== 'number'
Vidyuth Dandu
@vidyuthd
Feb 19 2016 07:52
because array is not a data type in js
X^2 = X
@m-cullen
Feb 19 2016 07:52
but [3] seems to be ignored
or accepted as a number ...
suggested work-around?
Timofey Votyakov
@tvotyakov
Feb 19 2016 07:53
@m-cullen you should return special value undefined not a string "undefined"
X^2 = X
@m-cullen
Feb 19 2016 07:54
@tvotyakov sounds good
Alexander Køpke
@alexanderkopke
Feb 19 2016 07:54
@bluedangerforyou try setting result equal to just the variables. With plusses in between. result = myNoun + myAdjective + etc
Timofey Votyakov
@tvotyakov
Feb 19 2016 07:56
@m-cullen 5th test is not passing, because on first step you return a function, and you don't test a parameter type in this function.
X^2 = X
@m-cullen
Feb 19 2016 07:58
@tvotyakov I think you're on to something ;)
checking that out now
@bluedangerforyou check messages mate :)
Timofey Votyakov
@tvotyakov
Feb 19 2016 07:58
@m-cullen in your case add(2)([3]) works like this
var x = add(2); // x now a function(y) {return 2 + y};
x([3]); // will call function([3]) {return 2 + [3];}
Coy Sanders
@coymeetsworld
Feb 19 2016 07:59
@bluedangerforyou you're putting what should be variables as hard-coded strings
i.e cat shouldn't be there
when you run wordBlanks("cat", "little", "hit", "slowly"), myNoun will equal "cat"
Heidi Gay
@heidigay
Feb 19 2016 08:01
hi guys i'm stuck on the profile lookup challenge. can someone give me a clue?
Capture d’écran 2016-02-19 à 15.00.11.jpg
Coy Sanders
@coymeetsworld
Feb 19 2016 08:01
when you run wordBlanks("dog", "big", "ran", "quickly", myNoun will equal "dog"
Dennis Squire
@LunaWolf00
Feb 19 2016 08:01
thanks everyone im getting it
Coy Sanders
@coymeetsworld
Feb 19 2016 08:02
@heidigay did you define i and j?
Heidi Gay
@heidigay
Feb 19 2016 08:02
yes
(not shown)
Coy Sanders
@coymeetsworld
Feb 19 2016 08:03
you have var i; and var j; above that code snippet? It may be better to just define the variable in the for loop
i.e. for (var i =0; i < contacts.length; i++)
Heidi Gay
@heidigay
Feb 19 2016 08:03
@coymeetsworld ok, just did that. still no change in the red 'x's.
Coy Sanders
@coymeetsworld
Feb 19 2016 08:04
oh wait I remember this
X^2 = X
@m-cullen
Feb 19 2016 08:04

@tvotyakov I see you can pass arguments to a function in two ways in JS, i.e ->
1st way:
add(2,3);
2nd way:
add(2)(3);

Is that always the case? For all functions? I've not used the second way before ...

Coy Sanders
@coymeetsworld
Feb 19 2016 08:04
its not a 2 dimensional array @heidigay
vipinaswal
@vipinaswal
Feb 19 2016 08:06
This message was deleted
why .target class is not applying
Coy Sanders
@coymeetsworld
Feb 19 2016 08:07
its JSON
Thomas Noe
@t3h2mas
Feb 19 2016 08:07
This code works when I test it locally, but is failing tests w/ little output. Any feedback??
function where(collection, source) {
  var arr = [];
  var keys = Object.keys(source);
  collection.map(function(obj) {
    for (var i=0; i < keys.length; i++) {
      if (obj.hasOwnProperty(keys[i]) && obj[ keys[i] ] === source[keys[i]])
        if (arr.indexOf(obj) === -1)
          arr.push(obj);
    }
  });

  return arr;
}
Coy Sanders
@coymeetsworld
Feb 19 2016 08:08
try looking into the hasOwnProperty() function
@heidigay
Timofey Votyakov
@tvotyakov
Feb 19 2016 08:08
@m-cullen no. there is no a "2nd way". It works only in this case, because you return a function if you have only one argument.
Thomas Noe
@t3h2mas
Feb 19 2016 08:09
Oop. There's nothing making sure the object has all keys.
Heidi Gay
@heidigay
Feb 19 2016 08:10
@coymeetsworld ok thanks
CamperBot
@camperbot
Feb 19 2016 08:10
heidigay sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:star: 276 | @coymeetsworld | http://www.freecodecamp.com/coymeetsworld
i2gor87
@i2gor87
Feb 19 2016 08:11
Hello everyone
I have some problems with my code (I’m stupid, I know that)
Could someone help me?
vipinaswal
@vipinaswal
Feb 19 2016 08:11
I am new to free codecamp and gitter . How to add screenshot in the chat? any help.
i2gor87
@i2gor87
Feb 19 2016 08:11

function queue(arr, item) {
// Your code here
arr = arr.push(item);
arr.shift();
return item; // Change this line
}

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

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

Heidi Gay
@heidigay
Feb 19 2016 08:12
@vipinaswal i just dragged and dropped the screenshot
i2gor87
@i2gor87
Feb 19 2016 08:12
function queue(arr, item) {
  // Your code here
  arr = arr.push(item);
  arr.shift();
  return item;  // Change this line
}

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

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(queue(testArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));
That’s better. So I have to add ‘item’ to array and then remove the first element of array. What am I doing wrong?
Coy Sanders
@coymeetsworld
Feb 19 2016 08:13
@i2gor87 you're returning back the item you're trying to add to the array
Timofey Votyakov
@tvotyakov
Feb 19 2016 08:13
@vipinaswal I think you need to use ![alt](http://) construction
Coy Sanders
@coymeetsworld
Feb 19 2016 08:13
but you're supposed to remove the first element of the array and return that value instead
X^2 = X
@m-cullen
Feb 19 2016 08:14
Many thanks @tvotyakov closures are very cool
CamperBot
@camperbot
Feb 19 2016 08:14
m-cullen sends brownie points to @tvotyakov :sparkles: :thumbsup: :sparkles:
CamperBot
@camperbot
Feb 19 2016 08:14
:star: 114 | @tvotyakov | http://www.freecodecamp.com/tvotyakov
Caleb Martin
@caleb272
Feb 19 2016 08:14
dam @tvotyakov are you allways on
X^2 = X
@m-cullen
Feb 19 2016 08:14
@tvotyakov solved. although .... you said:
i2gor87
@i2gor87
Feb 19 2016 08:14
@coymeetsworld ah, so I supposed to write ‘return arr’, right?
Coy Sanders
@coymeetsworld
Feb 19 2016 08:14
well not the array, but the item you just removed from the array
Caleb Martin
@caleb272
Feb 19 2016 08:14
ya its return arr. shift();
i just completed that level
Coy Sanders
@coymeetsworld
Feb 19 2016 08:15
i didn't want to give it away @caleb272 wanted him to figure it out :)
Manan Kalra
@manankalra
Feb 19 2016 08:15
function titleCase(str) {
  var array = str.split(" ");
  var random = [];
  var randomUpper = [];
  for(var i=0;i<array.length;i++){
    random.push(array[i].split(""));
  }
  for(var j=0;j<random.length;j++){
    random[j][0].toUpperCase();
  }
  return random;
}

titleCase("abcd efgh ijkl");
Can anyone tell me why my second for loop which capitalizes the first char of every string isn't working?
i2gor87
@i2gor87
Feb 19 2016 08:15
@coymeetsworld oh, my GOD… What’s wrong with me…. I haven’t read that the output should be the element to be removed =(
@caleb272 thank you)
CamperBot
@camperbot
Feb 19 2016 08:15
i2gor87 sends brownie points to @caleb272 :sparkles: :thumbsup: :sparkles:
:star: 191 | @caleb272 | http://www.freecodecamp.com/caleb272
i2gor87
@i2gor87
Feb 19 2016 08:15
@coymeetsworld and thank you as well for letting me figure that out)))
CamperBot
@camperbot
Feb 19 2016 08:15
i2gor87 sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:star: 277 | @coymeetsworld | http://www.freecodecamp.com/coymeetsworld
Coy Sanders
@coymeetsworld
Feb 19 2016 08:16
but yeah thats what you do, arr.shift() removes the first item from the array and it also returns that item.
vipinaswal
@vipinaswal
Feb 19 2016 08:18
<div class="container-fluid">
<h3 class="text-primary text-center">jQuery Playground</h3>
<div class="row">
<div class="col-xs-6">
<div class="well">
<button class="btn btn-default target"></button>
<button class="btn btn-default target"></button>
<button class="btn btn-default target"></button>
</div>
</div>
<div class="col-xs-6">
<div class="well">
<button class="btn btn-default target"></button>
<button class="btn btn-default target"></button>
<button class="btn btn-default target"></button>
</div>
</div>
</div>
</div>
Manan Kalra
@manankalra
Feb 19 2016 08:18
@coymeetsworld some help?
i2gor87
@i2gor87
Feb 19 2016 08:18

@coymeetsworld well, now the console returning this: function queue(arr, item) {
// Your code here
arr = arr.push(item);
arr.shift();
return item; // Change this line
}

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

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

Sam
@SamOBry
Feb 19 2016 08:18
i need help
i2gor87
@i2gor87
Feb 19 2016 08:18
@coymeetsworld I mean it returns that arr.shift() is not a function
X^2 = X
@m-cullen
Feb 19 2016 08:19
@tvotyakov
can I ask, you said:
" It works only in this case, because you return a function if you have only one argument."
So do you mean if I pass:
add(3)(2);
this would first pass argument '3' to the function, then the returned function would be passed the argument '2' ?
  1. add(3); // returns function(y) {if (typeof y !== 'number') {return undefined; } else {return 3 + y;}
  2. add(2); // adds 2 + 3, using the new function .... ?
    ?
Coy Sanders
@coymeetsworld
Feb 19 2016 08:19
@manaKalra is your first for loop right? The 2nd split you're running? doesn't look right
Vidyuth Dandu
@vidyuthd
Feb 19 2016 08:19
@mananKalra the second loop is working but you are not doing assign operation, you are just performing random[j][0].toUpperCase();
Sam
@SamOBry
Feb 19 2016 08:19
<script>
  $(document).ready(function() {
$("button").addClass("animated");
 $(".btn").addClass("shake");
    $("#target1").addClass("animated, shake, btn-primary");
  });
</script>
what did i do wrong? i have to target the same element with multiple jquery selectors
Vidyuth Dandu
@vidyuthd
Feb 19 2016 08:20
so the values in random are not changing
Coy Sanders
@coymeetsworld
Feb 19 2016 08:20
what does your code look like now @i2gor87
?
Timofey Votyakov
@tvotyakov
Feb 19 2016 08:20
@m-cullen yes, you are right.
i2gor87
@i2gor87
Feb 19 2016 08:20
@coymeetsworld ```
vipinaswal
@vipinaswal
Feb 19 2016 08:20
@tvotyakov i am still not getting it
i2gor87
@i2gor87
Feb 19 2016 08:21
function queue(arr, item) {
  // Your code here
  arr = arr.push(item);
  var s = arr.shift();
  return s;
X^2 = X
@m-cullen
Feb 19 2016 08:21
@tvotyakov legend. thanks!
CamperBot
@camperbot
Feb 19 2016 08:21
m-cullen sends brownie points to @tvotyakov :sparkles: :thumbsup: :sparkles:
:warning: m-cullen already gave tvotyakov points
Caleb Martin
@caleb272
Feb 19 2016 08:21
^ you dont need to define it
vipinaswal
@vipinaswal
Feb 19 2016 08:21
@SamOBry how did you add code screenshot in the chat
Caleb Martin
@caleb272
Feb 19 2016 08:21
you can just return the arr. shift();
Coy Sanders
@coymeetsworld
Feb 19 2016 08:21
yeah but that's not the issue here
Caleb Martin
@caleb272
Feb 19 2016 08:22
ya i know
i2gor87
@i2gor87
Feb 19 2016 08:22
@caleb272 yes, I’ve done that as well
Coy Sanders
@coymeetsworld
Feb 19 2016 08:22
did you close out the queue function with the bracket?
Caleb Martin
@caleb272
Feb 19 2016 08:22
i was just letting him know
i2gor87
@i2gor87
Feb 19 2016 08:22
function queue(arr, item) {
  // Your code here
  arr = arr.push(item);

  return arr.shift();
Manan Kalra
@manankalra
Feb 19 2016 08:22
@coymeetsworld Yeah, first for loop is p=working perfectly
Sam
@SamOBry
Feb 19 2016 08:22
type ``` outside your code on a serperate line @vipinaswal
Caleb Martin
@caleb272
Feb 19 2016 08:22
^ then you arent creating a useless variable
i2gor87
@i2gor87
Feb 19 2016 08:22
But the point is that both methods doesn’t work
Sam
@SamOBry
Feb 19 2016 08:22
the begginning and end of your code
vipinaswal
@vipinaswal
Feb 19 2016 08:23
<div class="container-fluid">
<h3 class="text-primary text-center">jQuery Playground</h3>
<div class="row">
<div class="col-xs-6">
<div class="well">
``` <button class="btn btn-default target"></button>
<button class="btn btn-default target"></button>
<button class="btn btn-default target"></button>
</div>
</div>
<div class="col-xs-6">
<div class="well">
<button class="btn btn-default target"></button>
<button class="btn btn-default target"></button>
<button class="btn btn-default target"></button>
</div>
</div>
</div>
</div>
<div class="container-fluid">
<h3 class="text-primary text-center">jQuery Playground</h3>
<div class="row">
<div class="col-xs-6">
<div class="well">
<button class="btn btn-default target"></button>
        <button class="btn btn-default target"></button>
        <button class="btn btn-default target"></button>
      </div>
    </div>
    <div class="col-xs-6">
      <div class="well">
        <button class="btn btn-default target"></button>
        <button class="btn btn-default target"></button>
        <button class="btn btn-default target"></button>
      </div>
    </div>
  </div>
</div>
Timofey Votyakov
@tvotyakov
Feb 19 2016 08:23

@vipinaswal if you are talking about something like this

var f = function(x) {
  return x;
}

it is not a screenshot. It is formatted code.

i2gor87
@i2gor87
Feb 19 2016 08:23
@vipinaswal switch to compose mode first - on mac its commmand + /
Sam
@SamOBry
Feb 19 2016 08:24
vip paste your code but press shift enter on the top and make sure the ``` are on serperate lines @vipinaswal
from the code
beggining and end
Manan Kalra
@manankalra
Feb 19 2016 08:25
@vidyuthd When I push those second for loop values to randomUpper array and return the same array, only the capitalized values i.e. ["A", "E", "I"] are returned.
vipinaswal
@vipinaswal
Feb 19 2016 08:25
@tvotyakov @SamOBry @i2gor87 thanks!! i get it now !!
CamperBot
@camperbot
Feb 19 2016 08:25
vipinaswal sends brownie points to @tvotyakov and @samobry and @i2gor87 :sparkles: :thumbsup: :sparkles:
:star: 154 | @samobry | http://www.freecodecamp.com/samobry
:star: 187 | @i2gor87 | http://www.freecodecamp.com/i2gor87
:star: 115 | @tvotyakov | http://www.freecodecamp.com/tvotyakov
Manan Kalra
@manankalra
Feb 19 2016 08:27
@vidyuthd The result I want is [["A", b", "c", "d"], [....], [....]]
vipinaswal
@vipinaswal
Feb 19 2016 08:27
<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">
    <div class="col-xs-6">
      <div class="well">
        <button class="btn btn-default target"></button>
        <button class="btn btn-default target"></button>
        <button class="btn btn-default target"></button>
      </div>
    </div>
    <div class="col-xs-6">
      <div class="well">
        <button class="btn btn-default target"></button>
        <button class="btn btn-default target"></button>
        <button class="btn btn-default target"></button>
      </div>
    </div>
  </div>
</div>
why class target is not adding to button element ?
@tvotyakov
i2gor87
@i2gor87
Feb 19 2016 08:27

@caleb272 @coymeetsworld well I finally realised what the problem is. Too bad I have slight difficulties with understanding English =)

function queue(arr, item) {
  // Your code here
  arr.push(item);

  return arr.shift([0]);

That’s what the code should be - somehow it just needs me to define which element of array I have to shift

Coy Sanders
@coymeetsworld
Feb 19 2016 08:27
the toUpperCase() function doesn't modify the original string
Timofey Votyakov
@tvotyakov
Feb 19 2016 08:28
@vipinaswal why do you think it is not adding?
vipinaswal
@vipinaswal
Feb 19 2016 08:28
@tvotyakov test is not running on the site
Manan Kalra
@manankalra
Feb 19 2016 08:28
@coymeetsworld fixed it! thanks anyway.
CamperBot
@camperbot
Feb 19 2016 08:28
manankalra sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:star: 278 | @coymeetsworld | http://www.freecodecamp.com/coymeetsworld
Coy Sanders
@coymeetsworld
Feb 19 2016 08:29
strange @i2gor87 you shouldn't need to specify that
np @mananKalra good job
if you remove the [0] does it not work?
i2gor87
@i2gor87
Feb 19 2016 08:30
@coymeetsworld yes, the output in console log is “The arr.shift() function is undefined"
Timofey Votyakov
@tvotyakov
Feb 19 2016 08:30
@vipinaswal what do you expect a target class should do?
Manan Kalra
@manankalra
Feb 19 2016 08:31

@coymeetsworld
Everything was fine.
I just forgot to assign it to random[j][0].

random[j][0] = random[j][0].toUpperCase();

vipinaswal
@vipinaswal
Feb 19 2016 08:31
@tvotyakov it's now working !!
thanks !
CamperBot
@camperbot
Feb 19 2016 08:31
vipinaswal sends brownie points to @tvotyakov :sparkles: :thumbsup: :sparkles:
:warning: vipinaswal already gave tvotyakov points
Timofey Votyakov
@tvotyakov
Feb 19 2016 08:32
@vipinaswal you're welcome :smile:
Coy Sanders
@coymeetsworld
Feb 19 2016 08:32
oh ok yeah that's what I was saying @mananKalra, the toUpperCase() function doesn't modify the original string
so you need to reassign that value as you did there gj
@i2gor87 hmm strange, and you're passing an array to that function?
Manan Kalra
@manankalra
Feb 19 2016 08:33
Yeah, silly mistake! :D @coymeetsworld
i2gor87
@i2gor87
Feb 19 2016 08:34
@coymeetsworld I’m just defining the number of the element for arr.shift to remove. It was kinda strange since in last 3-4 steps I was doing just fine without defining
Coy Sanders
@coymeetsworld
Feb 19 2016 08:35
yeah that's why I'm surprised, arr.shift removes the first item, that's its definition
so you shouldn't need to specify an index, I'm missing something here but whatever I guess if it works lol
i2gor87
@i2gor87
Feb 19 2016 08:36
@coymeetsworld yeah =) thanks anyway for your help 0)
CamperBot
@camperbot
Feb 19 2016 08:36
i2gor87 sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:warning: i2gor87 already gave coymeetsworld points
Coy Sanders
@coymeetsworld
Feb 19 2016 08:36
yeah np
Mohamed
@mohamed-avatarinweb
Feb 19 2016 08:39
Guys I want to share my CV to see any mistakes, anybody have experience
Is there someone who has experience?
Yaroslav
@YVeselovskyi
Feb 19 2016 08:40
hello) Does someone know how to work with drupal ?)
Caleb Martin
@caleb272
Feb 19 2016 08:41
nope
don’t even know what that is for?
gervasiogentil
@gervasiogentil
Feb 19 2016 08:43
@mohamed-avatarinweb
pvt
Mohamed
@mohamed-avatarinweb
Feb 19 2016 08:45
@gervasiogentil ..what is mean by pvt?
budimanfix
@budimanfix
Feb 19 2016 08:48
Hello folks, could give example for this challenge : freecodecamp.com/challenges/declare-javascript-objects-as-variables
Ached Zhang
@Achedzhang
Feb 19 2016 08:52
Excuse me,I have some problems.Help please!
Timofey Votyakov
@tvotyakov
Feb 19 2016 08:53
@Achedzhang what's the problem?
Ached Zhang
@Achedzhang
Feb 19 2016 08:53
My English is not good.Do I misundestand the title?
Timofey Votyakov
@tvotyakov
Feb 19 2016 08:54
@Achedzhang you need to comment out your call to Google Fonts in first line of your code
Mohamed
@mohamed-avatarinweb
Feb 19 2016 08:54
Guys I want to share my CV to see any mistakes, anybody have experience
Is there someone who has experience?
Timothy Musimbi
@tmusimbi
Feb 19 2016 08:55
what does the class "form-control" do in bootstrap?
like this?
Kat
@Topzie
Feb 19 2016 08:55
how do i add the fontawesome stylesheet in codepen?
Timofey Votyakov
@tvotyakov
Feb 19 2016 08:56
@Achedzhang no
@Achedzhang like this
<!-- <link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css"> -->
Kat
@Topzie
Feb 19 2016 08:58
I tried
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"/>
but it doesn't work
Coy Sanders
@coymeetsworld
Feb 19 2016 08:58
@Topzie start href with http://maxcdn.....
Ademola Adegbuyi
@ooade
Feb 19 2016 08:58
@Topzie you see the settings icon on the css tab? Add this //maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css
David Enos
@bluedangerforyou
Feb 19 2016 08:59
how do you guys copy the code screen like that?
Ached Zhang
@Achedzhang
Feb 19 2016 08:59
@tvotyakov Yes! Thank you very much! I really should study my English.Than you again!
CamperBot
@camperbot
Feb 19 2016 08:59
achedzhang sends brownie points to @tvotyakov :sparkles: :thumbsup: :sparkles:
:star: 118 | @tvotyakov | http://www.freecodecamp.com/tvotyakov
Ademola Adegbuyi
@ooade
Feb 19 2016 08:59
help format
CamperBot
@camperbot
Feb 19 2016 08:59

: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

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

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

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

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

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

Ademola Adegbuyi
@ooade
Feb 19 2016 09:00
@Topzie so have you tested it?
Kat
@Topzie
Feb 19 2016 09:00
but i don't see the icons , i used <i class="fa fa-twitter"></i>
<a class="btn btn-default" href="#" role="button"><i class="fa fa-linkedin"></i> Linkedin</a>
nothing
Ademola Adegbuyi
@ooade
Feb 19 2016 09:01
@Topzie share your codepen link
Thomas Noe
@t3h2mas
Feb 19 2016 09:01
anyone complete pig latin
Kat
@Topzie
Feb 19 2016 09:01
This message was deleted
Mohamed
@mohamed-avatarinweb
Feb 19 2016 09:02
Guys I want to share my CV to see any mistakes, anybody have experience
Is there someone who has experience??
Ademola Adegbuyi
@ooade
Feb 19 2016 09:02
@Topzie it works!
Kat
@Topzie
Feb 19 2016 09:02
The link was in the html, but i deleten it, because i adde it to the pen options
Doe it?
Does it? I can't see them. :(
I'll try another browser.
Ademola Adegbuyi
@ooade
Feb 19 2016 09:03
I saw for both linkedIn and Twitter
Coy Sanders
@coymeetsworld
Feb 19 2016 09:03
@mohamed-avatarinweb you may want to try another roomhttps://gitter.im/orgs/FreeCodeCamp/rooms/ did you check the CodingJobs chatroom?
yeah @marhyorh @Topzie see both LinkedIn and Twitter icons
I'm using chrome on desktop
Kat
@Topzie
Feb 19 2016 09:04
Yes, I can see them now. Can't see them in Safari, but I can see them in Firefox. :)
Coy Sanders
@coymeetsworld
Feb 19 2016 09:06
Safari is up to date?
Kat
@Topzie
Feb 19 2016 09:07
Yes it is. I think it's blocking them.
Coy Sanders
@coymeetsworld
Feb 19 2016 09:09
hmm interesting
if you're interested you can check their github page and see if anyone else reported similar issues
if not you could create your own issue and see if the developers will work on it in a future release
Kat
@Topzie
Feb 19 2016 09:10
I tink it's just my (security?) preferences. Will have a look at it later.
Balogun Mansuur Adewale
@AllrightConcepts
Feb 19 2016 09:11

Give your body element the color property of green. <h1> Hello World</h1>
<style>

body {
background-color: black;
font-family: monospace;
font-color: green
}

</style>

please help
Ademola Adegbuyi
@ooade
Feb 19 2016 09:13
@AllrightConcepts color not font-color
Coy Sanders
@coymeetsworld
Feb 19 2016 09:13
yup
Balogun Mansuur Adewale
@AllrightConcepts
Feb 19 2016 09:13
@marhyorh @coymeetsworld thanks
CamperBot
@camperbot
Feb 19 2016 09:13
allrightconcepts sends brownie points to @marhyorh and @coymeetsworld :sparkles: :thumbsup: :sparkles:
:star: 279 | @coymeetsworld | http://www.freecodecamp.com/coymeetsworld
:star: 634 | @marhyorh | http://www.freecodecamp.com/marhyorh
Coy Sanders
@coymeetsworld
Feb 19 2016 09:14
not sure why its not font-color, that seems more descriptive
Chris C.
@chrisamsterdam1986
Feb 19 2016 09:14
Good question :)
Coy Sanders
@coymeetsworld
Feb 19 2016 09:15
or maybe text-color, idk
Derek
@NerdOrDie
Feb 19 2016 09:16
@coymeetsworld it's because it applies to more than just the font color, I believe, it can change border color as well
Kat
@Topzie
Feb 19 2016 09:17
Almost forgot to send you the brownies..
@marhyorh thanks
CamperBot
@camperbot
Feb 19 2016 09:18
topzie sends brownie points to @marhyorh :sparkles: :thumbsup: :sparkles:
:star: 635 | @marhyorh | http://www.freecodecamp.com/marhyorh
Kat
@Topzie
Feb 19 2016 09:18
@coymeetsworld thanks
CamperBot
@camperbot
Feb 19 2016 09:18
topzie sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:star: 280 | @coymeetsworld | http://www.freecodecamp.com/coymeetsworld
Kenneth
@Crazyroo
Feb 19 2016 09:18
its because font-color a excel tag is :) they could not use that
Chris C.
@chrisamsterdam1986
Feb 19 2016 09:20
Yeah it is really weird
Derek
@NerdOrDie
Feb 19 2016 09:20
you can do h1 { border:1px solid; color: green } and see green text with green border https://jsfiddle.net/okn3w1p8/
ZAHEER AFZAL
@zaheer442
Feb 19 2016 09:20
is there any syntax through which a string can be break to array of words or something like that?
Chris C.
@chrisamsterdam1986
Feb 19 2016 09:20
Especially because background-color does exist
Kenneth
@Crazyroo
Feb 19 2016 09:21
yeah its coding logic
Ademola Adegbuyi
@ooade
Feb 19 2016 09:22
@coymeetsworld It exists in html <font color="red">This is a red text</font> but it's crap :smile:
Joshua Cuellar
@Josh-m-c
Feb 19 2016 09:26
<style>
.red-text {
color: red;
p {
font-size: 16px;
}}
</style>
im having trouble with my syntax here. any help?
Coy Sanders
@coymeetsworld
Feb 19 2016 09:27
no @marhyorh thats the font html tag given the style attribute color :)
Ademola Adegbuyi
@ooade
Feb 19 2016 09:28
@Josh-m-c why do you av p style inside .red-text?
Coy Sanders
@coymeetsworld
Feb 19 2016 09:28
@NerdOrDie border-color is the attribute for changing border colors
oh but i guess your example works too hmm
Joshua Cuellar
@Josh-m-c
Feb 19 2016 09:29
i got it, thank you!
Ademola Adegbuyi
@ooade
Feb 19 2016 09:29
@coymeetsworld Yeah :smile:
S.L. Ting
@palden
Feb 19 2016 09:30
@Josh-m-c I thnk you misplaced the } for the .red-text to p instead. @marhyorh is right.
CamperBot
@camperbot
Feb 19 2016 09:30
palden sends brownie points to @josh-m-c and @marhyorh :sparkles: :thumbsup: :sparkles:
:star: 636 | @marhyorh | http://www.freecodecamp.com/marhyorh
:star: 19 | @josh-m-c | http://www.freecodecamp.com/josh-m-c
vanderpuye
@Cache-Bruce
Feb 19 2016 09:31
can someone help me please how do i get an H2 element to have the class red-text and how do I declare a red-text class and have its color set to red. On my stylesheet
Coy Sanders
@coymeetsworld
Feb 19 2016 09:32
@Cache-Bruce you don't necessarily need to create a class if you only have one H2 element on your page, you can apply the style to h2
Kenneth
@Crazyroo
Feb 19 2016 09:32
css:
.red-text{}
vijaytadimeti
@vijaytadimeti
Feb 19 2016 09:32
place it between <style> and </style>
vanderpuye
@Cache-Bruce
Feb 19 2016 09:32
ok
Kenneth
@Crazyroo
Feb 19 2016 09:32

css:
.red-text{ color:red}
html:

<h2 class=“red-text">blabla</h2>

Ademola Adegbuyi
@ooade
Feb 19 2016 09:33
@Cache-Bruce <h2 class="blue-text">This h2 font color should be blue</h2>
<style>
.blue-text{
 color: blue
}
</style>
Coy Sanders
@coymeetsworld
Feb 19 2016 09:33
I would only use class if you have more than one h2 tag on your page and you dont want to apply red-text to it
*don't want to apply red-text to all h2 tags necessarily, i mean
Derek
@NerdOrDie
Feb 19 2016 09:34
@coymeetsworld I was just pointing out that the reason color isn't called font-color is because it can change more than just the font color of the element selected
Kenneth
@Crazyroo
Feb 19 2016 09:34
in his assignment : declare the red-text class
Coy Sanders
@coymeetsworld
Feb 19 2016 09:34
right I understand @NerdOrDie
S.L. Ting
@palden
Feb 19 2016 09:34

@Cache-Bruce in a html file:

<style> h2 {color:red;} </style>

<h2> This is in red. </h2>

Coy Sanders
@coymeetsworld
Feb 19 2016 09:34
yeah that's the way I would do it @palden
Coy Sanders
@coymeetsworld
Feb 19 2016 09:35
no need for a class, although the class would work
Kenneth
@Crazyroo
Feb 19 2016 09:35
no need indeed xP but i was just looking in the text what he needed to to xP
Coy Sanders
@coymeetsworld
Feb 19 2016 09:35
class would be better if you wanted to change the font color on different tags also
Kenneth
@Crazyroo
Feb 19 2016 09:35
"can someone help me please how do i get an H2 element to have the class red-text and how do I declare a red-text class and have its color set to red. On my stylesheet"
Ademola Adegbuyi
@ooade
Feb 19 2016 09:36
@coymeetsworld class makes it re-usable
Kenneth
@Crazyroo
Feb 19 2016 09:36
(not mine, its his)
Coy Sanders
@coymeetsworld
Feb 19 2016 09:36
@marhyorh reusable for other tags yeah, so if you wanted some h2 tags and maybe like some p tags to have it then that would be the way t ogo
but I'm assuming in that problem he only needs to change one h2 tag, simplest way is just to change the style of the h2 tag
Mohamed
@mohamed-avatarinweb
Feb 19 2016 09:37
Guys I want to share my CV to see any mistakes, anybody have experience
Is there someone who has experience??
Coy Sanders
@coymeetsworld
Feb 19 2016 09:39
<html>
    <head>
        <style>
          .red-text {
            color: red;
          }
        </style>
    <body>
        <h2 class="red-text">This is h2 red text</h2>
        <h2>This is h2 with no red text</h2>
        <p>This is some paragraph</p>
        <p class="red-text">This paragraph has red text</p>
    </body>
</html>
S.L. Ting
@palden
Feb 19 2016 09:40
Sorry @Cache-Bruce for linking html to the stylesheet, create a style sheet with the name style.css in the same directory as the html, then in the html, put this in the header:
  <link rel="stylesheet" type="text/css" href="style.css”>
Coy Sanders
@coymeetsworld
Feb 19 2016 09:40
something like that a class would make sense
<html>
    <head>
        <style>
          h2 {
            color: red;
          }
        </style>
   </head>
    <body>
        <h2>This has red text</h2>
        <h2>So does this</h2>
    </body>
</html>
Personally I find this cleaner
gitlogin13
@gitlogin13
Feb 19 2016 09:45
@coymeetsworld missing </head> closing tag ?
Coy Sanders
@coymeetsworld
Feb 19 2016 09:46
so not the point @gitlogin13 lol
i2gor87
@i2gor87
Feb 19 2016 09:46
Or you can do it in one line:
<h2 style ="color: red"> Hi </h2>
Coy Sanders
@coymeetsworld
Feb 19 2016 09:46
but good eye
gitlogin13
@gitlogin13
Feb 19 2016 09:46
@coymeetsworld I know - just being pedantic :)
Coy Sanders
@coymeetsworld
Feb 19 2016 09:47
yeah @i2gor87 thats even simpler
from what I've read though its good practice to separate content (HTML) and style (CSS), especially when you're dealing with making a website that will have many pages with h2 tags
i2gor87
@i2gor87
Feb 19 2016 09:48
@coymeetsworld the problem is that you cannot apply it to different parts and you have to write that again and again =) But for only one change it’s ok I guess
Coy Sanders
@coymeetsworld
Feb 19 2016 09:49
yeah right, in the end its all moot all our solutions work
i2gor87
@i2gor87
Feb 19 2016 09:49
yeah, everything goes in order. Like style.css, index.html and main.js as a start template)
Marsel
@marselcode
Feb 19 2016 09:49
who can guide me what should I use here? Task : Counting Cards
Coy Sanders
@coymeetsworld
Feb 19 2016 09:49
and the only differences come in preference
or if you needed to change multiple h2 tags on multiple pages, where a separate css file would be ideal instead.
that way if you ever wanted to change the style for h2 tags you only change it one place, but as these are just examples that's not important
i2gor87
@i2gor87
Feb 19 2016 09:50
@coymeetsworld perfectly right xD it actually applies to one website if you don’t want to change anything after creation
Caleb Martin
@caleb272
Feb 19 2016 09:51
@marselcode would you happen to be falcos brother?
LouLuigi
@LouLuigi
Feb 19 2016 09:53
how do i save an unfinished project? please help i ma new on code camp
HeshamAbdElLatif
@HeshamAbdElLatif
Feb 19 2016 09:53
hey guys, i need to know how Italicize the text in your target4 button by adding HTML tags.
Make sure the text is otherwise unchanged.
i2gor87
@i2gor87
Feb 19 2016 09:53
@LouLuigi you don’t save it, whenever you come back, you’ll be at the same page
Marsel
@marselcode
Feb 19 2016 09:53
@caleb272 i'm thinking how to start it
Caleb Martin
@caleb272
Feb 19 2016 09:54
^ what do you mean
i2gor87
@i2gor87
Feb 19 2016 09:54
@HeshamAbdElLatif http://www.w3schools.com/html/html_formatting.asp That’s how you format the text in HTML
HeshamAbdElLatif
@HeshamAbdElLatif
Feb 19 2016 09:55
@i2gor87 sorry , i need to do it using jquery
LouLuigi
@LouLuigi
Feb 19 2016 09:55
@i2gor87 Thank you
i2gor87
@i2gor87
Feb 19 2016 09:57
@HeshamAbdElLatif oh =) I thought you have to do it with HTML tag
Hemedi
@Hemedi
Feb 19 2016 09:57
Does anyone know how to edit code from challenges without the code being run.
Because normally it is run as soon as the page is loaded
i2gor87
@i2gor87
Feb 19 2016 09:57
@HeshamAbdElLatif http://www.w3schools.com/jsref/jsref_italics.asp isn’t it the thing you’re looking for?
@LouLuigi Welcome
Hemedi
@Hemedi
Feb 19 2016 09:58
I created an infinite loop and can't edit it before my browser crashes
S.L. Ting
@palden
Feb 19 2016 09:59
@LouLuigi Welcome! f you are referring to Freecodecamp challenges - Corrected: I thnk it’s autosaved. Test by closing the page and reload the challenge page to be sure to have the same codes where you left :smile:
CamperBot
@camperbot
Feb 19 2016 09:59
palden sends brownie points to @louluigi :sparkles: :thumbsup: :sparkles:
:star: 28 | @louluigi | http://www.freecodecamp.com/louluigi
HeshamAbdElLatif
@HeshamAbdElLatif
Feb 19 2016 09:59
@HeshamAbdElLatif i think this link will help u to understand me :))
i2gor87
@i2gor87
Feb 19 2016 10:00
@HeshamAbdElLatif the code should be HTML. Try <i>
HeshamAbdElLatif
@HeshamAbdElLatif
Feb 19 2016 10:01
@i2gor87 it doesn't work :/
i2gor87
@i2gor87
Feb 19 2016 10:02
@HeshamAbdElLatif
<script>
  $(document).ready(function() {
    $("#target1").css("color", "red");
$("#target4").html("<i>#target4</i>");
  });
</script>
@HeshamAbdElLatif okay, here is the code you are looking for)
HeshamAbdElLatif
@HeshamAbdElLatif
Feb 19 2016 10:04
@i2gor87 oop the proble, was that i wrote target4 instead of #terget4 :satisfied:
i2gor87
@i2gor87
Feb 19 2016 10:04
@HeshamAbdElLatif xDD
HeshamAbdElLatif
@HeshamAbdElLatif
Feb 19 2016 10:04
@i2gor87 than u anyway :D
i2gor87
@i2gor87
Feb 19 2016 10:05
@HeshamAbdElLatif you’re welcome)
George Sotiriou
@elementcodesnow
Feb 19 2016 10:44
Guys if I use the "img-responsive" class for an image I have but for the SAME image I specify a style which includes "width: 250px;" does this make the image lose the whole responsiveness or it keeps being responsive keeping this 250px setting as a start base?
sorry for the bad syntax ... couldn't find a better way to express it
Timofey Votyakov
@tvotyakov
Feb 19 2016 10:52

@elementcodesnow in bootstrap.css img-responsive is declared as

.img-responsive {
    display: block;
    max-width: 100%;
    height: auto;
}

It seems like img with "img-responsive" and style="width: 250px;" will keep being responsive keeping 250px settings as a start base.

Radhika Chaudhary
@radheyIndia
Feb 19 2016 10:54
I am stuck in Basic Algorithm's Seek and destroy question
can anybody give me a clue what to do??
Ademola Adegbuyi
@ooade
Feb 19 2016 10:54
@radheyIndia what have you done?
George Sotiriou
@elementcodesnow
Feb 19 2016 10:59
@tvotyakov thank you! :)
CamperBot
@camperbot
Feb 19 2016 10:59
elementcodesnow sends brownie points to @tvotyakov :sparkles: :thumbsup: :sparkles:
:star: 120 | @tvotyakov | http://www.freecodecamp.com/tvotyakov
Alessandro Giordo
@bovas85
Feb 19 2016 11:14
Hi everyone, I'm stuck at the first test Build Random Quote generator
How am I supposed to find quotes and generate them?
@bovas85 It's up to you which quotes you want to use, if that's what you're asking. One of the fun parts of that project for me was looking up quotes from some of my favorite people.
Alessandro Giordo
@bovas85
Feb 19 2016 11:24
@1gb I don't know how to use Ajax and Json I think I could generate some random quotes from a list I have but not from an API
@bovas85 I didn't use an API for the quote project, just JavaScript . Try doing it the way you think you know how.
Ademola Adegbuyi
@ooade
Feb 19 2016 11:39
Alessandro Giordo
@bovas85
Feb 19 2016 11:39
I've done it with normal JS but I want to learn Ajax and Json and APIs :)
Marcos Antônio de Souza Silva
@massilva
Feb 19 2016 11:39
Vi!
Hi

I am in the challenge : "Drop it
Drop the elements of an array (first argument), starting from the front, until the predicate (second argument) returns true.

Return the rest of the array, otherwise return an empty array."

Alessandro Giordo
@bovas85
Feb 19 2016 11:41
@marhyorh I get XMLHttpRequest cannot load http://quotesondesign.com/wp-json/posts?filter[orderby]=rand. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://s.codepen.io' is therefore not allowed access.
Marcos Antônio de Souza Silva
@massilva
Feb 19 2016 11:41
Why "drop([0, 1, 0, 1], function(n) {return n === 1;}) should return [1, 0, 1]."?
Ademola Adegbuyi
@ooade
Feb 19 2016 11:41
@bovas85 pen link?
Nick Robson
@nickrobson
Feb 19 2016 11:41
@massilva It drops all elements before the second argument's function returns true.
Alessandro Giordo
@bovas85
Feb 19 2016 11:42
Nick Robson
@nickrobson
Feb 19 2016 11:42
@massilva In this case, it sees that 0 is false, so drops it, but sees 1 as true, so uses every element including and after the 1
Alessandro Giordo
@bovas85
Feb 19 2016 11:48
@marhyorh is my code wrong?
Ademola Adegbuyi
@ooade
Feb 19 2016 11:49
@bovas85 NO
@bovas85 use $.ajax , it's like $.getJSON checks for the json extension
Alexander Køpke
@alexanderkopke
Feb 19 2016 11:54
@bovas85 maybe add ?callback=? To the url. Not sure it will help but try
Yaroslav
@YVeselovskyi
Feb 19 2016 11:57
hello, can someone help me?)
Alessandro Giordo
@bovas85
Feb 19 2016 11:58
@marhyorh tried but not working. Should I change anything else there?
Yaroslav
@YVeselovskyi
Feb 19 2016 11:58
blob
Alessandro Giordo
@bovas85
Feb 19 2016 11:58
Refused to execute script from 'http://quotesondesign.com/wp-json/posts?filter[orderby]=rand?callback=jQuery21303387103625573218_1455883038271&_=1455883038275' because its MIME type ('application/json') is not executable, and strict MIME type checking is enabled.
Yaroslav
@YVeselovskyi
Feb 19 2016 11:58
how to make this responsive :D
Marcos Antônio de Souza Silva
@massilva
Feb 19 2016 12:00
@nickrobson thanks :+1:
CamperBot
@camperbot
Feb 19 2016 12:00
massilva sends brownie points to @nickrobson :sparkles: :thumbsup: :sparkles:
:star: 392 | @nickrobson | http://www.freecodecamp.com/nickrobson
Alexander Køpke
@alexanderkopke
Feb 19 2016 12:05
&callback=? @bovas85
Alessandro Giordo
@bovas85
Feb 19 2016 12:05
it gives me that error
about mime
CamperBot
@camperbot
Feb 19 2016 12:06
you need to ask about @someone!
Alexander Køpke
@alexanderkopke
Feb 19 2016 12:07
:-(
Ange Kap
@Angekap
Feb 19 2016 12:10
Hey guys, I've got a question. Looking at the "Record Collection" challenge... is it possible to do it using if/else statements?! I've done it already using switch cases, so am just wondering if anyone has done it differently
Timofey Votyakov
@tvotyakov
Feb 19 2016 12:13
@YVeselovskyi Short advise, add bootstrap to your project, and rewrite your html using bootstrap classes.
Nick Robson
@nickrobson
Feb 19 2016 12:15
@YVeselovskyi Use CSS in the style of
width: 30%;
height: 30%;
font-height: calc(20%);
Alessandro Giordo
@bovas85
Feb 19 2016 12:15
@marhyorh can you please point me to a guide for ajax please?
Ademola Adegbuyi
@ooade
Feb 19 2016 12:17
This message was deleted
Davin
@xinlitik
Feb 19 2016 12:18
Hey... Working on my front end project and I can't get the Collapse toggle to collapse my navbar! Don't see what I'm doing wrong here... would anyone mind taking a look? Thanks!!
http://codepen.io/xinlitik/pen/YwBMoW
Ademola Adegbuyi
@ooade
Feb 19 2016 12:19
@bovas85
$.ajax({
  url: "urlHere"
}).done(function(data) {
  //use data;
});
blackwaterx
@blackwaterx
Feb 19 2016 12:22
Hey guys, I have a problem with the challenge 89, that ask me to put a "thumbs-up "icon in a like button.Thats work good when i do it like this <button class= "fa fa-thumbs-up"> in the button element but the problem its they ask me to include the element < i ></i> somewhere and i really dont know where . Could you help me ??
Timofey Votyakov
@tvotyakov
Feb 19 2016 12:22
@blackwaterx you should add it inside your <button></button>
blackwaterx
@blackwaterx
Feb 19 2016 12:24
so like <button <i> </i>>?
Salomón Mendoza
@SHLOMER
Feb 19 2016 12:26
hello someone can help me with the challege. Learn how Script Tags and Document Ready Work
I put <script> $(document).ready(function() { function with }); </script> at the top of the code but it cant work
Timofey Votyakov
@tvotyakov
Feb 19 2016 12:27
@blackwaterx no. <i> is a tag, not attribute. It could be included between some open and close tags. In your case between open and close button tag.
Alessandro Giordo
@bovas85
Feb 19 2016 12:27
@marhyorh what do I do in the // use data line
Timofey Votyakov
@tvotyakov
Feb 19 2016 12:28
@SHLOMER what is function with?
Gustavo Chávez
@gchavez2
Feb 19 2016 12:29
find twitch
Ademola Adegbuyi
@ooade
Feb 19 2016 12:29
@bovas85 you can console.log(data) to analyse the data. Try it
Salomón Mendoza
@SHLOMER
Feb 19 2016 12:31
@tvotyakov I dont know, the instructions said that at the end of the challenge.
Alessandro Giordo
@bovas85
Feb 19 2016 12:32

@marhyorh this is my code

$(document).ready(function() {
  $.ajax({
    url: "https://theysaidso.p.mashape.com/quote"
    }).done(function(data) {
      console.log(data);
    });
  });
});

but nothing appears in the console

Marius Funk
@Funkie42
Feb 19 2016 12:33

two questions concerning the Portfolio-project:
http://codepen.io/Funkie42/pen/NxJrZx

  1. Why is there a white stripe on the far right (i have to scoll to see it)
  2. How do I make Navbar links smaller? when i hover over them it looks really stupid

thanks!

Salomón Mendoza
@SHLOMER
Feb 19 2016 12:33
@tvotyakov haha I remove that and it works, thanks anyway!
CamperBot
@camperbot
Feb 19 2016 12:33
shlomer sends brownie points to @tvotyakov :sparkles: :thumbsup: :sparkles:
:star: 130 | @tvotyakov | http://www.freecodecamp.com/tvotyakov
Timofey Votyakov
@tvotyakov
Feb 19 2016 12:35
@SHLOMER yes. all what write with black color is only comment for you, you don't need to repeat it in your code.
Ademola Adegbuyi
@ooade
Feb 19 2016 12:35
@bovas85 that quote website uses an api key
Shawl16
@Shawl16
Feb 19 2016 12:37
hello
Ademola Adegbuyi
@ooade
Feb 19 2016 12:39
@bovas85 besides you have an extra });
Shawl16
@Shawl16
Feb 19 2016 12:39
I'm new to Free Code Camp.
Ademola Adegbuyi
@ooade
Feb 19 2016 12:40
@Shawl16 Welcome
Shawl16
@Shawl16
Feb 19 2016 12:40
Thanks.
Well, I would really like to know how this would help me in real life.
Alessandro Giordo
@bovas85
Feb 19 2016 12:41
how do I set their api key @marhyorh ?
Kat
@Topzie
Feb 19 2016 12:47
@Funkie42 Try this to start with at the second line: <div class="container">
Marius Funk
@Funkie42
Feb 19 2016 12:48
@Topzie thanks, that solves the first problem, how to do the second one?
CamperBot
@camperbot
Feb 19 2016 12:48
funkie42 sends brownie points to @topzie :sparkles: :thumbsup: :sparkles:
:star: 133 | @topzie | http://www.freecodecamp.com/topzie
Alessandro Giordo
@bovas85
Feb 19 2016 12:49
@marhyorh ok getting there. I've changed API and now get an object in the text field:
{"quote":"Why don't you come up sometime and see me?","author":"She Done Him Wrong","category":"Movies"}
Kat
@Topzie
Feb 19 2016 12:49
@Funkie42 I don't see anything weird when I over over them.
Alessandro Giordo
@bovas85
Feb 19 2016 12:49
How would I target "quote" only?
Marius Funk
@Funkie42
Feb 19 2016 12:51
@Topzie yeah it just that when i hover over lets say "english" the white background touches the top of the page and i'd like to size the whole whitething down a bit.. how do i do that?
Caleb Martin
@caleb272
Feb 19 2016 12:52
gogout
Kat
@Topzie
Feb 19 2016 12:54
Perhaps by changing the navbar-pills into navbar-tabs
Ademola Adegbuyi
@ooade
Feb 19 2016 12:58
@bovas85 data.quote will get the quote only
Alessandro Giordo
@bovas85
Feb 19 2016 12:59
@marhyorh it doesn't display anything if I put data.quote
Slava
@lazv85
Feb 19 2016 13:04
hi all
Md Saiful Islam
@sislamcse
Feb 19 2016 13:10
Hello
S.L. Ting
@palden
Feb 19 2016 13:11
@Shawl16 welcome! One thing about coding is that it train logic thinking, I reckon. Fcc has this road map, challenges accountability, free certifications and active community support, and oh the interactive coding environment and projects! Good luck!
Nuri Uzunoğlu
@nuriu
Feb 19 2016 13:12
hello everyone
i had small problem with mutation
function mutation(arr) {
  var b;
  var count = 0;
  var pos;

  for(var i = 0; i < arr[1].length; i++) {
    pos = arr[0].indexOf(arr[1][i]);
    if(pos !== -1) {
       b = true;
    } else {
      b = false;
    }
  }
  return b;
}

mutation(["hello", "neo"]);
should return false on hello, neo because hello doesn't contain n char
but it returns true
7 test success
only this one failed
Alexander Køpke
@alexanderkopke
Feb 19 2016 13:14
@bovas85 console.log(data.quote); does nothing?
Nuri Uzunoğlu
@nuriu
Feb 19 2016 13:14
any help appreciated
Timofey Votyakov
@tvotyakov
Feb 19 2016 13:15
@nuriu you need to break your for-loop first time b is false.
Nuri Uzunoğlu
@nuriu
Feb 19 2016 13:15
i tried but
other 3 test fails now
oh i fixed it
Rohit Choudhary
@rohitChoudharyIndia
Feb 19 2016 13:16
@nuriu In your case only last character will matter. Try breaking the loop if any character does not match.
Nuri Uzunoğlu
@nuriu
Feb 19 2016 13:17
  arr[0] = arr[0].toLowerCase();
  arr[1] = arr[1].toLowerCase();
i added these lines to top
with break it fixes
thanks everyone
Timofey Votyakov
@tvotyakov
Feb 19 2016 13:17
@nuriu yes. it is because indexOf is case sensitive
Nuri Uzunoğlu
@nuriu
Feb 19 2016 13:18
yes, I should not have ignored this possibility
Ademola Adegbuyi
@ooade
Feb 19 2016 13:21
wiki immutable
CamperBot
@camperbot
Feb 19 2016 13:21

:point_right: js immutable [wiki]

Immutable means unchangeable i.e. you can't change.

Javascript has lots of immutable types e.g. string primitive type. Try this in your console.

s = "red";
console.log(s[1]); //→ "e"
s[1] = "x";
console.log(s) //→ "red"

the s didn't change! WAT!

:pencil: read more about js immutable on the FCC Wiki

Ian
@IMLaing
Feb 19 2016 13:25
Is there anyone who can help me understand how to implement a tweet button for the "random quote generator? I can't figure out how to make it so the tweet will take the quote. It always loads blank. Currently it doesn't work at all. any guidance would be awesome
Rohit Choudhary
@rohitChoudharyIndia
Feb 19 2016 13:29
I used this link https://twitter.com/intent/tweet?hashtags=xyz&text=thisIsAQuote @IMLaing
Kevin Mulligan
@kmulligan
Feb 19 2016 13:34
@rohitChoudharyIndia How did you insert the function into the text= ? My tweet just comes up as "showQuote" (my function name) instead of the result of the function
budimanfix
@budimanfix
Feb 19 2016 13:47

Any one can correct what i missing here : ar Car = function() {
this.wheels = 4;
this.engines = 1;
this.seats = 1;
};

// Only change code below this line.

var myCar = new Car();
wheels = 4;
nickName = "twin";

Timofey Votyakov
@tvotyakov
Feb 19 2016 13:54
@budimanfix you need to qualify your wheels property by myCar object name
Marsel
@marselcode
Feb 19 2016 13:54

hello. Please help me with: Counting Cards
Where is wrong?

var count = 0;
function cc(card)
{
// Only change code below this line
switch (count) {
case 2:
case 3:
case 4:
case 5:
case 6:
answer = "count + 1";
break;
case 7:
case 8:
case 9:
answer = "count + 0";
break;
case 10:
case "J":
case "Q":
case "K":
case "A":
answer = "count - 1";
break;

    }

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

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

budimanfix
@budimanfix
Feb 19 2016 13:56
@tvotyakov Thank you
CamperBot
@camperbot
Feb 19 2016 13:56
budimanfix sends brownie points to @tvotyakov :sparkles: :thumbsup: :sparkles:
:star: 131 | @tvotyakov | http://www.freecodecamp.com/tvotyakov
Marius Funk
@Funkie42
Feb 19 2016 14:04
@Topzie thanks, i kinda fixed it
CamperBot
@camperbot
Feb 19 2016 14:04
funkie42 sends brownie points to @topzie :sparkles: :thumbsup: :sparkles:
:star: 134 | @topzie | http://www.freecodecamp.com/topzie
SJV83
@SJV83
Feb 19 2016 14:13
@marselcode You have surrounded the variable count in quotation marks within your switch statement
@marselcode sorry misunderstood, still working on it
Marsel
@marselcode
Feb 19 2016 14:14
@SJV83 yes. i already have done
SJV83
@SJV83
Feb 19 2016 14:15
@marselcode count will always be 0 as you don't increment count during any of the cases, you only assign answer as the count which is always 0
John Deegan
@JohnDeegs
Feb 19 2016 14:16

Hey all, I'm stuck on http://www.freecodecamp.com/challenges/return-largest-numbers-in-arrays here is my current logic

function largestOfFour(arr) {
  // You can do this!
  var bigNum = 0;
  var myNewArray = [];
  for(i = 0; i < arr.length; i++){
    for(j = 0; j < arr[i].length; j++){
      if(arr[i][j].length > bigNum){
        bigNum = arr[i][j];
        myNewArray.push(bigNum);
      }
    }
  }

  return myNewArray;
}

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

I'm looping through each element in largestOfFour, then looping through the nested array at i, then using j to represent the elements within the sub arrays to find the biggest number. Once this figure is found, it is then pushed onto the new array myNewArray. Logically it makes sense to me, but my code isn't working.

SJV83
@SJV83
Feb 19 2016 14:18
@JohnDeegs inside the if statement you need to assign i and j as var
@JohnDeegs for statement*
for(var i = 0; i < arr.length; i++){
xEpicDanielx
@xEpicDanielx
Feb 19 2016 14:19
one other thing
 for(j = 0; j < arr[i].length; j++){
      if(arr[i][j].length > bigNum){
        bigNum = arr[i][j];
        myNewArray.push(bigNum);
      }
    }

if my logic is correct.. this will push a new number into the 'myNewArray' EVERY TIME you top the other number...
So if you had an array that was something like this

checkArray [1,2,3,4]

it would push 2,3,&4 into the answer array.
Someone correct me if I am wrong.

Blauelf
@Blauelf
Feb 19 2016 14:22
You're right.
xEpicDanielx
@xEpicDanielx
Feb 19 2016 14:23
so @JohnDeegs , you will need to check every number in the array before actually pushing it into your answer
lawrencebass
@lawrencebass
Feb 19 2016 14:24
@marselcode You just have a few mistakes, change switch(count) to switch(card) otherwise you aren't really checking the card number passed through. Next instead of answer = "count+1" should be count= count+1 since your trying to increase or decrease the value of count depending on which card values are passed. Change the other two cases like how I did with answer= "count+1" and your code should work with what you have now
John Deegan
@JohnDeegs
Feb 19 2016 14:25

@xEpicDanielx cheers for replying! I thought that was what

for(var j = 0; j < arr[i].length; j++)

was doing, looking through every element in the arr[i] sub array

then if j was bigger than bigNum it gets pushed to the new array
xEpicDanielx
@xEpicDanielx
Feb 19 2016 14:26
it does.
lawrencebass
@lawrencebass
Feb 19 2016 14:26
@marselcode Oh and last thing, you can remove return answer; after you've made the changes because it isn't needed anymore
SJV83
@SJV83
Feb 19 2016 14:26
@JohnDeegs It is, but when you push to an array you're creating a new array.
John Deegan
@JohnDeegs
Feb 19 2016 14:26
@SJV83 That's what I'm supposed to do (I think), make a new array with the biggest numbers from all the sub arrays
xEpicDanielx
@xEpicDanielx
Feb 19 2016 14:28

But, lets say you have an array of
[1,2,3,4]
your program will look at it and say..

2 is bigger than 1... so it will push 2 into the array.. 2= bignumber
Then it will move onto the next number...
3 is bigger than 2..
It will push 3 into the array.. 3=bignumber

Does this make sense?? it will push every number in the array that is bigger than 'bignumber' instead of the biggest..

John Deegan
@JohnDeegs
Feb 19 2016 14:28
@xEpicDanielx Ah I understand you now! So I guess I need to put my push statement OUTSIDE of that if statement?
xEpicDanielx
@xEpicDanielx
Feb 19 2016 14:31
@JohnDeegs Exactly! :)
@JohnDeegs it actually needs to go out of the loop statment of j. Does that make sense?
basically.. Loop through the ENTIRE array[i].. then once you have the biggest number, push it into your answer array.
John Deegan
@JohnDeegs
Feb 19 2016 14:33
@xEpicDanielx If I place it directly outside I get a huge array with a bunch of zeros, outside the for loop I get [0,0,0,0] so I assume that's right, but my code is wrong somewhere else
@xEpicDanielx If I place it outside the j for loop I get [0,0,0,0] I mean
alishan811
@alishan811
Feb 19 2016 14:35
hellow
how i can zoom <p> 100%?
xEpicDanielx
@xEpicDanielx
Feb 19 2016 14:36
can you copy your new code on here please @JohnDeegs
John Deegan
@JohnDeegs
Feb 19 2016 14:36
@xEpicDanielx Sure, here's what I'm on currently
function largestOfFour(arr) {
  // You can do this!
  var bigNum = 0;
  var myNewArray = [];
  for(var i = 0; i < arr.length; i++){
    for(var j = 0; j < arr[i].length; j++){
      if(arr[i][j].length > bigNum){
        bigNum = arr[i][j].length;
      }
    }
    myNewArray.push(bigNum);
  }

  return myNewArray;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
xEpicDanielx
@xEpicDanielx
Feb 19 2016 14:37
move the push statment up one bracket
lawrencebass
@lawrencebass
Feb 19 2016 14:38
This message was deleted
This message was deleted
xEpicDanielx
@xEpicDanielx
Feb 19 2016 14:39
 for(var i = 0; i < arr.length; i++){
    for(var j = 0; j < arr[i].length; j++){
      if(arr[i][j].length > bigNum){
        bigNum = arr[i][j].length;
      }
    myNewArray.push(bigNum);
    }
lawrencebass
@lawrencebass
Feb 19 2016 14:40
@alishan811 You can add zoom in your CSS example:
p {
     // add zoom here
}
xEpicDanielx
@xEpicDanielx
Feb 19 2016 14:41
also, you will need to reset your big number after every loop or else it will just push the biggest number out of all 4 arrays..
so if you had an array like this
[100,0,0,1][2,2,2,2][4,5,6,2]
you will end up getting an array like this
[100,100,100]
You need to make the big number reset after every array has been scanned.
Does that make sense?
lawrencebass
@lawrencebass
Feb 19 2016 14:42
Give zoom a percentage value example: zoom: 150%; @alishan811
alishan811
@alishan811
Feb 19 2016 14:42
@lawrencebass thanks
CamperBot
@camperbot
Feb 19 2016 14:42
alishan811 sends brownie points to @lawrencebass :sparkles: :thumbsup: :sparkles:
:star: 346 | @lawrencebass | http://www.freecodecamp.com/lawrencebass
John Deegan
@JohnDeegs
Feb 19 2016 14:45
@xEpicDanielx My code currently returns an array with about 15 [0]s in it
@xEpicDanielx Hmm, ill search up how to reset a variable
xEpicDanielx
@xEpicDanielx
Feb 19 2016 14:46
@JohnDeegs would you like me to show you my code?
John Deegan
@JohnDeegs
Feb 19 2016 14:46
@xEpicDanielx I'm usually against looking at other's code for learning purposes, but if you think I'm close to the solution I won't mind.
Kris Tarling
@KrisTarling
Feb 19 2016 14:47
For example, for the code
var oneDown = [1, 4, 6].pop();
the variable oneDown now holds the value 6 and the array becomes [1, 4].
if oneDown now holds the value of 6, where is the array?
xEpicDanielx
@xEpicDanielx
Feb 19 2016 14:47
You are really close
function largestOfFour(arr) {
  var answer = [];
  var temp = 0; 
  for(var i=0; i<arr.length; i++)
     {
     for(var j=0; j<arr[i].length; j++)
       {
          if(arr[i][j]>temp)
          {
             temp = arr[i][j];
          }
       }
        answer.push(temp);
        temp=0;
     }   
return answer;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Alex N.
@N0bl3
Feb 19 2016 14:48
@KrisTarling this array wasn't assigned to a variable then it's volatile and does'nt exist anymore.
John Deegan
@JohnDeegs
Feb 19 2016 14:48
so temp is my bigNum variable with a different name?
xEpicDanielx
@xEpicDanielx
Feb 19 2016 14:48
Correct
Kris Tarling
@KrisTarling
Feb 19 2016 14:49
@N0bl3 Thanks, I thought so, but the way they worded it made it sound like you could resurrect it at will
CamperBot
@camperbot
Feb 19 2016 14:49
kristarling sends brownie points to @n0bl3 :sparkles: :thumbsup: :sparkles:
:star: 189 | @n0bl3 | http://www.freecodecamp.com/n0bl3
Alex N.
@N0bl3
Feb 19 2016 14:50
you can do var oneDown = [1, 4, 6].pop(); as much as you want it will always be equal to 6 :)
John Deegan
@JohnDeegs
Feb 19 2016 14:50
@xEpicDanielx Of course, it makes sense. After the bigNum is pushed to the new array you declare the variable as 0 again before the outer loop then repeats the entire process again
@xEpicDanielx Thank you
CamperBot
@camperbot
Feb 19 2016 14:50
johndeegs sends brownie points to @xepicdanielx :sparkles: :thumbsup: :sparkles:
:star: 249 | @xepicdanielx | http://www.freecodecamp.com/xepicdanielx
xEpicDanielx
@xEpicDanielx
Feb 19 2016 14:50

think of it like this
i is the individual array...
j is the individual numbers in the array.

Once you get done scanning J you can push the biggest number of I into the answer array...

Alex N.
@N0bl3
Feb 19 2016 14:51
This message was deleted
John Deegan
@JohnDeegs
Feb 19 2016 14:52
@xEpicDanielx A great explanation, your code showed me that I need to get out of the habit of putting .lengths onto everything as well haha :D
xEpicDanielx
@xEpicDanielx
Feb 19 2016 14:53
@JohnDeegs Glad I can help! Your code was almost there!!
I just gave you alittle push lol
Alex N.
@N0bl3
Feb 19 2016 14:56
@KrisTarling
var arr = [2,4,6];
var myVar = arr.pop();
var myVar2 = arr.pop();
var myVar3 = arr.pop();
var myVar4 = arr.pop();

console.log(myVar); //6
console.log(myVar2); //4
console.log(myVar3); //2
console.log(myVar4); //undefined

//You could use a for loop ...
Marsel
@marselcode
Feb 19 2016 14:57
what is wrong? Task : Using Objects for Lookups

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

// Only change code below this line
var book = {

  "alpha": "Adams",

  "bravo": "Boston",

  "charlie": "Chicago",

  "delta": "Denver",

  "echo": "Easy",

  "foxtrot": "Frank"

  };

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

Kris Tarling
@KrisTarling
Feb 19 2016 14:57
@N0bl3 Ah, OK, that makes a lot more sense, thanks again
CamperBot
@camperbot
Feb 19 2016 14:57
kristarling sends brownie points to @n0bl3 :sparkles: :thumbsup: :sparkles:
:warning: kristarling already gave n0bl3 points
Blauelf
@Blauelf
Feb 19 2016 14:59
@marselcode First, the tests assume you call that lookup object "lookup". Then, you don't change result, do that just after you declared your lookup object, using the syntax described on the left.
lawrencebass
@lawrencebass
Feb 19 2016 14:59
@marselcode var book should be var lookup like @Blauelf mentioned
alishan811
@alishan811
Feb 19 2016 15:00
Give elements with the p tag a font-size of 16px. Browser and Text zoom should be at 100%.
how i can solve this?
Blauelf
@Blauelf
Feb 19 2016 15:00
@alishan811 Define a CSS rule for p elements, inside your style element.
alishan811
@alishan811
Feb 19 2016 15:02
yes i did but no result....
Marsel
@marselcode
Feb 19 2016 15:02
@Blauelf @lawrencebass ok i changed var on "lookup" what else?
Blauelf
@Blauelf
Feb 19 2016 15:02
@alishan811 Then: Code, please...
@marselcode You need some assignment to result. This can only be done after you set up lookup.
alishan811
@alishan811
Feb 19 2016 15:03
p{font-size="16px";zoom:100%;}
lawrencebass
@lawrencebass
Feb 19 2016 15:03
@alishan811 and the Text zoom is just referring to the zoom setting on your browser, disregard the previous css I mentioned before.
alishan811
@alishan811
Feb 19 2016 15:03
@Blauelf
lawrencebass
@lawrencebass
Feb 19 2016 15:04
@alishan811 font-size: 16px;
Blauelf
@Blauelf
Feb 19 2016 15:04
@alishan811 CSS works differently, using colon for separating key-value pair and an ending semicolon: p { font-size: 16px; }
Marsel
@marselcode
Feb 19 2016 15:04
@Blauelf i can't understand. please show me an example.
Blauelf
@Blauelf
Feb 19 2016 15:05
@marselcode There is an example on the left. It's like variable = lookupobject[key];
lawrencebass
@lawrencebass
Feb 19 2016 15:08
@marselcode So in your case variable is result and key is val, now use bracket notation to find the value of the key within your Object lookup and assign it to result like @Blauelf example shows
mohit
@mohit-near
Feb 19 2016 15:09
Does anyone have idea about web crawling
alishan811
@alishan811
Feb 19 2016 15:09
@lawrencebass ...no result can u plz give me full code of this error?
@Blauelf