These are chat archives for FreeCodeCamp/Help

7th
Feb 2016
Juan Diaz
@LugDroid
Feb 07 2016 00:00
This message was deleted
Neriyah Marie Wilkerson
@Katgirl13
Feb 07 2016 00:02
thank you chrisdziewa
confox
@confox
Feb 07 2016 00:15
how to i open a script element?
i have this " $script {
$(document).ready(function() { }); " but its not working
NixFizit
@NixFizit
Feb 07 2016 00:18
Anyone have time to assist with a jQuery assignment?
confox
@confox
Feb 07 2016 00:18
@NixFizit which bit are you on?
Christopher Mickell
@cmmickell
Feb 07 2016 00:19
hi guys
NixFizit
@NixFizit
Feb 07 2016 00:19
@confox Yes
Christopher Mickell
@cmmickell
Feb 07 2016 00:19
i need help with giving a background color to a div element
Aleksander Gębicki
@Takumar
Feb 07 2016 00:19
@confox
<script>
  $(document).ready(function() {
    // your code
  });
</script>
confox
@confox
Feb 07 2016 00:19
thanks @Takumar
CamperBot
@camperbot
Feb 07 2016 00:19
confox sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 2164 | @takumar | http://www.freecodecamp.com/takumar
NixFizit
@NixFizit
Feb 07 2016 00:20
@confox srry read that wrong
Christopher Mickell
@cmmickell
Feb 07 2016 00:20
<div class=gray-background .gray-background {background-color: gray;} ></div>
confox
@confox
Feb 07 2016 00:21
<div class="gray-background" ></div> @cmmickell
NixFizit
@NixFizit
Feb 07 2016 00:21
@confox I am on: "Change Text Inside an Element Using jQuery" I have done what it has asked and it registers on the visual example but the "Run test" does not seem to register it.
Aleksander Gębicki
@Takumar
Feb 07 2016 00:21
@cmmickell you define class selector in <style> section:
<style>
  .gray-background {
    background-color: gray;
  }
</style>
@NixFizit show your code.
confox
@confox
Feb 07 2016 00:23
@NixFizit sorry i haven't got to that bit yet
NixFizit
@NixFizit
Feb 07 2016 00:24

@Takumar

<script>
$(document).ready(function() {
$("#target1").css("color", "red");
$("#target4").html("<i>#target4<i/>");

});
</script>

<div class="container-fluid">
<h3 class="text-primary text-center">jQuery Playground</h3>
<div class="row">
<div class="col-xs-6">
<h4>#left-well</h4>
<div class="well" id="left-well">
<button class="btn btn-default target" id="target1">#target1</button>
<button class="btn btn-default target" id="target2">#target2</button>
<button class="btn btn-default target" id="target3">#target3</button>
</div>
</div>
<div class="col-xs-6">
<h4>#right-well</h4>
<div class="well" id="right-well">
<button class="btn btn-default target" id="target4">#target4</button>
<button class="btn btn-default target" id="target5">#target5</button>
<button class="btn btn-default target" id="target6">#target6</button>
</div>
</div>
</div>
</div>

Aleksander Gębicki
@Takumar
Feb 07 2016 00:25
@NixFizit here is error, in closing tag: <i/>, it should be what?
Christopher Mickell
@cmmickell
Feb 07 2016 00:25
@confox thank you for your help
CamperBot
@camperbot
Feb 07 2016 00:25
cmmickell sends brownie points to @confox :sparkles: :thumbsup: :sparkles:
:star: 117 | @confox | http://www.freecodecamp.com/confox
Christopher Mickell
@cmmickell
Feb 07 2016 00:26
@Takumar Thank you for your help
NixFizit
@NixFizit
Feb 07 2016 00:26
@Takumar should it be </i>?
Aleksander Gębicki
@Takumar
Feb 07 2016 00:26
@NixFizit very good! :thumbsup:
NixFizit
@NixFizit
Feb 07 2016 00:26
@Takumar Thank you
CamperBot
@camperbot
Feb 07 2016 00:26
nixfizit sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 2165 | @takumar | http://www.freecodecamp.com/takumar
Aleksander Gębicki
@Takumar
Feb 07 2016 00:26
@camperbot are you sleeping? :-)
@NixFizit small mistyping happens many times when you type to fast :-)
Ramon Carroll
@Ramon-Carroll
Feb 07 2016 00:30
Can someone help me with some code for a moment?
NixFizit
@NixFizit
Feb 07 2016 00:31
@Takumar Amen to that. And I am not too fond of using a laptop. My thumbs keep hitting the touchpad. =s
Ramon Carroll
@Ramon-Carroll
Feb 07 2016 00:32
How do you insert code in here again?
Mohammed Shehab
@mshehab93
Feb 07 2016 00:33
three ticks (```) followed by the language (js html or css) with no space between them and the ticks
Aleksander Gębicki
@Takumar
Feb 07 2016 00:33
@NixFizit oh my dear friend. I don't know how people can use laptops and touchpads every day, I am fan of traditional good external keyboard with good keys :-)
Mohammed Shehab
@mshehab93
Feb 07 2016 00:33
@Ramon-Carroll
Aleksander Gębicki
@Takumar
Feb 07 2016 00:33
wiki format
CamperBot
@camperbot
Feb 07 2016 00:33

: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

Ramon Carroll
@Ramon-Carroll
Feb 07 2016 00:33
This message was deleted
Mohammed Shehab
@mshehab93
Feb 07 2016 00:34
:3 I'm gonna have to remember that command thanks @Takumar
CamperBot
@camperbot
Feb 07 2016 00:34
mshehab93 sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 2166 | @takumar | http://www.freecodecamp.com/takumar
Ramon Carroll
@Ramon-Carroll
Feb 07 2016 00:34
This message was deleted
function gcd(array) {
    function euclid(a, b) {
        if ( ! b) {
            return a;
        }

        return euclid(b, a % b);
    };

    array[0] = euclid(array[0], array[1]);
    array.splice(1, 1);
    if (array.length > 1) {
      gcd(array);
    }
    else {
      return array[0];
    }

}

console.log(gcd([8, 12, 8, 100]));
Okay, there we go.
What I'm doing here is trying to create a function for obtaining the greatest common divisor between a set of numbers in an array.
confox
@confox
Feb 07 2016 00:36
lthtsrh
Ramon Carroll
@Ramon-Carroll
Feb 07 2016 00:36
problem is that it's not returning the value. It returns undefined.
I'm using this function to first get the GCD so I can then get the LCM (least common multiple).
I've stepped through the code using a debugger, and function works properly, and the return value is correct, but right before returning, it changes the return value to undefined.
NixFizit
@NixFizit
Feb 07 2016 00:37
@Takumar Me too brother, me too. But we do work with what we have.
confox
@confox
Feb 07 2016 00:37
<script>
  $(document).ready(function() {
$("button") .addClass("animated")
$(".btn") .addClass("shake")
$("#target1") .addClass("animated shake btn-primary")
  });
</script>
Only add one class with each of your three selectors.
Ramon Carroll
@Ramon-Carroll
Feb 07 2016 00:38
It probably has something to do with closures, because I've tried creating an external variable to assign the value to (a variable outside of the function) and that value receives the value properly without turning into undefined.
Anybody know what I"m doing wrong here?
confox
@confox
Feb 07 2016 00:38
i tried this with and without $("button") .addClass("animated") $(".btn") .addClass("shake")
Kevin Brennan Guzi
@kevinbg012
Feb 07 2016 00:39
@Ramon-Carroll I think is missing a return operator, in gcd(array)
Ramon Carroll
@Ramon-Carroll
Feb 07 2016 00:39
Isn't that it in the else comparison?
at the bottom of the if/else?
@kevao012
Kevin Brennan Guzi
@kevinbg012
Feb 07 2016 00:41
@Ramon-Carroll but in the case of a if statement comes to be true, it will execute gcd(array), but it's returning any value, so it will return undefined by default
it's not
Ramon Carroll
@Ramon-Carroll
Feb 07 2016 00:42
Okay, let me take a look at it for a moment
Alec
@akerr95
Feb 07 2016 00:42
find js
CamperBot
@camperbot
Feb 07 2016 00:42

find js

more enteries:

:two::zero: js array prototype reduce
:two::one: js array prototype reverse
:two::two: js array prototype shift
:two::three: js array prototype slice
:two::four: js array prototype some
:two::five: js array prototype sort
:two::six: js array prototype splice
:two::seven: js array prototype tostring
:two::eight: js boolean
:two::nine: js string prototype charat
:three::zero: js string prototype charcodeat
:three::one: js string prototype concat
:three::two: js string prototype indexof
:three::three: js string prototype lastindexof
:three::four: js string prototype match
:three::five: js string prototype replace
:three::six: js string prototype slice
:three::seven: js string prototype split
:three::eight: js string prototype substr
:three::nine: js string prototype substring
:four::zero: js string prototype tolowercase
:four::one: js string prototype touppercase
:four::two: js arguments
:four::three: js closures
:four::four: js falsy
:four::five: js for in loop
:four::six: js for loop
:four::seven: js for of loop
:four::eight: js functions
:four::nine: js immutable
:five::zero: js loops
:five::one: js scope
:five::two: js ternary
:five::three: js truthy
:five::four: js undefined
:five::five: jsonp
:five::six: wiki js template

Marc
@wumpafruits
Feb 07 2016 00:43

'Create a Form Element':

<form action="/url-where-you-want-to-submit-form-data"></form>

Nest your text field in a form element.
Add the action="/submit-cat-photo" attribute to this form element.

I'm confused as to how to nest the 'text field' in the 'form element'

My Editor:

<input type="text" placeholder="cat photo URL">

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

Aleksander Gębicki
@Takumar
Feb 07 2016 00:44
@wumpafruits just put your text field between opening and closing form tags:
<form><input type="text".... </form>
Ramon Carroll
@Ramon-Carroll
Feb 07 2016 00:45
Oh wait, so I should just have it return the value at the end without placing it inside an else statement, correct?
Yes! It worked!
Kevin Brennan Guzi
@kevinbg012
Feb 07 2016 00:46
I should analyse better, but problably yes
Ramon Carroll
@Ramon-Carroll
Feb 07 2016 00:46
that was the only problem. Thank you very much @kevao012
CamperBot
@camperbot
Feb 07 2016 00:46
ramon-carroll sends brownie points to @kevao012 :sparkles: :thumbsup: :sparkles:
:star: 19 | @kevao012 | http://www.freecodecamp.com/kevao012
Kevin Brennan Guzi
@kevinbg012
Feb 07 2016 00:46
well, very good
@Ramon-Carroll Your welcome
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 00:49
how can i comment my code here?
confox
@confox
Feb 07 2016 00:49
/code\
` code `
ffs
` <code> `
i give up
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 00:50
thanks @confox
CamperBot
@camperbot
Feb 07 2016 00:50
lucianohd sends brownie points to @confox :sparkles: :thumbsup: :sparkles:
:star: 118 | @confox | http://www.freecodecamp.com/confox
confox
@confox
Feb 07 2016 00:51
code
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 00:51

/function queue(arr, item) {
var myArray= arr;
myArray.push(item);
myArray.shift(1);

return myArray.unshift(); // Change this line
}

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

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

oh
confox
@confox
Feb 07 2016 00:51
its ```
the shift + enter
then code
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 00:51

`function queue(arr, item) {
var myArray= arr;
myArray.push(item);
myArray.shift(1);

return myArray.unshift(); // Change this line
}

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

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

'-'

/function queue(arr, item) {
var myArray= arr;
myArray.push(item);
myArray.shift(1);

return myArray.unshift(); // Change this line
}

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

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

i'll just make some little code to don't spam
Marc
@wumpafruits
Feb 07 2016 00:52
@Takumar thank you. i feel like i still didn't quite get it when i type everything in but I'm sure I'll encounter more soon!
CamperBot
@camperbot
Feb 07 2016 00:52
wumpafruits sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 2169 | @takumar | http://www.freecodecamp.com/takumar
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 00:52
`
code
confox
@confox
Feb 07 2016 00:53

/function queue(arr, item) {
  var myArray= arr;
  myArray.push(item);
  myArray.shift(1);

  return myArray.unshift();  // Change this line
}

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

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(queue(testArr, 3)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));\
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 00:53
`
code
´
Aleksander Gębicki
@Takumar
Feb 07 2016 00:53
@lucianohd wiki format
wiki format
CamperBot
@camperbot
Feb 07 2016 00:53

: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

confox
@confox
Feb 07 2016 00:53
ah theres a command for help :P
Aleksander Gębicki
@Takumar
Feb 07 2016 00:53
@lucianohd shift() method doesn't need any arguments to remove first element, but it returns removed element so you can save it in a variable, and then return it.
Kevin Brennan Guzi
@kevinbg012
Feb 07 2016 00:53
just training
Aleksander Gębicki
@Takumar
Feb 07 2016 00:54
@kevao012 you've got it :-)
confox
@confox
Feb 07 2016 00:54
@Takumar i am confused by this challenge i believe its 117
Richard
@RichardGTech
Feb 07 2016 00:54
Hey guys I've been stuck on this problem since this morning and I haven't been able to figure it out because of work but now I have free time I can ask for the help I need
Aleksander Gębicki
@Takumar
Feb 07 2016 00:54
@confox please tell title not number.
confox
@confox
Feb 07 2016 00:55
@Takumar sorry , Target the same element with multiple jQuery Selectors
<script>
  $(document).ready(function() {
$("button") .addClass("animated");
$(".btn") .addClass("shake");
$("#target1") .addClass("animated shake btn-primary");
  });
</script>

<!-- Only change code above this line. -->

<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">
    <div class="col-xs-6">
      <h4>#left-well</h4>
      <div class="well" id="left-well">
        <button class="btn btn-default target" id="target1">#target1</button>
        <button class="btn btn-default target" id="target2">#target2</button>
        <button class="btn btn-default target" id="target3">#target3</button>
      </div>
    </div>
    <div class="col-xs-6">
      <h4>#right-well</h4>
      <div class="well" id="right-well">
        <button class="btn btn-default target" id="target4">#target4</button>
        <button class="btn btn-default target" id="target5">#target5</button>
        <button class="btn btn-default target" id="target6">#target6</button>
      </div>
    </div>
  </div>
</div>
Use the $("button") selector.
Use the $(".btn") selector.
Use the $("#target1") selector.
Only add one class with each of your three selectors.
Your #target1 element should have the classes animated‚ shake and btn-primary.
Only use jQuery to add these classes to the element.
Aleksander Gębicki
@Takumar
Feb 07 2016 00:56
@confox you have three types of selectors, you have to add one class with each type.
You have added three classes in third line with id selector
$("#target1").addClass("animated shake btn-primary");
Richard
@RichardGTech
Feb 07 2016 00:56

```<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;
}
.container-fluid{
container-fluid: <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"/>
}
</style>

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

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

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

<div class="container-fluid"><link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"/></div>

<p>Things cats love:</p>

<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>

<p>Top 3 things cats hate:</p>

<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>

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

Kevin Brennan Guzi
@kevinbg012
Feb 07 2016 00:57
more training
Richard
@RichardGTech
Feb 07 2016 00:57
I have to make sure that I have nested all HTML elements in .container-fluid
confox
@confox
Feb 07 2016 00:57
@Takumar how can i fix it though?
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 00:57
f
Aleksander Gębicki
@Takumar
Feb 07 2016 00:57
@confox problem is, that element with id #target1 is button and has class .btn so you don't have to add classes animated and shake to it, because they were added earlier.
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 00:57
test
Kevin Brennan Guzi
@kevinbg012
Feb 07 2016 00:58
@Takumar haha I'm new here, so is good to know how to use properly as soon as possible
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 00:58
Got it!
confox
@confox
Feb 07 2016 00:58
ah i see
@Takumar thanks
CamperBot
@camperbot
Feb 07 2016 00:58
confox sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:warning: confox already gave takumar points
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 00:58
thanks @Takumar and also confox xD
CamperBot
@camperbot
Feb 07 2016 00:58
lucianohd sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 2170 | @takumar | http://www.freecodecamp.com/takumar
Aleksander Gębicki
@Takumar
Feb 07 2016 00:58
@kevao012 you write it faster! :thumbsup: :-)
@ProfessorMagus you have to create DIV with class .container-fluid and nest entire code after </style> tag in it, so start from heading <h2>:
</style>
<div class="container-fluid">
  <h2 class="red-text">CatPhotoApp</h2>
  ...
</div>
@ProfessorMagus please use "Reset" button, because I see you put two links to bootstrap in the meantime, it will be easier to start from scratch.
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 01:02
function queue(arr, item) {
  var myArray= arr;
  myArray.push(item);
  myArray.shift();

  return myArray.unshift();  // Change this line
}

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

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(queue(testArr, 3)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));
So my question is, this code should push the item to the array, and then shift the first element of it, returning the element that was removed
Richard
@RichardGTech
Feb 07 2016 01:02

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

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

h2 {
font-family: Lobster, Monospace;
}

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

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

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

<div class="container-fluid">

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

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

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

<p>Things cats love:</p>

<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>

<p>Top 3 things cats hate:</p>

<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>

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

@Takumar Ok this is what I've done now
Franco Zapata
@Francozt01
Feb 07 2016 01:03
@lucianohd u have to return myArray.Shift(); instead of .unshift()
Richard
@RichardGTech
Feb 07 2016 01:04
@Takumar would you like me to add the bootstrap link?
Aleksander Gębicki
@Takumar
Feb 07 2016 01:04
@ProfessorMagus I didn't mean exactly that, but almost :-)
By ... I meant rest of code, so closing </div> should be after last line of HTML code, after </form>.
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 01:04
@Francozt01 the thing i find strange is when i return the unshift the exercise gives me a half correct
Franco Zapata
@Francozt01
Feb 07 2016 01:04
@lucianohd the shift(); removes the first element, keeps the element so u can save it in a variable
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 01:04
2/4 is correct
Richard
@RichardGTech
Feb 07 2016 01:05
@Takumar Ok I'll fix it
Aleksander Gębicki
@Takumar
Feb 07 2016 01:05
@lucianohd using unshift(arg) method you can add arg value at the beginning of your array, that is not what you should do in your exercise.
Richard
@RichardGTech
Feb 07 2016 01:06
@Takumar And I got it thanks! I've been so tired that I haven't been thinking straight
CamperBot
@camperbot
Feb 07 2016 01:06
professormagus sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 2171 | @takumar | http://www.freecodecamp.com/takumar
u pass a parameter to unshift and will be pushed to the first position in the array
Aleksander Gębicki
@Takumar
Feb 07 2016 01:07
@ProfessorMagus <style> ... </style> part is for presentation part, it defines colours, margins etc.
rest is for defining content, and you were asked to nest this second part in a DIV.
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 01:08
@Francozt01 @Takumar Got it, thanks! I was really stuck at it.
CamperBot
@camperbot
Feb 07 2016 01:08
lucianohd sends brownie points to @francozt01 and @takumar :sparkles: :thumbsup: :sparkles:
:warning: lucianohd already gave takumar points
:star: 525 | @francozt01 | http://www.freecodecamp.com/francozt01
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 01:09
function queue(arr, item) {
  var myArray= arr,b=0;
  myArray.push(item);
  b=myArray.shift();

  return b;  // Change this line
}

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

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(queue(testArr, 3)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));
i was using the unshift, when i should use the shift on a variable :D
@Francozt01 Great site
Franco Zapata
@Francozt01
Feb 07 2016 01:10
@lucianohd exactly! :+1:
Mohammed Shehab
@mshehab93
Feb 07 2016 01:16
I have a question: "The function will then return a string with the current count and the string "Bet" if the count is positive, or "Hold" if the count is zero or negative." What's the function to convert and add a value to a string so I an return it?
Max Gardner
@maxgardner
Feb 07 2016 01:17
Can anyone provide some insight on where to begin with the Card Counting challenge? I have no idea where to even start. I feel like I’m just hitting a wall mentally right now. It seems like a switch statement would work to satisfy the “Bet” or “Hold” aspect of the challenge, but I’m not sure how to fulfill the adding to the global count.
Mohammed Shehab
@mshehab93
Feb 07 2016 01:17
add a number*
I'm stuck there myself @maxgardner
actually I'm using the switch statement to increment count
confox
@confox
Feb 07 2016 01:18
right im off to bed - night all
Richard
@RichardGTech
Feb 07 2016 01:19
Ok I'm confused... I'm supposed to give a new button the class btn
ndcregut
@ndcregut
Feb 07 2016 01:19
im trying to add borders to an image for a challenge and it won't recognize that i have the size in there, anyone know why it wouldn't work?
Mohammed Shehab
@mshehab93
Feb 07 2016 01:19
you would have to check the total value of count to be able to see whether you should bet or hold, if you did it the way you're saying now its possible for count to be -5 but upon getting a 2-6 you would increment by one and say -4 bet.
@ProfessorMagus @ndcregut feel free to pvt msg me for your problems
or just paste the code here and I can take a look at it
Richard
@RichardGTech
Feb 07 2016 01:21
@mshehab93 Ok. Give me just a sec
Kevin Brennan Guzi
@kevinbg012
Feb 07 2016 01:21
@mshehab93 Lets say the variable of the counter is count, so you can concatenate like return count + 'Bet';
Richard
@RichardGTech
Feb 07 2016 01:21

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

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

h2 {
font-family: Lobster, Monospace;
}

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

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

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

<div class="container-fluid">
<h2 class="red-text text-center">CatPhotoApp</h2>

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

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

<img src="http://bit.ly/fcc-running-cats" class="img-responsive">

<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
<form action="/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor"> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality"> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Crazy</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
<button type="Like">Like</button>
</form>
</div>```

Mohammed Shehab
@mshehab93
Feb 07 2016 01:22
@kevao012 can i add the number and string together like that?
Kevin Brennan Guzi
@kevinbg012
Feb 07 2016 01:22
Yes, you can. A number will coerce to a String in that case
@mshehab93
I was meaning return "Bet " + count
Mohammed Shehab
@mshehab93
Feb 07 2016 01:24
@ProfessorMagus what was the question? I remember this exercise being multipart
@kevao012 thanks
CamperBot
@camperbot
Feb 07 2016 01:24
mshehab93 sends brownie points to @kevao012 :sparkles: :thumbsup: :sparkles:
:star: 20 | @kevao012 | http://www.freecodecamp.com/kevao012
Richard
@RichardGTech
Feb 07 2016 01:24
@mshehab93 I figured it out finally

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

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

h2 {
font-family: Lobster, Monospace;
}

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

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

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

<div class="container-fluid">
<h2 class="red-text text-center">CatPhotoApp</h2>

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

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

<img src="http://bit.ly/fcc-running-cats" class="img-responsive">

<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
<form action="/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor"> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality"> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Crazy</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
<button type="Like" class="btn">Like</button>
</form>
</div>

this is what it's supposed to be
Max Gardner
@maxgardner
Feb 07 2016 01:25
@mshehab93 Good point. I definitely see that. I was thinking I would have to use two separate statements to try to manipulate the count and the answer portion separately. Thank you, I’ll keep playing with it.
CamperBot
@camperbot
Feb 07 2016 01:25
maxgardner sends brownie points to @mshehab93 :sparkles: :thumbsup: :sparkles:
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 01:25
@ProfessorMagus try using then shift+enter, ctrl+v, ctrl+enter. Or just add a paragraph after the first
CamperBot
@camperbot
Feb 07 2016 01:25
:star: 210 | @mshehab93 | http://www.freecodecamp.com/mshehab93
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 01:25
```
"code"
```
Kevin Brennan Guzi
@kevinbg012
Feb 07 2016 01:26
@mshehab93 to be more sure, you can use the function concat from String, so it would be return "Bet ".concat(count);
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 01:26
... using ```
... after the first ```
arjunpunnam
@arjunpunnam
Feb 07 2016 01:26
Hi
im having trouble with Background class on HTML
in*
<div class = "gray_background">
is the right way of assigning?
Mohammed Shehab
@mshehab93
Feb 07 2016 01:28
@kevao012 thanks again I can finally move to the next section.
CamperBot
@camperbot
Feb 07 2016 01:28
mshehab93 sends brownie points to @kevao012 :sparkles: :thumbsup: :sparkles:
:warning: mshehab93 already gave kevao012 points
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 01:28
@arjunpunnam maybe <div class = "gray-background">
arjunpunnam
@arjunpunnam
Feb 07 2016 01:30
yes thanks it worked
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 01:30
the class name on div should be equal to the name of the class you declared firstly on the top of your code
@arjunpunnam np :D
arjunpunnam
@arjunpunnam
Feb 07 2016 01:30
but what i didnt undestand is
the class name was also
gray_background
so do class names should also follow a syntax?
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 01:31
yeah
arjunpunnam
@arjunpunnam
Feb 07 2016 01:31
yeah go that
thanks @lucianohd
CamperBot
@camperbot
Feb 07 2016 01:31
arjunpunnam sends brownie points to @lucianohd :sparkles: :thumbsup: :sparkles:
:star: 196 | @lucianohd | http://www.freecodecamp.com/lucianohd
Richard
@RichardGTech
Feb 07 2016 01:35
Wow... Adding classes are HELLA easy!
VinCoding
@VinCoding
Feb 07 2016 01:36
Any tips for coding? Should I take notes on the stuff I am learning so I remember it
Mohammed Shehab
@mshehab93
Feb 07 2016 01:36
@VinCoding I'm doing that
taking notes I mean
VinCoding
@VinCoding
Feb 07 2016 01:36
@mshehab93 R u new to coding?
Mohammed Shehab
@mshehab93
Feb 07 2016 01:36
well yes and no
VinCoding
@VinCoding
Feb 07 2016 01:37
@mshehab93 Good luck
Same here
Francis Moisan
@frankmoisan
Feb 07 2016 01:37
@VinCoding coding is like learning a new language: practice, practice, practice. Start with something small. Refactor. Tack on something new.
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 01:37
@VinCoding on the bonfires you'll need to remember the things you're doing now, you don't really need notes
Mohammed Shehab
@mshehab93
Feb 07 2016 01:37
I come from an engineering background so I have the basics down
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 01:37
@VinCoding the exercises that you alredy done will still be on the FCC, and should work as notes :D
VinCoding
@VinCoding
Feb 07 2016 01:38
@lucianohd Sweet thank you!
CamperBot
@camperbot
Feb 07 2016 01:38
vincoding sends brownie points to @lucianohd :sparkles: :thumbsup: :sparkles:
Mohammed Shehab
@mshehab93
Feb 07 2016 01:38
@VinCoding even so you should write some notes down, the exercises later on require you to use previous functions, they won't tell you which to use like in the beginning
CamperBot
@camperbot
Feb 07 2016 01:38
:star: 197 | @lucianohd | http://www.freecodecamp.com/lucianohd
Francis Moisan
@frankmoisan
Feb 07 2016 01:38
@VinCoding @lucianohd is right, you can always access your old exercises, and when in doubt, Google is your best friend. FCC is really good at making you look for the answer :)
VinCoding
@VinCoding
Feb 07 2016 01:39
@frankmoisan Thank you too! Great advice. How long have you guys been coding?
CamperBot
@camperbot
Feb 07 2016 01:39
vincoding sends brownie points to @frankmoisan :sparkles: :thumbsup: :sparkles:
:star: 304 | @frankmoisan | http://www.freecodecamp.com/frankmoisan
EL HASSSANE GARGEM
@elprincipe47
Feb 07 2016 01:40
@frankmoisan please what is FCC ? is it a website ?
Francis Moisan
@frankmoisan
Feb 07 2016 01:40
@elprincipe47 Free Code Camp = FCC
Mohammed Shehab
@mshehab93
Feb 07 2016 01:40
FCC is FreeCodeCamp
EL HASSSANE GARGEM
@elprincipe47
Feb 07 2016 01:40
thanks friends a new here :D
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 01:40
@elprincipe47 welcome \o
EL HASSSANE GARGEM
@elprincipe47
Feb 07 2016 01:40
i am
thaaank youu
is there any group on facebook ?
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 01:41
@VinCoding 7 days... maybe, but i alredy know something of c++ because of my university
zhouxh
@zhouxh
Feb 07 2016 01:42
What is the meaning of this " This camper has committed to giving $5 to Black Girls CODE each month until they have completed their Front End Development Certification. "
Francis Moisan
@frankmoisan
Feb 07 2016 01:42
@VinCoding a while now, but always just as a hobby -- VB back in school, C# with the intention of publishing on Xbox Indie Arcade (but that went down the drain), LUA in Minecraft. Made the move to Javascript originally to make a game but I figured proper webdev had better prospects for the future :)
Mohammed Shehab
@mshehab93
Feb 07 2016 01:42
@elprincipe47 if you went through the intro you should have found the fb group for your city
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 01:42
@elprincipe47 go to that site, you'll see the facebook groups by city
@zhouxh it means that that person will give $5 per month to charity until they complete the Front End part of the course
Jacob Andra
@jacob4
Feb 07 2016 01:44
@zhouxh specifically, the Black Girls CODE charity.
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 01:44
@zhouxh it's like something to give you a bump on study :D
@jacob4 yeah!
Jacob Andra
@jacob4
Feb 07 2016 01:44
@zhouxh ppl pledge money to keep their motivation high
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 01:44
@zhouxh just a moral bump ...
@frankmoisan alredy tried c# on Unity?
zhouxh
@zhouxh
Feb 07 2016 01:45
thanks
EL HASSSANE GARGEM
@elprincipe47
Feb 07 2016 01:46
any freelancers here !!
Francis Moisan
@frankmoisan
Feb 07 2016 01:46
@lucianohd Dabbled. That was around the time I started messing around with Javascript though, so I kinda defaulted to that
@lucianohd I am not a 3d modeler though, and I was checking out Unity purely for 2d, which it really wasn't good at back then
So Unity was a no-go... I wanted to do more javascript... so I went with Phaser instead. Never did anything out of it except a bunch of tests, prototypes and a half-finished clicker game with node-webkit, hehe
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 01:49
@frankmoisan well good luck on making games :D I'll try it maybe some years later, just as a hobby.
huy-tran
@huy-tran
Feb 07 2016 01:49
@elprincipe47 Freelancer here !!!
Francis Moisan
@frankmoisan
Feb 07 2016 01:50
@lucianohd Hah thanks, I've pretty much abandoned that idea, although I still jump on the Ludum Dare bandwagon every time it comes around
CamperBot
@camperbot
Feb 07 2016 01:50
frankmoisan sends brownie points to @lucianohd :sparkles: :thumbsup: :sparkles:
:star: 198 | @lucianohd | http://www.freecodecamp.com/lucianohd
VinCoding
@VinCoding
Feb 07 2016 01:50
Is HTML used mainly for app developments?
huy-tran
@huy-tran
Feb 07 2016 01:50
@VinCoding everything got involved :D
Luciano Hakime Dutra
@lucianohd
Feb 07 2016 01:53
@frankmoisan have you seen "Mobs,Inc." a really great game made on ludum dare!
@frankmoisan thanks for the chat :D
CamperBot
@camperbot
Feb 07 2016 01:53
lucianohd sends brownie points to @frankmoisan :sparkles: :thumbsup: :sparkles:
Bill
@kirah1314
Feb 07 2016 01:53
@VinCoding HTML is used for website structure
CamperBot
@camperbot
Feb 07 2016 01:53
:star: 305 | @frankmoisan | http://www.freecodecamp.com/frankmoisan
VinCoding
@VinCoding
Feb 07 2016 01:56
@kirah1314 What is used for app development? Games
Jose Dzireh Chong
@CodingDucky
Feb 07 2016 01:56
@VinCoding python, c++, java, c#, a lot of things
When I compress the window to mobile size (you'll know when it happens), the buttons stop filling up all the yellow space
why?
VinCoding
@VinCoding
Feb 07 2016 02:06
@kirah1314 Thank you!
CamperBot
@camperbot
Feb 07 2016 02:06
vincoding sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 949 | @kirah1314 | http://www.freecodecamp.com/kirah1314
VinCoding
@VinCoding
Feb 07 2016 02:06
@CodingDucky Thanks!
CamperBot
@camperbot
Feb 07 2016 02:06
vincoding sends brownie points to @codingducky :sparkles: :thumbsup: :sparkles:
Jose Dzireh Chong
@CodingDucky
Feb 07 2016 02:06
halp pls
CamperBot
@camperbot
Feb 07 2016 02:06
:star: 271 | @codingducky | http://www.freecodecamp.com/codingducky
martina carrington
@MartinaCarrington
Feb 07 2016 02:13
hello i am having a program with <div class ="gray-background" >
it said div element should have a gray background
sleatherback
@sleatherback
Feb 07 2016 02:19
I am working on a search engine that is a chrome extension. Now chrome won't allow me to use inline event listeners. So i have to use this: according to w3schools, this is the other way of setting the event listener:document.getElementById('settings').addEventListener('click', settin); I am working on a search engine that is a chrome extension. Now chrome won't allow me to use inline event listeners. So i have to use this: according to w3schools, this is the other way of setting the event listener:document.getElementById('settings').addEventListener('click', settin); I get this error: Uncaught TypeError: Cannot read property 'addEventListener' of null
forgive the double type
wasnt aware or it
sleatherback
@sleatherback
Feb 07 2016 02:24
any suggestions??
Guilherme dos Reis
@guidosreis
Feb 07 2016 02:36
@MartinaCarrington , are you having a problem?
it said that you have to use a style or class tag?
Ramon Carroll
@Ramon-Carroll
Feb 07 2016 02:42
Is anyone here familiar with the method for using GCD (a.k.a GCF) to get the LCM (least common multiple)?
I'm having an issue here, and I need to make sure that I understand the formula correctly.
because I've implemented it in my code, and it's not giving me what I expected. I don't think it's the code. I think it's my understanding of the formula
the formula is lcm(a, b) = a, b / gcd(a, b)
is this formula for calculating the LCM only applicable when you have only two values to work with (a and b), or would this formula be applicable when applying it to more than two values, like a, b, c, d, e ?
Franco Zapata
@Francozt01
Feb 07 2016 02:47
@MartinaCarrington should be style="background:gray;" instead of a class with the name of gray-background
Ramon Carroll
@Ramon-Carroll
Feb 07 2016 02:49
@Francozt01 Unless she is using a class to style multiple divs, in which some people would create a class called "gray-background". It's a common design pattern.
Guilherme dos Reis
@guidosreis
Feb 07 2016 02:49
Or, she can create a style on style tag for background-gray selector
Franco Zapata
@Francozt01
Feb 07 2016 02:50
@Ramon-Carroll i know but the exercise is about using style in the div tag. if i ain't wrong xd
budimanfix
@budimanfix
Feb 07 2016 02:51

Any one can correct my code here, what wrong? : function myTest(val) {
// Only change code below this line

if (val > 50 && 25< 10) {
if (val < 25 && 50 > 10) {
return "Yes";
}
}

// Only change code above this line
return "No";
}

// Change this value to test
myTest(10);

Ramon Carroll
@Ramon-Carroll
Feb 07 2016 02:51
Ah, I see. I didn't realize that she was talking about a specific exercise.
@budimanfix 25 less than 10? That would never evaluate to true, so it would always evaluate to false and never return "Yes"
budimanfix
@budimanfix
Feb 07 2016 02:53
@Ramon-Carroll thanks
CamperBot
@camperbot
Feb 07 2016 02:53
budimanfix sends brownie points to @ramon-carroll :sparkles: :thumbsup: :sparkles:
:star: 300 | @ramon-carroll | http://www.freecodecamp.com/ramon-carroll
Ramon Carroll
@Ramon-Carroll
Feb 07 2016 02:54
You're welcome @budimanfix
Ramon Carroll
@Ramon-Carroll
Feb 07 2016 02:57
@budimanfix First, you must only have one if statement, not two.
(val <= 50 && val >= 25)
this is the equivalent of two if statements. But it's combined into one.
They are both asking true/false questions about val.
They both must evaluate to true in order for the code inside it's block to run.
If one of them returns false, then the code won't run, and the program will skip over that code block to the next.
if it "returns" yes, the return keyword will tell it to leave the function, thus not returning "no".
If it skips the block, it will move on down to return no, and leave the function from there, returning "no" to the program.
I hope that makes sense.
Either way, you wrote your if statements wrong, which is why they were not evaluating to true, thus skipping your return "yes" section, and moving to the "return" no section.
budimanfix
@budimanfix
Feb 07 2016 03:01
@Ramon-Carroll worked!! thanks
CamperBot
@camperbot
Feb 07 2016 03:01
budimanfix sends brownie points to @ramon-carroll :sparkles: :thumbsup: :sparkles:
:warning: budimanfix already gave ramon-carroll points
Ramon Carroll
@Ramon-Carroll
Feb 07 2016 03:01
Do you understand why it worked?
Estefania Trujillo
@etrujillo6
Feb 07 2016 03:12
hi everyone, I need help with: give elements with the p tag a font-size of 16px.
I have it as: <style>
.red-text {
color: red;
}
p{
font-size: 16px;
}
</style>
and

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

James Dykstra
@BrokeBytes
Feb 07 2016 03:14
@etrujillo6 remove the extra ""
class="red-text"
Estefania Trujillo
@etrujillo6
Feb 07 2016 03:15
@BrokeBytes Thanks. is the p supposed to be next to "red-text"?
CamperBot
@camperbot
Feb 07 2016 03:15
etrujillo6 sends brownie points to @brokebytes :sparkles: :thumbsup: :sparkles:
:star: 185 | @brokebytes | http://www.freecodecamp.com/brokebytes
Guilherme dos Reis
@guidosreis
Feb 07 2016 03:15
@etrujillo6 <p class="red-text">....</p>
James Dykstra
@BrokeBytes
Feb 07 2016 03:15
no the p is an html element not a class name
Estefania Trujillo
@etrujillo6
Feb 07 2016 03:16
@BrokeBytes this is why I mentioned the p: Inside the same <style> tag that contains your red-text class, create an entry for p elements and set the font-size to 16 pixels (16px).
so I have: <style>
.red-text {
color: red;
}
p{
font-size: 16px;
}
</style>
but the p doesn't make sense there :worried:
@guidosreis thanks!
CamperBot
@camperbot
Feb 07 2016 03:17
etrujillo6 sends brownie points to @guidosreis :sparkles: :thumbsup: :sparkles:
:star: 57 | @guidosreis | http://www.freecodecamp.com/guidosreis
Guilherme dos Reis
@guidosreis
Feb 07 2016 03:17
the p attribute on style tag is referente to the p tag at HTML element
James Dykstra
@BrokeBytes
Feb 07 2016 03:18
don't nest the p in the style sheet. Keep 'em separte
Estefania Trujillo
@etrujillo6
Feb 07 2016 03:19

@guidosreis @BrokeBytes <style>
.red-text {
color: red;
font: 16px;
}
</style>

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

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

Michelle
@Michelle2016
Feb 07 2016 03:21
Hello All...I am having a bit of an issue actually understanding the instructions. I totally get the concept on this one just not exactly which classes they want me to apply to which elements:

Add the animated class to all elements with type button.

Add the shake class to all the buttons with class .btn.

Add the btn-primary class to the button with id #target1.

So I have $("button").addClass("animated");
Pawan
@pawan92
Feb 07 2016 03:23
@Michelle2016 i think it is #button inside your$()
Michelle
@Michelle2016
Feb 07 2016 03:23
I tried ("animated bounce") but that didn't work either.
It was button as a type which they show as ("button") then for the id option it was ("#target1")
cannelflow
@cannelflow
Feb 07 2016 03:26
you need animated class in button shake class in .btn
Jason Bain
@dranthrax
Feb 07 2016 03:27
@etrujillo6 did u manage to get the 16 font size
cannelflow
@cannelflow
Feb 07 2016 03:28
@Michelle2016can you show your code
Michelle
@Michelle2016
Feb 07 2016 03:30
The error message that I am getting is: Only add one class with each of your three selectors. Then it says...Your #target1 element should have the classes animated‚ shake and btn-primary.
$(document).ready(function() {
$("button").addClass("animated");
$(".btn").addClass("animated shake");
$("#target1").addClass("animated shake btn-primary");
});
Estefania Trujillo
@etrujillo6
Feb 07 2016 03:33
@dranthrax it took a while, but I got it. Thanks!
CamperBot
@camperbot
Feb 07 2016 03:33
etrujillo6 sends brownie points to @dranthrax :sparkles: :thumbsup: :sparkles:
:star: 19 | @dranthrax | http://www.freecodecamp.com/dranthrax
Michelle
@Michelle2016
Feb 07 2016 03:35
It seems like conflicting instructions.
leanminmachine
@leanminmachine
Feb 07 2016 03:36
@Michelle2016 which exercise is that!
FarionLord
@FarionLord
Feb 07 2016 03:36
wow what does "<buttin></buttin> do?
leanminmachine
@leanminmachine
Feb 07 2016 03:36
i can try helping (:
FarionLord
@FarionLord
Feb 07 2016 03:36
seem like a button....
leanminmachine
@leanminmachine
Feb 07 2016 03:36
iirc, <button> creates a button just like that in html 5?
Michelle
@Michelle2016
Feb 07 2016 03:37
It is exercise :Target the same element with multiple jQuery Selectors
leanminmachine
@leanminmachine
Feb 07 2016 03:38
okay i'll go try (:
FarionLord
@FarionLord
Feb 07 2016 03:38
okay figured it out buttin work because I gave it a bootstrap class of btn....(I am very smaht)
@Michelle2016 I can try to find a video for you.
Michelle
@Michelle2016
Feb 07 2016 03:39
@minminimal I feel like they are seeing give each one only one class but then #target1 is supposed to end up with 3 of them?
leanminmachine
@leanminmachine
Feb 07 2016 03:39
@Michelle2016
    $('button').addClass('animated');

    $('.btn').addClass('shake');

    $('#target1').addClass('btn-primary');
hahaha apparently no you just have to add one class to each
Michelle
@Michelle2016
Feb 07 2016 03:40
Ah thank you @minminimal !!! Now I get it that #target1 will all 3 because it is all of those selectors!!
CamperBot
@camperbot
Feb 07 2016 03:40
michelle2016 sends brownie points to @minminimal :sparkles: :thumbsup: :sparkles:
:star: 105 | @minminimal | http://www.freecodecamp.com/minminimal
FarionLord
@FarionLord
Feb 07 2016 03:40
@Michelle2016 this might help in the future https://www.youtube.com/user/pizzapokerguy87/playlists
leanminmachine
@leanminmachine
Feb 07 2016 03:40
yep glad it worked out!
Michelle
@Michelle2016
Feb 07 2016 03:41
Thank you @FarionLord :)
CamperBot
@camperbot
Feb 07 2016 03:41
michelle2016 sends brownie points to @farionlord :sparkles: :thumbsup: :sparkles:
:star: 83 | @farionlord | http://www.freecodecamp.com/farionlord
FarionLord
@FarionLord
Feb 07 2016 03:41
np
Michelle
@Michelle2016
Feb 07 2016 03:41
@minminimal I may have to put you on 'speed dial'!
FarionLord
@FarionLord
Feb 07 2016 03:41
also thank you for the brownie so here have some @Michelle2016
CamperBot
@camperbot
Feb 07 2016 03:41
farionlord sends brownie points to @michelle2016 :sparkles: :thumbsup: :sparkles:
:star: 118 | @michelle2016 | http://www.freecodecamp.com/michelle2016
leanminmachine
@leanminmachine
Feb 07 2016 03:41
yeah feel free to ask for jquery / web stuff lol
Michelle
@Michelle2016
Feb 07 2016 03:42
@minminimal #target1 inherits the others but I wasn't realizing that until you showed me.
leanminmachine
@leanminmachine
Feb 07 2016 03:42
dying from intermediate algorithms :(
Michelle
@Michelle2016
Feb 07 2016 03:42
@FarionLord Hey I really appreciate that! Thank you!
CamperBot
@camperbot
Feb 07 2016 03:42
michelle2016 sends brownie points to @farionlord :sparkles: :thumbsup: :sparkles:
:warning: michelle2016 already gave farionlord points
FarionLord
@FarionLord
Feb 07 2016 03:42
np
Michelle
@Michelle2016
Feb 07 2016 03:42
Intermediate algorithms????
FarionLord
@FarionLord
Feb 07 2016 03:43
@minminimal maybe the link that I sent might help?
MuhammadSakhi
@MuhammadSakhi
Feb 07 2016 03:43
how can i implement two classes in image element
FarionLord
@FarionLord
Feb 07 2016 03:43
might be there....
space
@MuhammadSakhi
hmm maybe something like this
leanminmachine
@leanminmachine
Feb 07 2016 03:43
yeah ill check it out @FarionLord
MuhammadSakhi
@MuhammadSakhi
Feb 07 2016 03:44
can u please write the code farionlord
FarionLord
@FarionLord
Feb 07 2016 03:44
<img src="http://bit.ly/fcc-running-cats" class="img-responsive" class="random">
leanminmachine
@leanminmachine
Feb 07 2016 03:44
<img class="class1 class2"></img>
FarionLord
@FarionLord
Feb 07 2016 03:45
yep forgot the ending
thanks @minminimal
CamperBot
@camperbot
Feb 07 2016 03:45
farionlord sends brownie points to @minminimal :sparkles: :thumbsup: :sparkles:
:star: 106 | @minminimal | http://www.freecodecamp.com/minminimal
leanminmachine
@leanminmachine
Feb 07 2016 03:45
i think you can do it as "img-responsive random" too?
FarionLord
@FarionLord
Feb 07 2016 03:46
err I just wrote the second class cause I needed an exaple so I just use random....
Michelle
@Michelle2016
Feb 07 2016 03:46
@minminimal Yes I believe that is correct.
FarionLord
@FarionLord
Feb 07 2016 03:46
Maybe I should use "something".
or "example"... well.
Michelle
@Michelle2016
Feb 07 2016 03:47
I mean that the classes can be within the quotes like that.
FarionLord
@FarionLord
Feb 07 2016 03:48
You know nuthing @Michelle2016
LatashaH
@LatashaH
Feb 07 2016 03:48

iCantSetMyImah

FarionLord
@FarionLord
Feb 07 2016 03:48
meme (10/4)
MuhammadSakhi
@MuhammadSakhi
Feb 07 2016 03:48
<img class="smaller-image" class="thick -green-border" src="https://bit.ly/fcc-relaxing-cat"> i write this but it is not working
LatashaH
@LatashaH
Feb 07 2016 03:49
Sorry abt that I cant make my image smaller...can anyone help?
FarionLord
@FarionLord
Feb 07 2016 03:49
FarionLord FarionLord your friendly neighbor FarionLord
try src first @MuhammadSakhi
err
<img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat">
MuhammadSakhi
@MuhammadSakhi
Feb 07 2016 03:50
thanks farionlord
FarionLord
@FarionLord
Feb 07 2016 03:51
np also if it does not work tell me the exercise name.
LatashaH
@LatashaH
Feb 07 2016 03:55
Can someone help me with the Size Your image exercise...I am stuck on how to do it.
Jacob Andra
@jacob4
Feb 07 2016 03:55
@MuhammadSakhi use @FarionLord
Jineen Williams
@jineen22
Feb 07 2016 03:55
How do you create a button with html?
Jacob Andra
@jacob4
Feb 07 2016 03:55
to give brownie points for helping :)
Michelle
@Michelle2016
Feb 07 2016 03:55
Yes @LatashaH
Jacob Andra
@jacob4
Feb 07 2016 03:56
@jineen22 <button>Submit</button>
LatashaH
@LatashaH
Feb 07 2016 03:56
Ok @Michelle2016
Jineen Williams
@jineen22
Feb 07 2016 03:56
@jacob4 thank you
CamperBot
@camperbot
Feb 07 2016 03:56
jineen22 sends brownie points to @jacob4 :sparkles: :thumbsup: :sparkles:
:star: 402 | @jacob4 | http://www.freecodecamp.com/jacob4
Jacob Andra
@jacob4
Feb 07 2016 03:56
@jineen22 yw
Michelle
@Michelle2016
Feb 07 2016 03:56
You have to put a class in your image tag yes? @LatashaH
LatashaH
@LatashaH
Feb 07 2016 03:57
Yes. I think so. @Michelle2016
Michelle
@Michelle2016
Feb 07 2016 03:57
<img class="smaller-image"></img> @LatashaH
Then up in your style tags
LatashaH
@LatashaH
Feb 07 2016 03:57
Ok. Let me try it.
MuhammadSakhi
@MuhammadSakhi
Feb 07 2016 03:58
<img src="https://bit.ly/fcc-relaxing-cat" class="smaller-image thick -green-border"> It does not work also.Excercise 23 Add borders around your elements. farionlord
Michelle
@Michelle2016
Feb 07 2016 03:58
@LatashaH <style>
.smaller-image{
width:100px;
}
@FarionLord play nice :)
@LatashaH How is it going?
LatashaH
@LatashaH
Feb 07 2016 04:03
Ok. Im on my phone doing this....so the class thing yay...but it only did it half way now they r saying the image needs to be 100 px? How do I do that?
@Michelle2016
Michelle
@Michelle2016
Feb 07 2016 04:03
@LatashaH <style>
.smaller-image{
width:100px;
}
@LatashaH This will be up top in your style tag.
LatashaH
@LatashaH
Feb 07 2016 04:04
Urgh... Ok...I did that first but it wasnt at the top.
@Michelle2016
Michelle
@Michelle2016
Feb 07 2016 04:04
Your style tag wasn't near the top?
It is towards the top, yes? @LatashaH
LatashaH
@LatashaH
Feb 07 2016 04:05
The style tag was near the top but I put the notation of the image at the bottom of the list of everything else.
Michelle
@Michelle2016
Feb 07 2016 04:06
The img tag can be wherever when you name a class within that tag and you list that class up in your style tags...it will change the img tag accordingly. @LatashaH

Like the <img> tag can be located at the bottom of all of your other code but once you name a class in it class="some-class" and then list that as an item in your style tags

<style>
.some-class{
}
Then whatever you between those curly brackets will apply to that image tag. @LatashaH

LatashaH
@LatashaH
Feb 07 2016 04:10
Ok the whe
Angelo Kwek
@angelokwek
Feb 07 2016 04:10

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

img {
.smaller-image {
width: 100px;
}
}
</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>

LatashaH
@LatashaH
Feb 07 2016 04:10
Ok the width thing is not working now in side the style tags
Angelo Kwek
@angelokwek
Feb 07 2016 04:11
your img element should have class smaller-image
your image should be 100 pixels wide
James
@jdd76
Feb 07 2016 04:11
hello can't get the back ground of the first div to be grey. It is listed as <div class="gray-background"> in the style tag i have it set as .gray-background { background-color: gray; } but it is not adding a gray background What am I missing. I am familiar with the whole html and css but I am use to using external style sheets. I know it is something simple???
Michelle
@Michelle2016
Feb 07 2016 04:11
See in your style section where you have img{
take that out @LatashaH
img {
.smaller-image {
width: 100px;
}
instead it should be:
.smaller-image{
then :
width:100px;
@LatashaH
.smaller-image{
width:100px;
}
You see?
Max Gardner
@maxgardner
Feb 07 2016 04:14
@jdd76 Can you post your current code?
Angelo Kwek
@angelokwek
Feb 07 2016 04:14
i dont see the difference @Michelle2016
Michelle
@Michelle2016
Feb 07 2016 04:14
@LatashaH you don't have to put the img up there in your style tags because you are referencing it by using the class name.
@angelokwek Latasha had
img{
.smaller-image{
and I told her to take out the img{...you see?
LatashaH
@LatashaH
Feb 07 2016 04:16
Ok I am looking at u @Michelle2016
James
@jdd76
Feb 07 2016 04:16
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
Michelle
@Michelle2016
Feb 07 2016 04:17
@LatashaH did it work?
Angelo Kwek
@angelokwek
Feb 07 2016 04:17

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


.smaller-image {
width: 100px;

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

still not working for me @Michelle2016
Michelle
@Michelle2016
Feb 07 2016 04:18
@LatashaH ...look down at your <img> tag
LatashaH
@LatashaH
Feb 07 2016 04:18
Nope @Michelle2016
Max Gardner
@maxgardner
Feb 07 2016 04:19
@jdd76 Can you post the whole code? I only got the first line. What you originally put looks OK, so there may be an issue elsewhere
LatashaH
@LatashaH
Feb 07 2016 04:19
Ok @Michelle2016
Michelle
@Michelle2016
Feb 07 2016 04:20
@LatashaH you haven't named a class here <img src="https://bit.ly/fcc-relaxing-cat">
<img class="smaller-image" src="https://bit.ly/fcc-relaxing-cat"></img>
James
@jdd76
Feb 07 2016 04:20
I deleted the the div and the style attributes and redone it now it works.lol
Even thought I wrote it the same way go figure
Max Gardner
@maxgardner
Feb 07 2016 04:21
Weird haha, maybe it was just a slight typo somewhere. That happens all the time to me. One letter slightly off or something
Michelle
@Michelle2016
Feb 07 2016 04:23
@LatashaH is it working now?
LatashaH
@LatashaH
Feb 07 2016 04:24
No @Michelle2016
Max Gardner
@maxgardner
Feb 07 2016 04:25

I’m having a little trouble understanding something in the “Accessing Object Properties with Variables” challenge. Why do you define a variable with a string, but then when you reference that in the second variable, you don’t need the quotations? Example:

var someProp = "propName";
var myObj = {
  propName: "Some Value"
}
myObj[someProp]; // "Some Value”

Why is propName a string when you first define it, but then it’s not a string when you reference it while declaring myObj?

Michelle
@Michelle2016
Feb 07 2016 04:25
@LatashaH can you post your code again please?
LatashaH
@LatashaH
Feb 07 2016 04:27

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

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

<img class="smaller-image"

{width: 100px;}
>

</img>

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

Scott Brenner
@ScottBrenner
Feb 07 2016 04:27
wiki format
CamperBot
@camperbot
Feb 07 2016 04:27

: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

Michelle
@Michelle2016
Feb 07 2016 04:28
Take out :<img class="smaller-image" {width: 100px;} >
</img> @LatashaH
Then...you put the class name here:
<img class="smaller-image" src="https://bit.ly/fcc-relaxing-cat">

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

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

<h2 class="red-text">CatPhotoApp</h2>
<img class="smaller-image" 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>

@LatashaH you see?
Scott Brenner
@ScottBrenner
Feb 07 2016 04:31
@maxgardner If I understand your question correctly, myObj[someProp] accesses the someProp property of myObj, which doesn't exist?
LatashaH
@LatashaH
Feb 07 2016 04:33
Where is the change because now I have two 🐱 pics
Scott Brenner
@ScottBrenner
Feb 07 2016 04:33
I don't think making someProp = "propName" will make myObj[someProp] referrence the propName property of myObj, but I may be wrong.
LatashaH
@LatashaH
Feb 07 2016 04:33
@Michelle2016
Michelle
@Michelle2016
Feb 07 2016 04:33
@LatashaH look at your code...do you now have two separate image tags?
@LatashaH look at my copy of your code. There should only be the one image tag.
Max Gardner
@maxgardner
Feb 07 2016 04:37
@ScottBrenner That’s what I thought, but that’s what’s happening with this. I’m just confused as to how “propName” is linked to propName in this. I don’t get why you don’t need quotations when you use it while declaring the myObj variable
Alister Najib Mada
@alistermada
Feb 07 2016 04:37
@maxgardner You can think of object properties (such as propName in myObj) as variables that are attached to an object. You can access propName's value with myObj["propName"]. myObj[someProp]evaluates to myObj["propName"] because the string "propName" was assigned to the variable someProp.
Michelle
@Michelle2016
Feb 07 2016 04:38
@LatashaH How is it coming along?
Max Gardner
@maxgardner
Feb 07 2016 04:41
@alistermada So if you assign a string to a variable and then attach that string to an object, you don’t need to use quotations for it to recognize it as the same string you’ve defined? Maybe I’m overthinking this and worrying too much about the quotations, but it just seems like those small details can be a big deal in Javascript
Maybe it’d help if I tried looking at it from a different angle. So what if you had that same scenario, right, but it was like this:
var someProp = “This is a string";
var myObj = {
  This is a string: "Some Value"
}
myObj[someProp]; // "Some Value”
Would that technically spit out the same result? Or am I confusing what these elements are?
Michelle
@Michelle2016
Feb 07 2016 04:43
@angelokwek How is yours coming along?
Alister Najib Mada
@alistermada
Feb 07 2016 04:43
@maxgardner That would not work, as property names can't have spaces
LatashaH
@LatashaH
Feb 07 2016 04:43
I saw it @Michelle2016. You put the class image on the top inside the style link and outside and you wrapped the link inside the class in the style section .
Alister Najib Mada
@alistermada
Feb 07 2016 04:44
@maxgardner However, "This is a string" is a valid property name. propName didn't need quotes as it didn't have any spaces, just letters
Michelle
@Michelle2016
Feb 07 2016 04:45
I put the .smaller-image{
}
up in your style tags and then I added the class="smaller-image" to your img tag. @LatashaH
Max Gardner
@maxgardner
Feb 07 2016 04:46
@alistermada OK, that makes sense. So in that first example, is “propName” technically still a string when it’s being assigned to someProp? Or would it be called something else?
LatashaH
@LatashaH
Feb 07 2016 04:46
I ended copying and pasting it but now I see that I didnt put the smaller image ifself as an element/class...then being able to define the shape size late
Michelle
@Michelle2016
Feb 07 2016 04:46
Oh I wrote two different messages to you @LatashaH ! I see the one was the image tag by itself and then I copied your code starting with the <link> tag!! @LatashaH so I am sorry if it looked like there should be two img tags.

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

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

<h2 class="red-text">CatPhotoApp</h2>
<img class="smaller-image" 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>
@LatashaH

LatashaH
@LatashaH
Feb 07 2016 04:47
Its cool. I fixed it later. @Michelle2016
Alister Najib Mada
@alistermada
Feb 07 2016 04:47
@maxgardner Yea, "propName" is a string literal. someProp can be considered a string or a variable that evaluates to a string
Michelle
@Michelle2016
Feb 07 2016 04:48
@LatashaH so here you see that it starts with your link tag and then it is named in your style section and you put the class= within your image tag.
@LatashaH This is awesome how we can help each other. :)
Pat Lee
@pleedesigner
Feb 07 2016 04:49
how to nest all of our HTML in a div element with the class container-fluid?
Max Gardner
@maxgardner
Feb 07 2016 04:49
@alistermada Ah ok. So if you attach a string that doesn’t contain spaces to an object, you don’t need to use quotes to ensure it’s referring to that original string?
Michelle
@Michelle2016
Feb 07 2016 04:50
<div class="container-fluid"> @pleedesigner
Scott Brenner
@ScottBrenner
Feb 07 2016 04:50
@pleedesigner Easy! Create a <div> element with class "container-fluid" and put everything inside it!
LatashaH
@LatashaH
Feb 07 2016 04:50
Now I see it. @Michelle2016. U put the link inside of the img class and named it smaller image so I could later define it. Ahhh.
Michelle
@Michelle2016
Feb 07 2016 04:50
@pleedesigner you put the div tag above your html tags so that they are all included within that div tag. Don't forget to put the end div tag at the bottom. </div>
Pat Lee
@pleedesigner
Feb 07 2016 04:51
@Michelle2016 i did. but its not working
Michelle
@Michelle2016
Feb 07 2016 04:51
@LatashaH Yes :)
@pleedesigner can you show us your code please?
LatashaH
@LatashaH
Feb 07 2016 04:51
This is crazy. Smh. Thx @Michelle2016
CamperBot
@camperbot
Feb 07 2016 04:51
latashah sends brownie points to @michelle2016 :sparkles: :thumbsup: :sparkles:
:star: 122 | @michelle2016 | http://www.freecodecamp.com/michelle2016
Alister Najib Mada
@alistermada
Feb 07 2016 04:51
@maxgardner Well, since myObj[someProp] evaluates to myObj["propName"], you are in essence using quotes. However, you can also access propName's value using dot notation: myObj.propName
Pat Lee
@pleedesigner
Feb 07 2016 04:52
@Michelle2016 sure, how do i show u the code?
Scott Brenner
@ScottBrenner
Feb 07 2016 04:52
explain format
CamperBot
@camperbot
Feb 07 2016 04:52

: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

Michelle
@Michelle2016
Feb 07 2016 04:52
@LatashaH You are very welcome. :)
Alister Najib Mada
@alistermada
Feb 07 2016 04:52
@maxgardner You wouldn't be able to use dot notation for a property like "This is a string".
Max Gardner
@maxgardner
Feb 07 2016 04:53
@alistermada Ahh OK, I think I'm finally getting it. Thank you for walking through that with me!
CamperBot
@camperbot
Feb 07 2016 04:53
maxgardner sends brownie points to @alistermada :sparkles: :thumbsup: :sparkles:
:star: 366 | @alistermada | http://www.freecodecamp.com/alistermada
Michelle
@Michelle2016
Feb 07 2016 04:53
@pleedesigner You can highlight your code and then right click on it and choose copy then come back here into your chat bar and right click and choose paste.
LatashaH
@LatashaH
Feb 07 2016 04:53
Wow... Chelle ( hopefully u dont mind this) you got 120+ down your belt Okayee
Alister Najib Mada
@alistermada
Feb 07 2016 04:53
@maxgardner Glad I could help
LatashaH
@LatashaH
Feb 07 2016 04:53
@Michelle2016
Pat Lee
@pleedesigner
Feb 07 2016 04:53
<div clss="container-fluid">
  <h2 class="red-text">CatPhotoApp</h2>

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

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

<p>Things cats love:</p>
<ul>
  <li>cat nip</li>
  <li>laser pointers</li>
  <li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
  <li>flea treatment</li>
  <li>thunder</li>
  <li>other cats</li>
</ol>
<form action="/submit-cat-photo">
  <label><input type="radio" name="indoor-outdoor"> Indoor</label>
  <label><input type="radio" name="indoor-outdoor"> Outdoor</label>
  <label><input type="checkbox" name="personality"> Loving</label>
  <label><input type="checkbox" name="personality"> Lazy</label>
  <label><input type="checkbox" name="personality"> Crazy</label>
  <input type="text" placeholder="cat photo URL" required>
  <button type="submit">Submit</button>
</form>
</div>
Michelle
@Michelle2016
Feb 07 2016 04:54
@LatashaH I definitely don't mind at all. :)
Scott Brenner
@ScottBrenner
Feb 07 2016 04:54
@pleedesigner Typo alert! Check the first line..
Pat Lee
@pleedesigner
Feb 07 2016 04:54
@ScottBrenner thanks, let me check
CamperBot
@camperbot
Feb 07 2016 04:54
pleedesigner sends brownie points to @scottbrenner :sparkles: :thumbsup: :sparkles:
:star: 254 | @scottbrenner | http://www.freecodecamp.com/scottbrenner
Michelle
@Michelle2016
Feb 07 2016 04:54
@pleedesigner you spelled class incorrectly in your div tag.
Pat Lee
@pleedesigner
Feb 07 2016 04:54
haha i see
@Michelle2016 @ScottBrenner thank you guys
CamperBot
@camperbot
Feb 07 2016 04:55
pleedesigner sends brownie points to @michelle2016 and @scottbrenner :sparkles: :thumbsup: :sparkles:
:warning: pleedesigner already gave scottbrenner points
:star: 123 | @michelle2016 | http://www.freecodecamp.com/michelle2016
Scott Brenner
@ScottBrenner
Feb 07 2016 04:55
:thumbsup:
Michelle
@Michelle2016
Feb 07 2016 04:55
@pleedesigner it is soooo easy to do that, we have all done it. :)
@pleedesigner That is why it is helpful to show your code.
Pat Lee
@pleedesigner
Feb 07 2016 04:56
:)
LatashaH
@LatashaH
Feb 07 2016 04:59
Ok @Michelle2016. How do you put a class within a class?
Michelle
@Michelle2016
Feb 07 2016 05:00
@LatashaH class="class1 class2"
No commas are needed and they can both be in the same " "
LatashaH
@LatashaH
Feb 07 2016 05:00
Ok.
Michelle
@Michelle2016
Feb 07 2016 05:00
:)
so for example <img class="smaller-image thick-green-border" src="
@LatashaH
Scott Brenner
@ScottBrenner
Feb 07 2016 05:03
This message was deleted
This message was deleted
Michelle
@Michelle2016
Feb 07 2016 05:03
@LatashaH you see?
LatashaH
@LatashaH
Feb 07 2016 05:07
Yes @Michelle2016. So I did it but I cant change anything.
Michelle
@Michelle2016
Feb 07 2016 05:08
You added the second class within your tag...did you then go up into your style section ?
@LatashaH
LatashaH
@LatashaH
Feb 07 2016 05:09
@Michelle2016 yes. But nothing is changing
Dylan Simowitz
@ToxicSalt
Feb 07 2016 05:09
anyone here know react?
Michelle
@Michelle2016
Feb 07 2016 05:09
What did you put in your style tag?
@LatashaH
LatashaH
@LatashaH
Feb 07 2016 05:10
This is the class tag:

>

<img class="class1" "class2" >

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

Michelle
@Michelle2016
Feb 07 2016 05:10
<img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat">
LatashaH
@LatashaH
Feb 07 2016 05:10
.thick-green-border{
border-color: green;
border-width: 10px;
border-style: solid;
Sam Felder
@sf8193
Feb 07 2016 05:10
This code puts the like icon inside the like button but it doesnt complete the test for "Add Font Awesome Icons to our Buttons"<button class="btn btn-block btn primary">Like
<i class="fa fa-thumbs-up"></i>
</button>
anyone know what i’m doing wrong?
Michelle
@Michelle2016
Feb 07 2016 05:11
@LatashaH <img class="smaller-image" "thick-green-border" src="https://bit.ly/fcc-relaxing-cat">
LatashaH
@LatashaH
Feb 07 2016 05:11
Thats the style tag @
@Michelle2016
Michelle
@Michelle2016
Feb 07 2016 05:12
@LatashaH do you see how I changed the img tag?
@LatashaH take out<img class="class1" "class2" > that was just for an example. :)
So you will have one img tag @LatashaH and it will be
<img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat">
@sf8193 in your button tag <button class="btn btn-block btn-primary">
@sf8193 You didn't have the dash in your btn-primary
Sam Felder
@sf8193
Feb 07 2016 05:15
wowwwww hahahah thank you @Michelle2016
CamperBot
@camperbot
Feb 07 2016 05:15
sf8193 sends brownie points to @michelle2016 :sparkles: :thumbsup: :sparkles:
:star: 124 | @michelle2016 | http://www.freecodecamp.com/michelle2016
Michelle
@Michelle2016
Feb 07 2016 05:16
@sf8193 You are welcome :)
@LatashaH you see?
@LatashaH you had two sets of quotes for your classes in the image tag
LatashaH
@LatashaH
Feb 07 2016 05:18
@Michelle2016
Yeah I saw it works but still it is not passing the tests @Michelle2016
Michelle
@Michelle2016
Feb 07 2016 05:19
Hmmm can I see your code @LatashaH ?
LatashaH
@LatashaH
Feb 07 2016 05:19

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

.smaller-image {
width: 100px;
}

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

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

<img class="smaller-image""thick-green-border" >

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

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

Michelle
@Michelle2016
Feb 07 2016 05:21
@LatashaH you have two image tags there...take out the first this one:
<img class="smaller-image""thick-green-border" >
Thallyson Barbosa
@ThallysonB
Feb 07 2016 05:21
Map - 35:
<form><input action="/submit-cat-photo"></form>
LatashaH
@LatashaH
Feb 07 2016 05:21
@Michelle2016. Anything
Thallyson Barbosa
@ThallysonB
Feb 07 2016 05:21
Someone could tell where the error is? :worried:
Michelle
@Michelle2016
Feb 07 2016 05:22
@LatashaH you have two image tags there...take out the first this one:
<img class="smaller-image""thick-green-border" >
LatashaH
@LatashaH
Feb 07 2016 05:22
@Michelle2016 ☺😺
Max Gardner
@maxgardner
Feb 07 2016 05:23
@ThallysonB The “action” needs to be attached to the form tag, not the input tag.
LatashaH
@LatashaH
Feb 07 2016 05:23
@camperbot. Where are @Michelle2016 brownie points?
Max Gardner
@maxgardner
Feb 07 2016 05:23
So rather than <form><input action=, you’d have <form action=
@LatashaH You have to @ her and say the magic words
Michelle
@Michelle2016
Feb 07 2016 05:24
@LatashaH I think whenever someone says thanks or thank you the camperbot gives the brownie points?
CamperBot
@camperbot
Feb 07 2016 05:24
michelle2016 sends brownie points to @latashah :sparkles: :thumbsup: :sparkles:
:star: 25 | @latashah | http://www.freecodecamp.com/latashah
Michelle
@Michelle2016
Feb 07 2016 05:25
Ok there they go...thank you @LatashaH
CamperBot
@camperbot
Feb 07 2016 05:25
michelle2016 sends brownie points to @latashah :sparkles: :thumbsup: :sparkles:
:warning: michelle2016 already gave latashah points
CamperBot
@camperbot
Feb 07 2016 05:25
no wiki entry for: httpwwwfreecodecampcomchallengestesting-objects-for-properties
Max Gardner
@maxgardner
Feb 07 2016 05:25
@ThallysonB Were you abel to solve it?
Michelle
@Michelle2016
Feb 07 2016 05:25
Oh how funny I just gave them to you too because I put thank you in the message!
@LatashaH
Herman Fassett
@HermanFassett
Feb 07 2016 05:26
@kmulligan what's your problem ? :)
Kevin Mulligan
@kmulligan
Feb 07 2016 05:27
@HermanFassett I think I need to use some variation of myObj.hasOwnProperty(checkProp)
Thallyson Barbosa
@ThallysonB
Feb 07 2016 05:27

@maxgardner No :worried:

´´´

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

ERROR - Nest your text input element within a form element.
CORRECT - Make sure your form has an action attribute which is set to /submit-cat-photo
CORRECT- Make sure your form element has a closing tag.

Herman Fassett
@HermanFassett
Feb 07 2016 05:27
@kmulligan yeah you'll need to use that, do you have code you've tried? Basically hasOwnProperty will return a boolean so you can use it in an if else statement
Thallyson Barbosa
@ThallysonB
Feb 07 2016 05:28
<form action="/submit-cat-photo"></form>
Kevin Mulligan
@kmulligan
Feb 07 2016 05:28
I had some code, and closed my browser out of frustration :|
Michelle
@Michelle2016
Feb 07 2016 05:28
@maxgardner thank you :)
CamperBot
@camperbot
Feb 07 2016 05:28
michelle2016 sends brownie points to @maxgardner :sparkles: :thumbsup: :sparkles:
:star: 213 | @maxgardner | http://www.freecodecamp.com/maxgardner
LatashaH
@LatashaH
Feb 07 2016 05:28
@Michelle2016 Hilarious!!! Thx! But now this thing wanna act like it does not know me. I placed the border radius size into a class...it doesn't run!
CamperBot
@camperbot
Feb 07 2016 05:28
latashah sends brownie points to @michelle2016 :sparkles: :thumbsup: :sparkles:
:warning: latashah already gave michelle2016 points
Max Gardner
@maxgardner
Feb 07 2016 05:28
@ThallysonB You also need to have a text input element within the form element
Kevin Mulligan
@kmulligan
Feb 07 2016 05:29
@HermanFassett
I tried this and it obviously didn't work
function checkObj(checkProp) {
  // Your Code Here
    var kevin = myObj[checkObj];

  if (myObj.hasOwnProperty(checkProp) === true) {
      return myObj[kevin];
     }
  else { 
  return "Change Me!"; 
  }
}
Brock
@brockwei
Feb 07 2016 05:29
what are ways to filter values [null, 0, "", undefined, and NaN] ?
Michelle
@Michelle2016
Feb 07 2016 05:29
The border radius will go in your style section @LatashaH
LatashaH
@LatashaH
Feb 07 2016 05:29
I know see...

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

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

Kevin Mulligan
@kmulligan
Feb 07 2016 05:30
@HermanFassett I had something earlier where it would return either true or false, but I couldn't figure out how to pull it out of the element, but I can't remember what I had put in now
Herman Fassett
@HermanFassett
Feb 07 2016 05:31
@kmulligan ok, that's the right idea though. You should return the myObj with checkProp, checkObj used in kevin won't be defined like that since that's the function name
Michelle
@Michelle2016
Feb 07 2016 05:31
@LatashaH in the code that you sent there are two .. in front of thick-green-border
@LatashaH there should only be one .thick-green-border
Max Gardner
@maxgardner
Feb 07 2016 05:32
@ThallysonB So in the previous challenge, you created a text input field. You need to now nest that input field within your form tags. That just means you place that text input tag between the opening and closing form tags. So it should look similar in structure to this: <form action=“”><text input></form>
LatashaH
@LatashaH
Feb 07 2016 05:32
@Michelle2016 it is only one. That's my phone. Sry.
Kevin Mulligan
@kmulligan
Feb 07 2016 05:34
@HermanFassett Ok I got it to work. Man I have to sit down and understand the words behind why this works in english
Herman Fassett
@HermanFassett
Feb 07 2016 05:34
Yeah, objects can be especially hard to understand
Kevin Mulligan
@kmulligan
Feb 07 2016 05:34
Twice today I've felt like "apparently js is not for me"
Thallyson Barbosa
@ThallysonB
Feb 07 2016 05:34

@maxgardner Thanks you! :D

Worked:

<form action="/submit-cat-photo"><input type="text"></form>
CamperBot
@camperbot
Feb 07 2016 05:34
thallysonb sends brownie points to @maxgardner :sparkles: :thumbsup: :sparkles:
:star: 214 | @maxgardner | http://www.freecodecamp.com/maxgardner
Michelle
@Michelle2016
Feb 07 2016 05:35
@LatashaH I am looking at it now...
Herman Fassett
@HermanFassett
Feb 07 2016 05:35
@kmulligan everyone probably feels that at one point or another ;) and everyone can do it
Max Gardner
@maxgardner
Feb 07 2016 05:35
@ThallysonB Awesome! Glad I could help
Kevin Mulligan
@kmulligan
Feb 07 2016 05:35
Thanks @HermanFassett
CamperBot
@camperbot
Feb 07 2016 05:35
kmulligan sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 1545 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Max Gardner
@maxgardner
Feb 07 2016 05:35
@kmulligan I think that at least every few challenges.
It’ll be going really well and then I’ll hit one that makes me question everything haha
Michelle
@Michelle2016
Feb 07 2016 05:37
@LatashaH can you show the rest? Like lower where the img tag is?
Kevin Mulligan
@kmulligan
Feb 07 2016 05:38
@maxgardner same thing
Atlas
@AtlasInteractive
Feb 07 2016 05:38
mew
Kevin Mulligan
@kmulligan
Feb 07 2016 05:38
Is there any way I can store some of the code solutions I come up with to potentially go back and review?
Herman Fassett
@HermanFassett
Feb 07 2016 05:39
@kmulligan the lesson/challenge solutions you come up with should be stored in localstorage and on your profile
Michelle
@Michelle2016
Feb 07 2016 05:39
Your style section looks good @LatashaH
Kevin Mulligan
@kmulligan
Feb 07 2016 05:40
@HermanFassett Hmmm I feel like I've gone back and looked at some and they've been blank
Maybe because I switched computers?
Herman Fassett
@HermanFassett
Feb 07 2016 05:40
@kmulligan yeah possibly or if you clear your cache
But even then, you can view it all on your profile by clicking View Solution for the different challenges
LatashaH
@LatashaH
Feb 07 2016 05:42

@Michelle2016 <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: 10px;
}



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

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

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

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

<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p

Michelle
@Michelle2016
Feb 07 2016 05:43
Your last p tag is missing the > it should be </p>
@LatashaH
LatashaH
@LatashaH
Feb 07 2016 05:45
Ok its there. But the code is not running @Michelle2016
dontcallmecapn
@dontcallmecapn
Feb 07 2016 05:45
testing;
LatashaH
@LatashaH
Feb 07 2016 05:47

@Michelle2016. What am I missing now? <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: 10px;
}



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

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

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

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

Michelle
@Michelle2016
Feb 07 2016 05:48
@LatashaH maybe I'm getting sleepy but I can't see any errors here.
@LatashaH I will keep looking though.
LatashaH
@LatashaH
Feb 07 2016 05:49
Is it me? Because they said it could have multiple answers. @Michelle2016
Brian
@sludge256
Feb 07 2016 05:51
What's the challenge name?
Michelle
@Michelle2016
Feb 07 2016 05:51
@LatashaH How could it have multiple answers?
LatashaH
@LatashaH
Feb 07 2016 05:51
"Note: this waypoint allows for multiple possible solutions. For example, you may add border-radius to either the .thick-green-border class or .smaller-image class."
I'm quoting the exercise @Michelle2016
Michelle
@Michelle2016
Feb 07 2016 05:52
what is the actual task? @LatashaH like what do they want you to do here? border-radius?
arjunpunnam
@arjunpunnam
Feb 07 2016 05:52
can someone help me here
<div class = "row">
<div calss = "col-xs-4">
<button class="btn btn-block btn-primary">Like</button>
</div>
<div calss = "col-xs-4">
<button class="btn btn-block btn-info">Info</button>
</div>
<div calss = "col-xs-4">
<button class="btn btn-block btn-danger">Delete</button>
</div>
</div>
Brian
@sludge256
Feb 07 2016 05:53
@LatashaH try refreshing the page
the last code you posted works fine
Michelle
@Michelle2016
Feb 07 2016 05:53
@arjunpunnam <div calss = "col-xs-4">
LatashaH
@LatashaH
Feb 07 2016 05:53
@Michelle2016. Yes.
Michelle
@Michelle2016
Feb 07 2016 05:54
@LatashaH did you refresh the page and try to submit it again?
arjunpunnam
@arjunpunnam
Feb 07 2016 05:54
oh shit!
@LatashaH thanks
CamperBot
@camperbot
Feb 07 2016 05:54
arjunpunnam sends brownie points to @latashah :sparkles: :thumbsup: :sparkles:
Michelle
@Michelle2016
Feb 07 2016 05:54
@arjunpunnam :)
CamperBot
@camperbot
Feb 07 2016 05:54
:star: 26 | @latashah | http://www.freecodecamp.com/latashah
arjunpunnam
@arjunpunnam
Feb 07 2016 05:54
:)
@Michelle2016 I watched it for five minutes and couldn't figure
Michelle
@Michelle2016
Feb 07 2016 05:55
@LatashaH your code looks fine but it may not be fulfilling the task ?
@arjunpunnam I know..it is sooo easy to do and sooooo hard to catch because we may write it wrong but we see what we meant not what we wrote. :)
LatashaH
@LatashaH
Feb 07 2016 05:56

@Michelle2016 Ok. This is the task. Your cat photo currently has sharp corners. We can round out those corners with a CSS property called border-radius.

You can specify a border-radius with pixels. Give your cat photo a border-radius of 10px.

Note: this waypoint allows for multiple possible solutions. For example, you may add border-radius to either the .thick-green-border class or .smaller-image class.

Brian
@sludge256
Feb 07 2016 05:57
The last code you posted worked fine
I copy pasted and it passed
arjunpunnam
@arjunpunnam
Feb 07 2016 05:57
@Michelle2016 Exactly we cant judge us
LatashaH
@LatashaH
Feb 07 2016 05:57
@sludge256 😕
Michelle
@Michelle2016
Feb 07 2016 05:57
@LatashaH you wrote the border-radius properly.
@arjunpunnam true :)
@LatashaH maybe try taking it out of thick-green-border and placing it within .smaller-image just to see?
LatashaH
@LatashaH
Feb 07 2016 06:00
I did. @Michelle2016. Still didnt work. But I'll try again
Nope. @Michelle2016, It did not work. :(
Brian
@sludge256
Feb 07 2016 06:02
Did you try refreshing like we mentioned?
LatashaH
@LatashaH
Feb 07 2016 06:02
Yes.
Brian
@sludge256
Feb 07 2016 06:02
What browser/os?
Michelle
@Michelle2016
Feb 07 2016 06:02
@LatashaH @sludge256 Hmmmm
LatashaH
@LatashaH
Feb 07 2016 06:06
Im on chrome on my phone...an android. But this time I refreshed and cleared my code it still didnt work. @Michelle2016 @sludge256
Brian
@sludge256
Feb 07 2016 06:07
Alright instead of a refresh can you close the browser app completely then try?
LatashaH
@LatashaH
Feb 07 2016 06:08
Cool.
Michelle
@Michelle2016
Feb 07 2016 06:08
@LatashaH It worked?
sankar244
@sankar244
Feb 07 2016 06:10
hi! ihave buggs in create check boxes
can u help me?
chaitanya ashtekar
@chaitanyaashtekar
Feb 07 2016 06:10
@sankar244 waypoint ?
@
Michelle
@Michelle2016
Feb 07 2016 06:11
@LatashaH @sludge256 I am turning in for the night. :)
Brian
@sludge256
Feb 07 2016 06:12
@Michelle2016 :wave:
Michelle
@Michelle2016
Feb 07 2016 06:13
@sludge256 wave back at you!
@LatashaH good night :)
LatashaH
@LatashaH
Feb 07 2016 06:13
Bye @Michelle2016
Thanks so much @Michelle2016
CamperBot
@camperbot
Feb 07 2016 06:14
latashah sends brownie points to @michelle2016 :sparkles: :thumbsup: :sparkles:
:star: 127 | @michelle2016 | http://www.freecodecamp.com/michelle2016
Michelle
@Michelle2016
Feb 07 2016 06:14
@LatashaH You are very welcome! :)
LatashaH
@LatashaH
Feb 07 2016 06:15
@sludge256 Are you still here?
Brian
@sludge256
Feb 07 2016 06:15
Did it not work?
LatashaH
@LatashaH
Feb 07 2016 06:15
Nope.
Do I just call it a bug or no?
Brian
@sludge256
Feb 07 2016 06:16
No access to a computer?
LatashaH
@LatashaH
Feb 07 2016 06:16
I do have access to a computer...it just was easier on the phone.
Brian
@sludge256
Feb 07 2016 06:17
I'll test it on my phone
Well I don't hear that everyday
I would assume most people prefer coding on their computers :P
LatashaH
@LatashaH
Feb 07 2016 06:17
Ha! Perhaps saying it was more convenient because I was already on my phone all day now.
..Is more accurate
Quite honestly, I was I had a tablet. :)
I wish
Parameswara Rao Ganta
@pganta67
Feb 07 2016 06:19
how to fix image size
Franco Zapata
@Francozt01
Feb 07 2016 06:21
@pganta67 challenge?
Brian
@sludge256
Feb 07 2016 06:21
@LatashaH Just passed for me with Chrome on Android
with your code
LatashaH
@LatashaH
Feb 07 2016 06:23
Really?
Brian
@sludge256
Feb 07 2016 06:23
Do it on your computer and move on with your life
your code was fine :+1:
LatashaH
@LatashaH
Feb 07 2016 06:24

<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: 10px;
}

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

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

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

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

Thanks. :)
@sludge256. Thanks.
CamperBot
@camperbot
Feb 07 2016 06:24
latashah sends brownie points to @sludge256 :sparkles: :thumbsup: :sparkles:
:star: 1334 | @sludge256 | http://www.freecodecamp.com/sludge256
Sri Keerthi N
@keerthinerella
Feb 07 2016 06:30
How to do this??? can anyone help me..!
Use the jQuery addClass() function to give the classes animated and shake to all your elements with the class well.
what to be done with class well here?
cannelflow
@cannelflow
Feb 07 2016 06:31
@keerthinerella which exercise?
Jineen Williams
@jineen22
Feb 07 2016 06:32
Call the se
Sri Keerthi N
@keerthinerella
Feb 07 2016 06:32
111
Jineen Williams
@jineen22
Feb 07 2016 06:32
Selector first
cannelflow
@cannelflow
Feb 07 2016 06:33
@keerthinerella name
Sri Keerthi N
@keerthinerella
Feb 07 2016 06:33
Target elements by class using jquery
Jineen Williams
@jineen22
Feb 07 2016 06:33
That's you're trying to change for example $("#left-well").addClass("animated shake")
cannelflow
@cannelflow
Feb 07 2016 06:34
@keerthinerella pls tag name while conversation
Sri Keerthi N
@keerthinerella
Feb 07 2016 06:34
ok @cannelflow
cannelflow
@cannelflow
Feb 07 2016 06:35
@keerthinerella try reading instruction again i sure you will get it

@keerthinerella First, let's target your div elements with the class well by using the $(".well") selector.

Note that, just like with CSS declarations, you type a . before the class's name.

Then use jQuery's .addClass() function to add the classes animated and shake.

For example, you could make all the elements with the class text-primary shake by adding the following to your document ready function:

$(".text-primary").addClass("animated shake");

Sri Keerthi N
@keerthinerella
Feb 07 2016 06:37
got it now..thank you @cannelflow
CamperBot
@camperbot
Feb 07 2016 06:37
keerthinerella sends brownie points to @cannelflow :sparkles: :thumbsup: :sparkles:
:star: 742 | @cannelflow | http://www.freecodecamp.com/cannelflow
Sri Keerthi N
@keerthinerella
Feb 07 2016 06:37
:)
cannelflow
@cannelflow
Feb 07 2016 06:39
@keerthinerella :+1:
maldonadoalex01
@maldonadoalex01
Feb 07 2016 06:49
who can help me how to remove the style attribute from h2 element ?
Austin West
@scienceoflife
Feb 07 2016 06:51
@maldonadoalex01 you just remove the part that says style=""
maldonadoalex01
@maldonadoalex01
Feb 07 2016 06:55
what about css selector? @scienceoflife
Brian
@sludge256
Feb 07 2016 06:55
they might be doing jQuery stuff
Austin West
@scienceoflife
Feb 07 2016 06:56
remove the h2 {} part @maldonadoalex01
cun3
@cun3
Feb 07 2016 06:56
Guys, Im stuck with a question
Jineen Williams
@jineen22
Feb 07 2016 06:56
I believe you can do $("h2").removeHTML("style")
Brian
@sludge256
Feb 07 2016 06:56
Sounds like I might be wrong though
cun3
@cun3
Feb 07 2016 06:56

We have an array of objects representing different people in our contacts lists.

A lookUp function that takes firstName and a property (prop) as arguments has been pre-written for you.

The function should check if firstName is an actual contact's firstName and the given property (prop) is a property of that contact.

If both are true, then return the "value" of that property.

If firstName does not correspond to any contacts then return "No such contact"

If prop does not correspond to any valid properties then return "No such property"

Run tests (ctrl + enter)

Austin West
@scienceoflife
Feb 07 2016 06:56
@sludge256 i have no idea, i go with the horse not the zebra, if they meant zebra they slowly learn how to ask the right questions
cun3
@cun3
Feb 07 2016 06:57

And this is my solN so far

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

function lookUp(firstName, prop){
// Only change code below this line
var test=0;
var test2=0;
for(i=0;i<contacts.length;i++) {
if (firstName == contacts[i].firstName){

  test=1;
  if(contacts[i].hasOwnProperty(prop))
    {
      test2=1;
    }
  if (test == 1)
{
  if(test2==1){
    return contacts[i][prop];
  }
}    
}

}

if(test !=1)
{
if (test2 !=1)
{
return "No such property";
}
return "No such contact";
}

// Only change code above this line
}

// Change these values to test your function
lookUp("Kristian", "lastName");

Brian
@sludge256
Feb 07 2016 06:58
@scienceoflife What do we do if it's an Okapi?
okapi
Austin West
@scienceoflife
Feb 07 2016 06:58
haha those are adorable, it looks like giant anteaters wearing zebra socks @sludge256
what is your issue @cun3
cun3
@cun3
Feb 07 2016 07:00
wait, I think I might have found something
looking into it
maldonadoalex01
@maldonadoalex01
Feb 07 2016 07:01
oops, i meant how to create one? @scienceoflife
Austin West
@scienceoflife
Feb 07 2016 07:01
@maldonadoalex01 what challenge are you on? can you send the url?
@cun3 it looks like it works properly for if a firstname/prop match, it looks like you just need a couple else statements if there isnt a match
@scienceoflife
Austin West
@scienceoflife
Feb 07 2016 07:05
did you do as the instructions said and add a style tag
<style>
</style>
@maldonadoalex01
maldonadoalex01
@maldonadoalex01
Feb 07 2016 07:12
no, i dont get it @scienceoflife
Josue Rodriguez
@Rapidisimo
Feb 07 2016 07:14
@maldonadoalex01 Why do you need to remove the style element?
maldonadoalex01
@maldonadoalex01
Feb 07 2016 07:18
to create a css selector? @Rapidisimo
Austin West
@scienceoflife
Feb 07 2016 07:19
@maldonadoalex01 you need to be a little more descriptive. What part dont you understand. The instructions tell you where to add <style> tags, you could copy and paste them if you needed. What part of that process are you having issues with? we might be able to walk you through it
Josue Rodriguez
@Rapidisimo
Feb 07 2016 07:19
So return the h2 to it’s original state which would be like most html tags <h2></h2>
Jineen Williams
@jineen22
Feb 07 2016 07:20
Remove the h2
Style and put it up top the style element
Josue Rodriguez
@Rapidisimo
Feb 07 2016 07:21
@maldonadoalex01 So return the h2 to it’s original state which would be like most html tags <h2></h2>
Jineen Williams
@jineen22
Feb 07 2016 07:21
Instead of the style being in the same tag as the h2 element put the css up top in the style tag.
'''
CamperBot
@camperbot
Feb 07 2016 07:21
:bulb: to format code use backticks! ``` more info
Jineen Williams
@jineen22
Feb 07 2016 07:22
<style>
h2 {color:red;}
</style>
panshao
@jackPanyj
Feb 07 2016 07:27
need help
Math.max.call(null,[1,2,3,4]) return NaN?
Austin West
@scienceoflife
Feb 07 2016 07:32
@jackPanyj .call is to invoke multipe functions/chain constructors
what is the result you are trying to produce
maldonadoalex01
@maldonadoalex01
Feb 07 2016 07:33
i figured it out, thanks.
Alister Najib Mada
@alistermada
Feb 07 2016 07:34
@jackPanyj Math.max() takes numbers as arguments, which is why Math.max.call(null,[1,2,3,4]) returns NaN. If you want to find the largest number in an array, you need to use Math.max.apply()
Hemang Kumar
@hemangsk
Feb 07 2016 07:36

Hi folks! i am doing the "Profile Lookup" challenge, and in console I am getting the correct results but the solution isn't getting accepted, `function lookUp(firstName, prop){
// Only change code below this line

contacts.forEach(function(val){

if(val.firstName==firstName){

    if(val.hasOwnProperty(prop)){
        console.log(val[prop]);
      console.log(val[prop]);
        result= val[prop];
        return result;
    }

} 

});

contacts.forEach(function(val){
if(val.firstName==firstName){
if(val.hasOwnProperty(prop)===false){
return "No such property";
}
}
});

return "No such contact";
// Only change code above this line
}`

this is what I am doing

Austin West
@scienceoflife
Feb 07 2016 07:39
@hemangsk to start out, you shouldnt be doing two contacts.forEach
budimanfix
@budimanfix
Feb 07 2016 07:39

Guys..!! correct my code plz, only one task left : function myTest(val) {
if (val < 4) {
return "Less than 10";
} else if (val < 6) {
return "Less than 5";
} else {
return "Greater than or equal to 10";
}
}

// Change this value to test
myTest(7);

Austin West
@scienceoflife
Feb 07 2016 07:40
the value checking for prop and and first name should be done within at least 1 for loop going through the array
cannelflow
@cannelflow
Feb 07 2016 07:41
@budimanfix which exercise?
Hemang Kumar
@hemangsk
Feb 07 2016 07:41
@scienceoflife thanks! I am changing it to for loop
CamperBot
@camperbot
Feb 07 2016 07:41
hemangsk sends brownie points to @scienceoflife :sparkles: :thumbsup: :sparkles:
:star: 62 | @scienceoflife | http://www.freecodecamp.com/scienceoflife
budimanfix
@budimanfix
Feb 07 2016 07:42
Hemang Kumar
@hemangsk
Feb 07 2016 07:43
@scienceoflife btw , is the reason for not using 2 forEach related to code efficiency ?
Austin West
@scienceoflife
Feb 07 2016 07:44
forEach is generally when you want to perform an action/modification on each item in the array instead of just going through each for a equality check
@hemangsk
even if you were to do it with forEach, you still should have it nested under one, not two
Alister Najib Mada
@alistermada
Feb 07 2016 07:45
@budimanfix You need to change your first if statement (val < 4) so that if val is 6, it would return "Less than 10".
cannelflow
@cannelflow
Feb 07 2016 07:48
@budimanfix first if val<5 say less then 5 then if val<10 say less then then then then else Greater than or equal to 10
budimanfix
@budimanfix
Feb 07 2016 07:50
@cannelflow task: myTest(6) should return "Less than 10"
cannelflow
@cannelflow
Feb 07 2016 07:51
@budimanfix yes show your code
Hemang Kumar
@hemangsk
Feb 07 2016 07:51

@scienceoflife
`
function lookUp(firstName, prop){
// Only change code below this line
var count =0;
for(var i=0 ; i<contacts.length;i++){
if(contacts[i].firstName===firstName){
if(contacts[i].hasOwnProperty(prop)){
console.log(contacts[i][prop]);
return contacts[i][prop];
}
else{
return "No such property";
}
count++;
}

else if(i===contacts.length-1){
return "No such contact";
}
}
// Only change code above this line
} `

Just that "Sherlock , likes" case is failing, in console it shows that return value is equal to ["Intriguing Cases", "Violin"]

cannelflow
@cannelflow
Feb 07 2016 07:52
@budimanfix first if should be of lower value then increase
budimanfix
@budimanfix
Feb 07 2016 07:52
@cannelflow function myTest(val) {
if (val < 10) {
return "Less than 10";
} else if (val < 4) {
return "Less than 5";
} else {
return "Greater than or equal to 10";
}
cannelflow
@cannelflow
Feb 07 2016 07:53

@budimanfix Order is important in if, else if statements.

The loop is executed from top to bottom so you will want to be careful of what statement comes first.

Take these two functions as an example.

Heres the first:

function foo(x) {
if (x < 1) {
return "Less than one";
} else if (x < 2) {
return "Less than two";
} else {
return "Greater than or equal to two";
}
}
And the second just switches the order of the statements:

function bar(x) {
if (x < 2) {
return "Less than two";
} else if (x < 1) {
return "Less than one";
} else {
return "Greater than or equal to two";
}
}
While these two functions look nearly identical if we pass a number to both we get different outputs.

foo(0) // "Less than one"
bar(0) // "Less than two"

orangish6
@orangish6
Feb 07 2016 07:54
What is git push error 403??
Austin West
@scienceoflife
Feb 07 2016 07:55
@hemangsk you have that else if existing in the for loop, so i will always be less than contacts.length. Instead change it to just an else and no if
cannelflow
@cannelflow
Feb 07 2016 07:56
@budimanfix ?
budimanfix
@budimanfix
Feb 07 2016 07:57
@cannelflow thanks :+1:
CamperBot
@camperbot
Feb 07 2016 07:57
budimanfix sends brownie points to @cannelflow :sparkles: :thumbsup: :sparkles:
:star: 744 | @cannelflow | http://www.freecodecamp.com/cannelflow
cannelflow
@cannelflow
Feb 07 2016 07:57
@budimanfix :+1:
orangish6
@orangish6
Feb 07 2016 08:02
How to use git push? Pls help.. I'm not being able to push text files into the repository.. It shows an error each time..
Hemang Kumar
@hemangsk
Feb 07 2016 08:02

@scienceoflife `function lookUp(firstName, prop){

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

}

}

return "No such contact";
}`
I removed else if, and shifted the return statement outside for loop,

Austin West
@scienceoflife
Feb 07 2016 08:03
@hemangsk no, instead as a sibling to the first if should be the else { return no such contact}
Hemang Kumar
@hemangsk
Feb 07 2016 08:06

@scienceoflife ``function lookUp(firstName, prop){

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

}

else{
return "No such contact";
}

}

}

Austin West
@scienceoflife
Feb 07 2016 08:06
@hemangsk does it work?
Hemang Kumar
@hemangsk
Feb 07 2016 08:07
no the first three cases fail
Austin West
@scienceoflife
Feb 07 2016 08:09
So walk through it in your head, follow what happens line by line in your head for different values submitted. See where it breaks
Hemang Kumar
@hemangsk
Feb 07 2016 08:09
if the first contact doesn't have firstName has firstName variable, then it returns No such contact... should i try shifting it outside the for loop? what do you say?
f the first contact doesn't have firstName === firstName variable
*
Austin West
@scienceoflife
Feb 07 2016 08:10
no, pretty much everything should exist in the for loop, as thats where you are going through the list of contacts
Vinícius
@vinicius978
Feb 07 2016 08:13
Can someone help me with the "Add Font Awesome Icons to all of our Buttons" problem?
Hemang Kumar
@hemangsk
Feb 07 2016 08:13
@scienceoflife going to try the dry run..now i will be able to figure it out... thanks a ton to sort this out.. you 're awesome!! :+1: :+1:
CamperBot
@camperbot
Feb 07 2016 08:13
hemangsk sends brownie points to @scienceoflife :sparkles: :thumbsup: :sparkles:
:warning: hemangsk already gave scienceoflife points
cannelflow
@cannelflow
Feb 07 2016 08:14
@vinicius978 tried something
Vinícius
@vinicius978
Feb 07 2016 08:15
When it says You should add a <i></i> class within your delete button element I need to put the button element between the i element or the i between the button element?
Vick003
@Vick003
Feb 07 2016 08:17
@vinicius978 think the <i></i> inbetween the button element but before the word
@vinicius978 you also want to add the proper class to it
to the i element
Austin West
@scienceoflife
Feb 07 2016 08:19
why is <i> being taught by FCC?
Brian
@sludge256
Feb 07 2016 08:19
@scienceoflife It's what Font Awesome uses

From their site:

You can place Font Awesome icons just about anywhere using the CSS Prefix fa and the icon's name. Font Awesome is designed to be used with inline elements (we like the <i> tag for brevity, but using a <span> is more semantically correct).

and here is another related source
https://www.w3.org/International/questions/qa-b-and-i-tags

Abhisek Pattnaik
@abhisekp
Feb 07 2016 08:21
@scienceoflife i as in 'iffel tower is / inclined. i is inclined to icons. So i is used ;)
Shivam sharma
@Shivams334
Feb 07 2016 09:19
what does it mean "Your p element should contain the first few words of the provided additional kitty ipsum text"
can anyone plz tell me
Brian
@sludge256
Feb 07 2016 09:22
put the text inside your p element
<p>blah blah blah insert the text from the instructions here</p>
BAH Chernor bakar
@dokkal
Feb 07 2016 09:24
@Shivams334 like this <p> kitty ipsum dolor</p>
BAH Chernor bakar
@dokkal
Feb 07 2016 09:30
@Shivams334 ?
purvisampat
@purvisampat
Feb 07 2016 09:32
hi
purvisampat
@purvisampat
Feb 07 2016 09:39
hi guyssss
Marina
@chandra90
Feb 07 2016 09:49
help please
CamperBot
@camperbot
Feb 07 2016 09:49

:point_right: bonfire no repeats please [wiki]

Problem Explanation:

  • This task requires us to look at each possible permutation of a string. This is best done using a recursion function. Being able to build a function which collects all permutations of a string is a common interview question, so there is no shortage of tutorials out there on how to do this, in many different code languages.
  • This task can still be daunting even after watching a tutorial. You will want to send each new use of the function 3 inputs: 1. a new string (or character array) that is being built, 2. a position in your new string that's going to be filled next, and 3. an idea of what characters (more specifically positions) from the original string have yet to be used. The pseudo code will look something like this:

    ```
    var str = ???;
    perm(current position in original string, what's been used in original string, current string build thus far){
    if(current string is finished) {
    print current string;
    }else{
    for(var i = 0; i < str.length; i++) {

    if(str[i] has not been used) {
      put str[i] into the current position;
      mark str[i] as used
      perm(current position in original string, what's been used in original string, current string build thus far)
      unmark str[i] as used because another branch in the tree for i + 1 will still likely use it;
    }

    }
    }
    }
    :pencil: read more about bonfire no repeats please on the FCC Wiki

Marina
@chandra90
Feb 07 2016 09:49
<button class="btn btn-block btn-primary fa-thumbs-up"><i class="fa fa-thumbs-up"Like \</button></i>
what's wong here? A task: Your fa-thumbs-up icon should be located within the Like button.
Hector Garcia
@augmt
Feb 07 2016 09:52
@chandra90 you need to close your tags correctly
Marina
@chandra90
Feb 07 2016 09:52
@augmt oops sorry I got it now.
Hector Garcia
@augmt
Feb 07 2016 09:52
look at this part <i class="fa fa-thumbs-up"Like \</button></i>
ok!
Marina
@chandra90
Feb 07 2016 10:15
Sorry , how to do this? "Give the text input in your form the class form-control."
Aleksander Gębicki
@Takumar
Feb 07 2016 10:17
@chandra90 you cannot mix tags, tag which is open first must be closed last:
<p>Some text  <a href="#">Link</a> </p>
Marina
@chandra90
Feb 07 2016 10:18
@Takumar I know
@Takumar I am asking about this "Give the text input in your form the class form-control."
Aleksander Gębicki
@Takumar
Feb 07 2016 10:18
@chandra90 but @augmt showed you, that you mixed them: <button><i></button></i>
@chandra90 oh sorry, you have solved this already :-)
@chandra90 text input is the field which begins with: <input type="text"... you have to apply class form-control to it.
Just as usually add class="NameOfClass" to the tag.
Marina
@chandra90
Feb 07 2016 10:20
@Takumar Thaks
CamperBot
@camperbot
Feb 07 2016 10:20
chandra90 sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
Marina
@chandra90
Feb 07 2016 10:20
*thanks
CamperBot
@camperbot
Feb 07 2016 10:20
:star: 2174 | @takumar | http://www.freecodecamp.com/takumar
Aleksander Gębicki
@Takumar
Feb 07 2016 10:21
@chandra90 I'm glad that I could help :-)
chaitanya ashtekar
@chaitanyaashtekar
Feb 07 2016 10:44

@Takumar binary agent

function binaryAgent(str) {
    str=str.split(" ");

   for(var i=0;i<str.length;i++){
        str[i]=parseInt(str[i],2);
        str[i]=String.fromCharCode(str[i]);
    }                                                 //WORKING EXCEPT FOR '\'
  str=str.join("");
  return str;
}

where did i go wrong ??

Aleksander Gębicki
@Takumar
Feb 07 2016 10:52
@chaitanyaashtekar your code seems good, are you sure you cannot pass with this code?
chaitanya ashtekar
@chaitanyaashtekar
Feb 07 2016 10:53

@Takumar it should output

Aren't bonfires fun!?

instead it is giving Aren\'t bonfires fun!?

chaitanya ashtekar
@chaitanyaashtekar
Feb 07 2016 11:01
Aleksander Gębicki
@Takumar
Feb 07 2016 11:01
@chaitanyaashtekar I have just run your function in FCC and it passes with good results.
Marcos Antônio de Souza Silva
@massilva
Feb 07 2016 11:01
@chaitanyaashtekar what problem is this?
chaitanya ashtekar
@chaitanyaashtekar
Feb 07 2016 11:03
@Takumar ok.thanks. i copy pasted it in fcc and it passed.but why do we have diff output in repl where i solve them. https://repl.it/Bk6f/2
CamperBot
@camperbot
Feb 07 2016 11:03
chaitanyaashtekar sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 2176 | @takumar | http://www.freecodecamp.com/takumar
chaitanya ashtekar
@chaitanyaashtekar
Feb 07 2016 11:03
@massilva i think some bug
Aleksander Gębicki
@Takumar
Feb 07 2016 11:03
@chaitanyaashtekar please use console.log() to display result of your function you will see that everything is correct:
console.log(binaryAgent("01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111"))
@chaitanyaashtekar not bug, repl.it is evaluating your expression and displays your string in single quotation marks, because you have such mark in your string it has to use escape character (backslash) to show you that it is not end of your string but single quotation mark in your sentence! :-)
@chaitanyaashtekar of course, you should tell us better because you are using repl.it :-)
This is good site I think, but I make it old fashioned way local on my computer, maybe wrong.
sb93
@sb93
Feb 07 2016 11:08
profile.PNG
Profile lookup challenge.. can u pls help with the code?
chaitanya ashtekar
@chaitanyaashtekar
Feb 07 2016 11:09
@Takumar yes. maybe i will be to tell after using it like a pro(like you). Till then you will have to help me :laughing: . it worked with console.log.thanks
CamperBot
@camperbot
Feb 07 2016 11:09
chaitanyaashtekar sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
Aleksander Gębicki
@Takumar
Feb 07 2016 11:09
@chaitanyaashtekar keep using this site, because it is good way to share fragments of code, you share with us short link instead of big fragments of code on Gitter.
CamperBot
@camperbot
Feb 07 2016 11:09
:warning: chaitanyaashtekar already gave takumar points
chaitanya ashtekar
@chaitanyaashtekar
Feb 07 2016 11:10
@Takumar yes. and i can test my code using console.log in different lines in repl.i cant do that in fcc.
Aleksander Gębicki
@Takumar
Feb 07 2016 11:10
@sb93 you cannot return "No such contact" before you check every contact on your list (after completing your loop), move this line: return "No such contact"; outside your loop.
@chaitanyaashtekar right, I think you have just encouraged me to use this tool. Thanks.
CamperBot
@camperbot
Feb 07 2016 11:11
takumar sends brownie points to @chaitanyaashtekar :sparkles: :thumbsup: :sparkles:
:star: 312 | @chaitanyaashtekar | http://www.freecodecamp.com/chaitanyaashtekar
chaitanya ashtekar
@chaitanyaashtekar
Feb 07 2016 11:14
honoured :smile:
Aleksander Gębicki
@Takumar
Feb 07 2016 11:16
@sb93 when your first condition is not fullfilled you should check another condition if prop property exists. You can simplify this by dividing your if statement to:
if(firstName === contacts[i][firstName]) {
  if (contacts[i].hasOwnProperty(prop)){
    return contacts[i][prop];
  }
  else {
    return "No such property";
  }
}
@sb93 oh, and next time, please share with us code as text, not as image, it is easier to read and check. You can use repl.it site for bigger fragments of code, because you can share with us short link with your solution.
chaitanya ashtekar
@chaitanyaashtekar
Feb 07 2016 11:18
@Takumar old fashioned way ? meaning writing it in `<script> in the html file ?
@Takumar and saving and checking the output every time in the browser ?
Aleksander Gębicki
@Takumar
Feb 07 2016 11:19
@chaitanyaashtekar or writing it with your favourite editor, save as myFunc.js and then running with node myFunc.js in your terminal.
But of course, you can have template HTML file where you test your code.
chaitanya ashtekar
@chaitanyaashtekar
Feb 07 2016 11:20
@Takumar okay.
sb93
@sb93
Feb 07 2016 11:23

function lookUp(firstName, prop){
// Only change code below this line
for (var i = 0; i < contacts.length; i++){

if(firstName == contacts[i][firstName]){

  if(contacts[i].hasOwnProperty(prop)){
  return contacts[i][prop];
  }
}
else{
  return "No such property";
}

}
if(firstName !== contacts[firstName])
return "No such contact";
}

@Takumar this code is still returning "No such property"
Aleksander Gębicki
@Takumar
Feb 07 2016 11:26
@sb93 you have done it a little wrong, else condition should belong to the second if
@sb93 in your current code, you return "No such property" when you don't find your firstName in current object!
@sb93 your current code is:
if (first object has person with name firstName) {
  // some code
}
else  {
// this means that person has name "Alex" instead of "John"
return "this person has different name";
}
sb93
@sb93
Feb 07 2016 11:29
yeah i just realised i've copied the wrong code here @Takumar ..
And it still returns "No such contact" after the change
Aleksander Gębicki
@Takumar
Feb 07 2016 11:30
@sb93 please don't ask me to correct wrong code, please :-)
@sb93 show the code you are really working on.
sb93
@sb93
Feb 07 2016 11:32

Haha sorry abt that @Takumar .. for (var i = 0; i < contacts.length; i++){

if(firstName === contacts[i][firstName]){

  if(contacts[i].hasOwnProperty(prop)){
  return contacts[i][prop];
  }

else{
  return "No such property";
}

}
else{
  return "No such contact";

}
}

Manos Mertzianis
@Litarhis
Feb 07 2016 11:33
@sb93 the "no such property" is ok!!!!
@sb93 but where's the problem???? see "no such contact"
@sb93 with that code it should return "No such contact" the first time the code compares firstName of the first contact, without comparing the others with that value
@sb93 but! you want it to return "No such contact" when none of those contacts are valid ;)
@sb93 sorry, when none of this contacts' firstName are the same with the firstName value that it is given
vanshdeepsingh1
@vanshdeepsingh1
Feb 07 2016 11:40
how to i put font size 16px for <p> only in css class ?
sb93
@sb93
Feb 07 2016 11:41
@Litarhis yeah I get it now..so I put the return statement "No such contact"after the for loop
Manos Mertzianis
@Litarhis
Feb 07 2016 11:42
@sb93 you're God damn right!
Aleksander Gębicki
@Takumar
Feb 07 2016 11:46
@sb93 we talked about "No such contact" earlier ;-) before problem with "No such property", so what's your code now?
Remember that after loop you don't have to check any condition because when you complete your loop it means that you haven't found person with name "firstName" or the person with such name doesn't have needed property.
sb93
@sb93
Feb 07 2016 11:47

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

}

}

return "No such contact";

// Only change code above this line
}

Aleksander Gębicki
@Takumar
Feb 07 2016 11:49
@sb93 in your earlier code you used hasOwnProperty() method correctly, now you lost this.
sb93
@sb93
Feb 07 2016 11:50
yeah even after many tries, i was getting the same result. so i thought i'd change the syntax
Pranjal Singh
@pr4njal
Feb 07 2016 11:51
hello everyone
there is a problem in my code.... Its a challenge... Where do I belong?
Aleksander Gębicki
@Takumar
Feb 07 2016 11:51
@sb93 so use again hasOwnProperty() in this line: if(contacts[i][prop]){
contacts[i][prop] gives you value of prop property of selected contact, not boolean value whether this property exists or not.
sb93
@sb93
Feb 07 2016 11:53
@Takumar Ok. I'm still getting the same result though
Aleksander Gębicki
@Takumar
Feb 07 2016 11:55
@sb93 once again show your code, I don't know what you have changed.
sb93
@sb93
Feb 07 2016 11:56

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)){
  return contacts[i][prop];
  }

else{
  return "No such property";
}

}

}

return "No such contact";

// Only change code above this line
}

Manos Mertzianis
@Litarhis
Feb 07 2016 12:01
@sb93 yeap!
Aleksander Gębicki
@Takumar
Feb 07 2016 12:03
@sb93 firstName is name of property so you should use either dot or bracket notation with quotation marks to access its value
contacts[i]["firstName"]
contacts[i].firstName
SajjaRaja
@SajjaRaja
Feb 07 2016 12:03
Be sure to delete all trailing comment tags, i.e. -->.
give me answer

<h1>Hello World</h1>

<h2>CatPhotoApp</h2>

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

Aleksander Gębicki
@Takumar
Feb 07 2016 12:05
@sb93 you are using only bracket notation when you have string variable containing name of property just like in case of prop parameter:
contacts[i][prop]
@SajjaRaja you are very close, just remove -->
@SajjaRaja comment tags are <!-- for opening comment, and --> for closing comment part.
SajjaRaja
@SajjaRaja
Feb 07 2016 12:06
Thanks
Robin
@RobinAllenson
Feb 07 2016 12:07
Hello all
and I think I found a typo
any ideas how I can correct that and/or to whom I should report that?
Manos Mertzianis
@Litarhis
Feb 07 2016 12:08
@Takumar good catch!
Aleksander Gębicki
@Takumar
Feb 07 2016 12:09
@RobinAllenson you can make an issue here: https://github.com/freecodecamp/freecodecamp/issues
and describe the problem or try to correct this yourself.
@Litarhis Thanks! :-)
sb93
@sb93
Feb 07 2016 12:10
@Takumar @Litarhis Thanks guys :)
CamperBot
@camperbot
Feb 07 2016 12:10
sb93 sends brownie points to @takumar and @litarhis :sparkles: :thumbsup: :sparkles:
Manos Mertzianis
@Litarhis
Feb 07 2016 12:10
@sb93 your welcome
CamperBot
@camperbot
Feb 07 2016 12:10
:star: 2177 | @takumar | http://www.freecodecamp.com/takumar
:star: 239 | @litarhis | http://www.freecodecamp.com/litarhis
Robin
@RobinAllenson
Feb 07 2016 12:10
thanks @sb93
CamperBot
@camperbot
Feb 07 2016 12:10
robinallenson sends brownie points to @sb93 :sparkles: :thumbsup: :sparkles:
:star: 223 | @sb93 | http://www.freecodecamp.com/sb93
Aleksander Gębicki
@Takumar
Feb 07 2016 12:11
@camperbot is sleeping again, thank you @Litarhis :-)
CamperBot
@camperbot
Feb 07 2016 12:11
takumar sends brownie points to @camperbot and @litarhis :sparkles: :thumbsup: :sparkles:
:star: 1117 | @camperbot | http://www.freecodecamp.com/camperbot
:star: 240 | @litarhis | http://www.freecodecamp.com/litarhis
Manos Mertzianis
@Litarhis
Feb 07 2016 12:11
@Takumar hahahaahahahahahahaahaha! thank you
CamperBot
@camperbot
Feb 07 2016 12:11
litarhis sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 2178 | @takumar | http://www.freecodecamp.com/takumar
sb93
@sb93
Feb 07 2016 12:16
@RobinAllenson I didn't do anything, but you're welcome :D
Robin
@RobinAllenson
Feb 07 2016 12:17
well, I'm really really new to FCC and a little new to JS and been coding for a long time, so I was just looking for some FCC help.
plus, I'm easy to please ;)
sb93
@sb93
Feb 07 2016 12:18
Haha great. Keep going (y)
SajjaRaja
@SajjaRaja
Feb 07 2016 12:18

<h1>Hello World</h1>

<h2>CatPhotoApp</h2>
<!--Write Small letter-->

<p>Hello Paragraph</p>

Comment out your h1 element so that it is not visible on your page.

<h1>Hello World</h1>

<h2>CatPhotoApp</h2>
<!--Write Small letter-->

<p>Hello Paragraph</p>

Manos Mertzianis
@Litarhis
Feb 07 2016 12:20
@SajjaRaja <!-- <h1>Hello World</h1> -->
SajjaRaja
@SajjaRaja
Feb 07 2016 12:22
Thank you
@Litarhis Thank you
CamperBot
@camperbot
Feb 07 2016 12:23
sajjaraja sends brownie points to @litarhis :sparkles: :thumbsup: :sparkles:
:star: 244 | @litarhis | http://www.freecodecamp.com/litarhis
Manos Mertzianis
@Litarhis
Feb 07 2016 12:24
@SajjaRaja your welcome!
Sarthak Langde
@sarthaksl
Feb 07 2016 12:27

// Setup
function phoneticLookup(val) {
var result = lookup[val];

// Only change code below this line
var lookup = {
"alpha":"Adams",
"bravo":"Boston",
"charlie":"Chicago",
"delta":"Denver",
"echo":"Easy",
"foxtrot":"Frank"
};

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

// Change this value to test
phoneticLookup("");

// Setup
function phoneticLookup(val) {
var result = lookup[val];

// Only change code below this line
var lookup = {
"alpha":"Adams",
"bravo":"Boston",
"charlie":"Chicago",
"delta":"Denver",
"echo":"Easy",
"foxtrot":"Frank"
};

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

// Change this value to test
phoneticLookup("");

Cannot read property "" of undefined
Manos Mertzianis
@Litarhis
Feb 07 2016 12:32
@sarthaksl var result =looup[val] should be under your object
DinnerFingers
@DinnerFingers
Feb 07 2016 12:33
I'm working on CatPhotoApp and I can't work out what I've done wrong, I'm working on the creating a class for font colours. I have all ticks/checks apart from the h2 isn't showing up red.

Sorrybfor making a mess in here, but this is what I have ... <style>
.red-text
{
color: red;
}
</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>

Manos Mertzianis
@Litarhis
Feb 07 2016 12:35
@sarthaksl and I think you have to place one additional property of "": undefined. It's like the default: in switch(){}
@DinnerFingers it seems ok.... Try reseting your code using the reset button at the left of your screen and try this challenge again :)
DinnerFingers
@DinnerFingers
Feb 07 2016 12:39
Thanks! I thought I was going mad 😄
Manos Mertzianis
@Litarhis
Feb 07 2016 12:39
@DinnerFingers hehe
Kevin Mulligan
@kmulligan
Feb 07 2016 12:42

http://www.freecodecamp.com/challenges/accessing-nested-arrays-in-json
Need some help here
The example doesn't match up to this. The example just has "dogs" and "cats", not type:dogs, or in the actual problem type: trees

I have tried this but it doesn't work:

// Setup
var myPlants = [
  { 
    type: "flowers",
    list: [
      "rose",
      "tulip",
      "dandelion"
    ]
  },
  {
    type: "trees",
    list: [
      "fir",
      "pine",
      "birch"
    ]
  }  
];

// Only change code below this line

var secondTree = myPlants.type["trees"].list[1]; // Change this line

As well as this:

var secondTree = myPlants.trees.list[1]; // Change this line

But both say that Cannot read property 'trees' of undefined
This tells me the part before this (myPlants.type or .trees or whatever the actual solution is) isn't working... but I don't know how to fix

Aleksander Gębicki
@Takumar
Feb 07 2016 12:45
@kmulligan none of your objects have trees property. "trees" is value of type property.
@kmulligan your variable myPlants is an array of objects, so you first access selected object from your array with index, just like with basic arrays.
@kmulligan you are making circles around the correct solution and you are very close to it :-)
DinnerFingers
@DinnerFingers
Feb 07 2016 12:58
I'm sorry to say I think I broke it! I took your advice @Litarhis but same problem. Am I messing up with spacing? To be fair I should probably use a laptop instead of my mobile.
Kevin Mulligan
@kmulligan
Feb 07 2016 13:00
@Takumar thanks for the attempt but I don't understand that
CamperBot
@camperbot
Feb 07 2016 13:00
kmulligan sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 2179 | @takumar | http://www.freecodecamp.com/takumar
Manos Mertzianis
@Litarhis
Feb 07 2016 13:01
@DinnerFingers ohhh mobile is always trouble!
@DinnerFingers you jave to be very pricise with the tasks, even with text of <p> and <h2> etc.
DinnerFingers
@DinnerFingers
Feb 07 2016 13:03
Ooh how do you send brownie points?
Kevin Mulligan
@kmulligan
Feb 07 2016 13:04
off to breakfast...
Manos Mertzianis
@Litarhis
Feb 07 2016 13:04
mention someone and write "thank"
SajjaRaja
@SajjaRaja
Feb 07 2016 13:04
This message was deleted
This message was deleted
Brock
@brockwei
Feb 07 2016 13:04
after all that basic algorithms, i have no clue how to start the personal portfolio haha
Mohammed Shehab
@mshehab93
Feb 07 2016 13:05
html p { font-size: 16px;}
@SajjaRaja
lose the html part I wrote it was a typo*
DinnerFingers
@DinnerFingers
Feb 07 2016 13:06
@brockwei I think you need to link your got with free code camp?
Mohammed Shehab
@mshehab93
Feb 07 2016 13:06
just p { font-size: 16px;}
SajjaRaja
@SajjaRaja
Feb 07 2016 13:06
This message was deleted
DinnerFingers
@DinnerFingers
Feb 07 2016 13:07
Github even @brockwei
Brock
@brockwei
Feb 07 2016 13:07
@DinnerFingers i did i think.
Mohammed Shehab
@mshehab93
Feb 07 2016 13:07
@SajjaRaja like I mentioned write: p {font-size: 16px;}
if you add font-size in red text you're targeting only one p tag
SajjaRaja
@SajjaRaja
Feb 07 2016 13:08
This message was deleted
This message was deleted
Mohammed Shehab
@mshehab93
Feb 07 2016 13:08

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

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

<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>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

@SajjaRaja
johnnycooper
@johnnycooper
Feb 07 2016 13:10
i've got this error while using getJSON in codepen: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://s.codepen.io' is therefore not allowed access.
what to do??
SajjaRaja
@SajjaRaja
Feb 07 2016 13:14
blob
This message was deleted
This message was deleted
This message was deleted
Aleksander Gębicki
@Takumar
Feb 07 2016 13:20

@kmulligan you have two objects in your array, so you select second object with index:

myPlants[1]

To retrieve second tree, you have to select second value in a property list which is also array, so you add name of property after period: myPlants[1]. and you should know what to do next :-)

Kevin Mulligan
@kmulligan
Feb 07 2016 13:24
@Takumar thanks... I got it figured out
CamperBot
@camperbot
Feb 07 2016 13:24
kmulligan sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:warning: kmulligan already gave takumar points
SajjaRaja
@SajjaRaja
Feb 07 2016 13:25
Give elements with the p tag a font-size of 16px. Browser and Text zoom should be at 100%.
DinnerFingers
@DinnerFingers
Feb 07 2016 13:25
Thanks @Litarhis
CamperBot
@camperbot
Feb 07 2016 13:25
dinnerfingers sends brownie points to @litarhis :sparkles: :thumbsup: :sparkles:
:star: 255 | @litarhis | http://www.freecodecamp.com/litarhis
Manos Mertzianis
@Litarhis
Feb 07 2016 13:26
@DinnerFingers your welcome!
Aleksander Gębicki
@Takumar
Feb 07 2016 13:26
@SajjaRaja you need left curly brace after paragraph: p {
@SajjaRaja oh, and don't add font-size class for your paragraph: <p class="font-size">
You have to create two CSS declarations, one for .red-text class and one for p element:
.red-text {
  here comes colour definition
}
p {
  here you define font-size
}
SajjaRaja
@SajjaRaja
Feb 07 2016 13:31

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

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

<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="font-size">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

any one help me