These are chat archives for FreeCodeCamp/Help

2nd
Oct 2015
Jason
@Jauble
Oct 02 2015 00:01
try putting a semicolon after bounce")
DTing
@dting
Oct 02 2015 00:01
put the $(...)... button on its own line
kaushalmathpal
@kaushalmathpal
Oct 02 2015 00:02
@Jauble @dting i tried putting the semicolon its nt working
DTing
@dting
Oct 02 2015 00:02
oh "addClass" @kaushalmathpal
Yosafat Ariel
@yoskakomba
Oct 02 2015 00:02

Hello guys! need help with "waypoint-target-the-parent-of-an-element-using-jquery"

  $(document).ready(function() {
        $("#left-well").parent().css("background-color", "red");
  });
</script>

what's missing in my code, thank you in advance for your help :)

DTing
@dting
Oct 02 2015 00:03
@yoskakomba you are targeting the parent of the left-well element
you need to choose a child element of the #left-well element to target because you are calling the.parent() function
Jason
@Jauble
Oct 02 2015 00:03
Didn't see that. Nice catch @dting
Yosafat Ariel
@yoskakomba
Oct 02 2015 00:05
@dting thank you so much, now I understood
CamperBot
@camperbot
Oct 02 2015 00:05
yoskakomba sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1295 | @dting | http://www.freecodecamp.com/dting
kaushalmathpal
@kaushalmathpal
Oct 02 2015 00:05
<script>
  $(document).ready(function() {
    $("button").addClass("animated bounce");
  });
</script>
whats the problem with this its not working
DTing
@dting
Oct 02 2015 00:05
which challenge is this for?
kaushalmathpal
@kaushalmathpal
Oct 02 2015 00:08
jquery
@dting goi..it.
DTing
@dting
Oct 02 2015 00:08
that looks correct.
nice
Alex
@AJPedersen
Oct 02 2015 00:12
Reversing string, first bonfire, need some help!
So this is what Im thinking, I need to split the string into an array, reverse the array, then join it back up

so going var reverseString("hello", "Howdy", "Greetings from Earth");

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

but all I get is Unexpected token (
I have googled and read for the past two days
dont want the solution, just a hint please!
Chris
@Shifthawke
Oct 02 2015 00:15
is that your actual code?
Alex
@AJPedersen
Oct 02 2015 00:15

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

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

yup
Chris
@Shifthawke
Oct 02 2015 00:15
your reverse isn't right.
Ed Sztukowski
@Burgustu
Oct 02 2015 00:15
Can anyone help clear some things up for me with Waypoint: Give your JavaScript Slot Machine some Stylish Images? http://freecodecamp.com/challenges/waypoint-give-your-javascript-slot-machine-some-stylish-images
Alex
@AJPedersen
Oct 02 2015 00:15
kk thx
CamperBot
@camperbot
Oct 02 2015 00:15
if you want to thank someone, put an @ before their name!
Chris
@Shifthawke
Oct 02 2015 00:15
Well let me state, I'm still new and did this a few days ago.
Mine was different.
Alex
@AJPedersen
Oct 02 2015 00:16
so should be reverseString.reverse?
Ed Sztukowski
@Burgustu
Oct 02 2015 00:16
Specifically, the indexes they
theyre using to pull images from the array
$($('.slot')[0]).html('<img src = "' + images[slotOne-1] + '">');
Why wouldn't it by images[0]
be*
Chris
@Shifthawke
Oct 02 2015 00:16
I saw that one and cowered. @Burgustu
think more arr reverse @AJPedersen
woah
sorry
Chris
@Shifthawke
Oct 02 2015 00:18
for the second.
And the third is an array str not rev rev
@AJPedersen
Ed Sztukowski
@Burgustu
Oct 02 2015 00:19
I just dont understand where the [slotOne -1] is coming from
Chris
@Shifthawke
Oct 02 2015 00:23
I honestly don't know. I can look. Link me the bonfire?
Ed Sztukowski
@Burgustu
Oct 02 2015 00:23
I guess if you use [0][1] or [2] it doesnt randomize and just keeps it cherry, big win, and bar which I guess makes sense actually, but I dont get how the slotOne variable is relating to the image
sure
Chris
@Shifthawke
Oct 02 2015 00:25
Oh I remember now
I guess lol
Any who
$($('.slot')[0]).html('<img src = "' + images[slotOne-1] + '">');
you have to change the 0
it starts at 0 not 1
so 0
1
2
Then, they can't all be slot one
Ed Sztukowski
@Burgustu
Oct 02 2015 00:26
Oh no, I get how to solve it, but I dont understand how the image is being pulled in
Chris
@Shifthawke
Oct 02 2015 00:26
Ohhm
Ed Sztukowski
@Burgustu
Oct 02 2015 00:26
the images array and how it related to slotOne-1
basically
or slotTwo -1, etc
Chris
@Shifthawke
Oct 02 2015 00:27
I think this supposed to be a js mystery lol
Ed Sztukowski
@Burgustu
Oct 02 2015 00:30
Oh well, thanks @Shifthawke !
CamperBot
@camperbot
Oct 02 2015 00:30
burgustu sends brownie points to @shifthawke :sparkles: :thumbsup: :sparkles:
:star: 364 | @shifthawke | http://www.freecodecamp.com/shifthawke
Alex
@AJPedersen
Oct 02 2015 00:30
ya I did that one yesterday, not sure either, getting them from var images somehow
Chris
@Shifthawke
Oct 02 2015 00:30
Sorry
Ed Sztukowski
@Burgustu
Oct 02 2015 00:30
no worries
Chris
@Shifthawke
Oct 02 2015 00:30
I wonder if it's calling from the + images
Ed Sztukowski
@Burgustu
Oct 02 2015 00:31
I just dont get it, because you would think that references the images array would only have code relating to the data in it
but then slotOne shows up
if you replace it with images[0], images[1] or images[2] it breaks it though and doesn't change the images out
So I guess it's doing something with the random number generated from the slotOne variable
Chris
@Shifthawke
Oct 02 2015 00:33
PRobably is.
maftoun95
@maftoun95
Oct 02 2015 00:47
help Where do I belong
CamperBot
@camperbot
Oct 02 2015 00:47

:point_right: bonfire where do i belong [wiki]

Explanation:

This can be a tricky problem to understand. You need to find where in the array a number should be inserted by order, and return the index where it should go.

:pencil: read more about bonfire where do i belong on the FCC Wiki

Jonathan Coleman
@jondcoleman
Oct 02 2015 00:56
Hi, I'm working through the git waypoint and git-it verify is not detecting my push to github
any tips?
but its definitely there
nm, misspelled origin, whoops
Chris
@Shifthawke
Oct 02 2015 01:00
lol
Alessandro Metta
@n0f3
Oct 02 2015 01:11
hey everyone, did anybody do the codepen about twitch API?
need help trying to figure out how to import the javascript sdk in codepen
it doesn't seem to be working
Herman Fassett
@HermanFassett
Oct 02 2015 01:12
Um
sdk?
Alessandro Metta
@n0f3
Oct 02 2015 01:13
<script src="https://ttv-api.s3.amazonaws.com/twitch.min.js"></script>
Herman Fassett
@HermanFassett
Oct 02 2015 01:13
You don't need that
Alessandro Metta
@n0f3
Oct 02 2015 01:13
?
Herman Fassett
@HermanFassett
Oct 02 2015 01:13
You just need json calls to https://api.twitch.tv/kraken/streams/freecodecamp or similar
Alessandro Metta
@n0f3
Oct 02 2015 01:14
oh i see
would be really helpful to use the sdk tho
i think that there's a dependency on jquery for it
that's why codepen is not loading it
order of script import
Herman Fassett
@HermanFassett
Oct 02 2015 01:15
You should load scripts in the settings in codepen, not in the code though
Alessandro Metta
@n0f3
Oct 02 2015 01:16
Screen Shot 2015-10-01 at 6.16.31 PM.png
like that?
Herman Fassett
@HermanFassett
Oct 02 2015 01:19
@n0f3 no, on the Javascript tab
Star Cherrix
@Sparklepaws
Oct 02 2015 01:19
Hey guys, I'm trying to get geolocation and Simple Weather working together but I can't seem to fix this code. It keeps telling me that .simpleWeather isn't a function, but I've imported the plugins. Any advice?
function loadWeather(position1,woeid){
    console.log(position1);
    $.simpleWeather({
        location: position1,
                woeid: woeid,
        unit: 'f',
        success: function() {
                    $("#weather1").html("<p>This worked</p>");
                },
    });
}

$(document).on('click', function(){
    navigator.geolocation.getCurrentPosition(function(position) {
    loadWeather(position.coords.latitude+','+position.coords.longitude);
    })
});
DoRm
@DoRm
Oct 02 2015 01:22
@Sparklepaws Did you wrap that in a document load?
Star Cherrix
@Sparklepaws
Oct 02 2015 01:24
@DoRm Yes, but I don't think it makes a difference, originally I was having it check for geolocations when the document was ready.
Star Cherrix
@Sparklepaws
Oct 02 2015 01:40
Guess I'm gonna have to crack this one myself xD
Rex Schrader
@SaintPeter
Oct 02 2015 01:47
@Sparklepaws Share your Codepen URL?
Star Cherrix
@Sparklepaws
Oct 02 2015 01:54

I actually fixed it, but feel free to look anyway. The issue seemed to be that I was attempting to import the Simple Weather JS into the HTML head. The moment I used CodePen to import it to the JS it stopped giving me errors and worked.

http://codepen.io/Sparklepaws/pen/qORrpV

timeEd32
@timeEd32
Oct 02 2015 02:06

Hi everyone, I recently started FreeCodeCamp and I'm a bit stuck on the last JS waypoint (Give your slot machine some stylish images). I have checks on everything except the first item, which is "Use the provided code three times. One for each slot."

Here's what I wrote:

$($('.slot')[0]).html('<img src="http://i.imgur.com/9H17QFk.png"' + images[slotOne-1] + '">');

$($('.slot')[1]).html('<img src="http://i.imgur.com/9RmpXTy.png"' + images[slotTwo-1] + '">');

$($('.slot')[2]).html('<img src="http://i.imgur.com/VJnmtt5.png"' + images[slotThree-1] + '">');
Chris
@Shifthawke
Oct 02 2015 02:07
Can you format your actual code? @timeEd32
Do you know how?
wiki format.
CamperBot
@camperbot
Oct 02 2015 02:09

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

timeEd32
@timeEd32
Oct 02 2015 02:10
@Shifthawke fixed, sorry about that
Chris
@Shifthawke
Oct 02 2015 02:11
Got it? It's okay ^_^The pictures threw me off lol
timeEd32
@timeEd32
Oct 02 2015 02:13
so I can't figure out why it's saying I haven't used the code three times, one for each slot
when I click go in the slot machine I get one of the images in each slot, so it appears to be working correctly
Chris
@Shifthawke
Oct 02 2015 02:15
Well you have to remember that each one has it's own number
Posting it three times is posting a single slot three times
There are two places on each line that need to change
One place is a number. And the other is the name of a number
Nothing else changes.
@timeEd32
timeEd32
@timeEd32
Oct 02 2015 02:18
right, I just figured it out. I was hardcoding a single image into each slot
when that should obviously be random ... like a slot machine
@Shifthawke thank you for your help!
Chris
@Shifthawke
Oct 02 2015 02:19
lol no.
np*
I plugged at that one for a good bit too.
redhead10210
@redhead10210
Oct 02 2015 02:29
i am stupidly stuck on checking the length of a string variable
Terry
@terryrey
Oct 02 2015 02:33
@redhead10210
var str = 'abc';
var i = str.length;
i should equal 3
redhead10210
@redhead10210
Oct 02 2015 02:38
if this is given:
var lastName = "Lovelace"
Terry
@terryrey
Oct 02 2015 02:40
@redhead10210
var i = lastNane.length;
redhead10210
@redhead10210
Oct 02 2015 02:41
ok thanks!
CamperBot
@camperbot
Oct 02 2015 02:41
if you want to thank someone, put an @ before their name!
Terry
@terryrey
Oct 02 2015 02:41
No probs.
Mike
@runsf
Oct 02 2015 03:29
Bonfire Factorialize a Number
CamperBot
@camperbot
Oct 02 2015 03:29

:fire:Bonfire: Factorialize a Number :link:

function factorialize(num) {
  return num;
}

factorialize(5);

Return the factorial of the provided integer.

more info:  bf details | bf links | hint

Mike
@runsf
Oct 02 2015 03:30
bf details
CamperBot
@camperbot
Oct 02 2015 03:30

:fire:Bonfire: Factorialize a Number :link:

function factorialize(num) {
  return num;
}

factorialize(5);
Return the factorial of the provided integer.
If the integer is represented with the letter n, a factorial is the product of all positive integers less than or equal to n.
Factorials are often represented with the shorthand notation n!
For example: 5! = 1 2 3 4 5 = 120f
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
Mike
@runsf
Oct 02 2015 03:31
hint
CamperBot
@camperbot
Oct 02 2015 03:31
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Shaina Shockley
@sashockster
Oct 02 2015 03:34
This message was deleted
Hey everybody!
Can anyone suggest a good API for Zipline: Show the Local Weather
Jason
@Jauble
Oct 02 2015 03:35
Hey @sashockster
Sorry, haven't gotten there yet
aeroldb
@aeroldb
Oct 02 2015 03:36
Hi, there.. How do i change font-size inside jumbotron ?
Herman Fassett
@HermanFassett
Oct 02 2015 03:36
Puiyee Tong
@pytong
Oct 02 2015 03:37
Is there a bug in the 2nd and 3rd test cases here http://freecodecamp.com/challenges/bonfire-symmetric-difference ?
Shaina Shockley
@sashockster
Oct 02 2015 03:37
@Jauble thanks and no worries!
CamperBot
@camperbot
Oct 02 2015 03:37
sashockster sends brownie points to @jauble :sparkles: :thumbsup: :sparkles:
:star: 189 | @jauble | http://www.freecodecamp.com/jauble
Jason
@Jauble
Oct 02 2015 03:38
:smile:
Shaina Shockley
@sashockster
Oct 02 2015 03:38
@HermanFassett ok cool, I just stumbled on that and thought before I attempt to sign up, let me see if there is anything better. Thanks!
CamperBot
@camperbot
Oct 02 2015 03:38
sashockster sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 265 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Herman Fassett
@HermanFassett
Oct 02 2015 03:39
@sashockster no need to sign up
Just use the current api http://openweathermap.org/current
An example url to call would be http://api.openweathermap.org/data/2.5/weather?q=London&units=imperial
@sashockster does that make sense?
Shaina Shockley
@sashockster
Oct 02 2015 03:42
@HermanFassett awesome, thanks! , I thought I had to get an api key which requires a sign up.
CamperBot
@camperbot
Oct 02 2015 03:42
sashockster sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:warning: sashockster already gave hermanfassett points
Jason
@Jauble
Oct 02 2015 03:42
So I got this to work in Chrome and then realized that one of the tests has an extra argument. Can anyone give me a little push in the right direction?
function destroyer(arr) {
  var newArray = arr.filter(function(value, index, array){
    return value !== arr[1] && value !== arr[2];
  });
  return newArray;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3, "");
Shaina Shockley
@sashockster
Oct 02 2015 03:43
@HermanFassett yes it makes sense how you're calling it, thats all I need to start.
Jason
@Jauble
Oct 02 2015 03:43
I know this is ugly btw lol
Jose E. Pimentel
@jedpimentel
Oct 02 2015 03:47
@Jauble you'll need to use the arguments object in order to iterate over the a variable ammount of arguments, it's one of the "helpful links" https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments
@Jauble as-is, you're only processing the first argument (the array), arr[1] and arr[2] are referring to the "2" and "3" inside the array, not the "2" and "3" that are part of the filter criteria
Jason
@Jauble
Oct 02 2015 03:49
@jedpimentel Thanks. Can you give me a hint on how I would use it here though. I read that when I started and couldn't figure out how I would use it.
CamperBot
@camperbot
Oct 02 2015 03:49
jauble sends brownie points to @jedpimentel :sparkles: :thumbsup: :sparkles:
:star: 325 | @jedpimentel | http://www.freecodecamp.com/jedpimentel
Jose E. Pimentel
@jedpimentel
Oct 02 2015 03:50
sure,
Herman Fassett
@HermanFassett
Oct 02 2015 03:50
arguments[0] is arr
Jason
@Jauble
Oct 02 2015 03:50
Ya I know. It works as it is, but if you add another argument it'll throw it off.
Jose E. Pimentel
@jedpimentel
Oct 02 2015 03:51
you can try breaking down the function into parts, it's easier if you make a function isNotTarget() to check if avalue is one of the target (to destroy) values
Jason
@Jauble
Oct 02 2015 03:51
@HermanFassett Oh I see
JessicaEx
@JessicaEx
Oct 02 2015 03:52

I'm trying to switch the elements of an array one at a time, and then push each of those permutations into another array. Like var a = [1,2]; -> [2,1] and [[1,2],[2,1]]

But my problem is, when I try to use the slice() method to move the elements around in the array, it ends up changing the 2D array too.

Does anyone know of a way that I can update the original array without changing the 2d array?

Herman Fassett
@HermanFassett
Oct 02 2015 03:53
@JessicaEx show code
JessicaEx
@JessicaEx
Oct 02 2015 03:53
Ok
Jose E. Pimentel
@jedpimentel
Oct 02 2015 03:53
that way you can seperate the pieces of code and it should be easier to handle. the isNotTarget function, could then loop between arguments[1] and arguments[arguments.length-1] to check if it was one of them
Jason
@Jauble
Oct 02 2015 03:54
@jedpimentel Thanks I'll try to figure that out
CamperBot
@camperbot
Oct 02 2015 03:54
jauble sends brownie points to @jedpimentel :sparkles: :thumbsup: :sparkles:
:warning: jauble already gave jedpimentel points
JessicaEx
@JessicaEx
Oct 02 2015 03:54
for (var elm in str){
        for (var elt in str){
            if(elm !== elt){
                arr[elm] = arr.splice(elt, 1, arr[elm])[0];
                pos[elm] = pos.splice(elt, 1, pos[elm])[0];

                if(movements.length === 0){
                    perm.push(arr);
                    movements.push(pos);
                }
                else if (movements.indexOf(pos)  ===  -1){
                    perm.push(arr);
                    movements.push(pos);
                    //console.log(perm);
                    //console.log(movements);
                }
            }
        }
    }
Jose E. Pimentel
@jedpimentel
Oct 02 2015 03:54
also, you would have to copy arguments into another variable, before calling a function on it (else the function would think you're referring to its own variables)
Jason
@Jauble
Oct 02 2015 03:55
I see
JessicaEx
@JessicaEx
Oct 02 2015 03:56
This is just the bit of the code I'm having trouble with. I can post the rest if you want, but it's kind of a long jumbled mess right now
Herman Fassett
@HermanFassett
Oct 02 2015 03:56
It'd be nice to know the variables
Jose E. Pimentel
@jedpimentel
Oct 02 2015 03:56
@JessicaEx I think what you want is the .slice() function (it won't change the var it's called on)
Herman Fassett
@HermanFassett
Oct 02 2015 03:56
:smile:
JessicaEx
@JessicaEx
Oct 02 2015 03:57
@HermanFassett Yeah, that would help, sorry.
function permAlone(str) {
    var temp = [];

    var arr = [];
    var pos = [];   //positions
    var perm = [];  //permutations
    var movements = [];


    for (var letter in str){
        temp.push(str[letter]);
        arr.push(str[letter]);
        pos.push(letter);
    }

    //checks for a string containing only one unique variable
    var uniqueArray = temp.filter(function(item, pos) {
        return temp.indexOf(item) == pos;
    });

    if(uniqueArray.length === 1){
        return 0;
    }
    //end.


    for (var elm in str){
        for (var elt in str){
            if(elm !== elt){
                arr[elm] = arr.splice(elt, 1, arr[elm])[0];
                pos[elm] = pos.splice(elt, 1, pos[elm])[0];
                console.log(movements);
                console.log(perm);

                if(movements.length === 0){
                    perm.push(arr);
                    movements.push(pos);
                }
                else if (movements.indexOf(pos) > -1){
                    perm.push(arr);
                    movements.push(pos);
                    //console.log(perm);
                    //console.log(movements);
                }
            }
        }
    }

    var returned = perm.filter(function(Arr,Pos) {
        for(var i = 0; i < Arr.length - 1; i++){
            if (Arr[i] === Arr[i + 1]){
                return false;
            }
        }
        return true;

    });

    return returned;

}

permAlone('aab');
@jedpimentel Do you mean adding the using the slice method instead of the push function?
Jose E. Pimentel
@jedpimentel
Oct 02 2015 03:58
slice instead of splice, (slice behaves different though)
Herman Fassett
@HermanFassett
Oct 02 2015 03:59
@JessicaEx whew
JessicaEx
@JessicaEx
Oct 02 2015 03:59
@jedpimentel Hmm... I don't know how I missed that. Thanks
CamperBot
@camperbot
Oct 02 2015 03:59
jessicaex sends brownie points to @jedpimentel :sparkles: :thumbsup: :sparkles:
:star: 326 | @jedpimentel | http://www.freecodecamp.com/jedpimentel
Rex Schrader
@SaintPeter
Oct 02 2015 03:59
@JessicaEx Did you mean to have capitals in Arr, because javascript is case sensitive.
JessicaEx
@JessicaEx
Oct 02 2015 04:00
@HermanFassett Yeah I'm pretty sure my code is like one of those toy rat traps just going around in circles without actually doing anything. Sorry again
Herman Fassett
@HermanFassett
Oct 02 2015 04:00
@SaintPeter function(Arr...
Rex Schrader
@SaintPeter
Oct 02 2015 04:00
@HermanFassett Ahh
JessicaEx
@JessicaEx
Oct 02 2015 04:02
@jedpimentel Actually that was a splice function not a slice
Jose E. Pimentel
@jedpimentel
Oct 02 2015 04:04
@JessicaEx slice() makes a new array without removing the values from the array it was called on.
JessicaEx
@JessicaEx
Oct 02 2015 04:07
@jedpimentel Oh I see. And using splice will make changes to the array itself not a copy
Jose E. Pimentel
@jedpimentel
Oct 02 2015 04:08
yes, it's like using arr.pop() instead of arr[arr.length-1]
Kevin J. Ortiz Rios
@Kevin3026
Oct 02 2015 04:12
People
I need help
Herman Fassett
@HermanFassett
Oct 02 2015 04:13
@Kevin3026 spit it out
Chris
@Shifthawke
Oct 02 2015 04:14
What Herman said
Kevin J. Ortiz Rios
@Kevin3026
Oct 02 2015 04:14
My code is right but it appears to be wrong.. I have checked it like 15 times
Herman Fassett
@HermanFassett
Oct 02 2015 04:15
Post it
Jose E. Pimentel
@jedpimentel
Oct 02 2015 04:15
yeah... it's better to just post the issue directly if someone knows they'll usually reply as a knee-jerk reaction
Kevin J. Ortiz Rios
@Kevin3026
Oct 02 2015 04:16
How I do that?
Jose E. Pimentel
@jedpimentel
Oct 02 2015 04:16
help code format
CamperBot
@camperbot
Oct 02 2015 04:16

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Kevin J. Ortiz Rios
@Kevin3026
Oct 02 2015 04:19
<p> View more <a href='https://freecatphotoapp.com'>cat photos</a>
</p>
Your a element should be nested within your new p element.
Your p element should have the text "View more " (with a space after it).
these are the two errors that appeared
Star Cherrix
@Sparklepaws
Oct 02 2015 04:20
This message was deleted
Jose E. Pimentel
@jedpimentel
Oct 02 2015 04:21
can you post a link to the excersize?
Herman Fassett
@HermanFassett
Oct 02 2015 04:21
Is that a space before View in your code @Kevin3026 ?
@HermanFassett nope
Herman Fassett
@HermanFassett
Oct 02 2015 04:22
In your paste I can select a space in front of View...
Kevin J. Ortiz Rios
@Kevin3026
Oct 02 2015 04:22
Yes you are right but it isnt the issue right here. @HermanFassett
Herman Fassett
@HermanFassett
Oct 02 2015 04:23
@Kevin3026 replace https with http
Jose E. Pimentel
@jedpimentel
Oct 02 2015 04:23
@Kevin3026 you have an extra space before "View more", it's giving an error because of that extra (space) character
Kevin J. Ortiz Rios
@Kevin3026
Oct 02 2015 04:23
yep i fixed it but the errors still there
Jose E. Pimentel
@jedpimentel
Oct 02 2015 04:24
the same errors?
Kevin J. Ortiz Rios
@Kevin3026
Oct 02 2015 04:24
@jedpimentel Yes
Herman Fassett
@HermanFassett
Oct 02 2015 04:24
Removing space and changing https to http should work...
Does it not?
Kevin J. Ortiz Rios
@Kevin3026
Oct 02 2015 04:25
<p>View more <a href="http://www.freecatphotoapp.com">cat photos</a></p>
Jose E. Pimentel
@jedpimentel
Oct 02 2015 04:25
1)use the URL: http://www.freecatphotoapp.com
2)use "View more" instead of " View more"
Kevin J. Ortiz Rios
@Kevin3026
Oct 02 2015 04:26
Your p element should have the text "View more " (with a space after it).
]This is the error now
Herman Fassett
@HermanFassett
Oct 02 2015 04:26
<p>View more <a href="http://www.freecatphotoapp.com">cat photos</a></p>
Works for me
Jose E. Pimentel
@jedpimentel
Oct 02 2015 04:26
that last one worked for me also
Kevin J. Ortiz Rios
@Kevin3026
Oct 02 2015 04:26
how do you get a picture like that?
Jose E. Pimentel
@jedpimentel
Oct 02 2015 04:27
help code format
CamperBot
@camperbot
Oct 02 2015 04:27

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Kevin J. Ortiz Rios
@Kevin3026
Oct 02 2015 04:27
@HermanFassett @jedpimentel That is what I Have
Jose E. Pimentel
@jedpimentel
Oct 02 2015 04:27
:s maybe try resetting the code, you might've changed something else by accident (has happened to me)
Herman Fassett
@HermanFassett
Oct 02 2015 04:27
Well I know that code works... Try clicking a few times or reload or copy, clear cache, retry idk
Kevin J. Ortiz Rios
@Kevin3026
Oct 02 2015 04:28
@jedpimentel but i have done this for at least 8 times
Jose E. Pimentel
@jedpimentel
Oct 02 2015 04:28
@Kevin3026 copy paste all this:
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

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

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

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

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

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

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
Kevin J. Ortiz Rios
@Kevin3026
Oct 02 2015 04:29
@jedpimentel I will try putting it at the top of the code
Jason
@Jauble
Oct 02 2015 04:29
I know this is ugly, and I know this isn't anywhere near what you guys were talking about, but can you guys tell me why this is running the else and not the if?
function destroyer(arr) {
  var newArray = arr.filter(function(value, index, array){
      if (arguments.length === 5) {
          console.log("if");
            return value !== arr[1] && value !== arr[2] && value !== arr[3];
        }
        else {
          console.log("else");
          return value !== arr[1] && value !== arr[2];
        }
    });
    console.log(arguments.length);
    console.log(newArray);
  return newArray;
Jose E. Pimentel
@jedpimentel
Oct 02 2015 04:30
@Kevin3026 try replacing it completely, that's basically you're code, which does run on my side
Kevin J. Ortiz Rios
@Kevin3026
Oct 02 2015 04:30
@jedpimentel now it worked.. idk why it doesnt work at the bottom
thak you guys
CamperBot
@camperbot
Oct 02 2015 04:30
if you want to thank someone, put an @ before their name!
Kevin J. Ortiz Rios
@Kevin3026
Oct 02 2015 04:30
@jedpimentel thanks
CamperBot
@camperbot
Oct 02 2015 04:30
kevin3026 sends brownie points to @jedpimentel :sparkles: :thumbsup: :sparkles:
:star: 327 | @jedpimentel | http://www.freecodecamp.com/jedpimentel
Kevin J. Ortiz Rios
@Kevin3026
Oct 02 2015 04:31
@HermanFassett thanks
@HermanFassett
Chris
@Shifthawke
Oct 02 2015 04:31
I couldn't get it to work on mine either lol
Kevin J. Ortiz Rios
@Kevin3026
Oct 02 2015 04:31
What happened i want to send brownies to @HermanFassett
Chris
@Shifthawke
Oct 02 2015 04:32
thanks @HermanFassett
CamperBot
@camperbot
Oct 02 2015 04:32
shifthawke sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 267 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Chris
@Shifthawke
Oct 02 2015 04:32
there you go kevin lol
Herman Fassett
@HermanFassett
Oct 02 2015 04:32
camperbot was lazy
Chris
@Shifthawke
Oct 02 2015 04:32
brownies for Herman.
Herman Fassett
@HermanFassett
Oct 02 2015 04:32
:P
Chris
@Shifthawke
Oct 02 2015 04:32
Sometimes cbot likes to eat them himself.
Kevin J. Ortiz Rios
@Kevin3026
Oct 02 2015 04:32
jjajajaja
Chris
@Shifthawke
Oct 02 2015 04:32
@HermanFassett Smartypants, help the other guy above.
Jauble.
Herman Fassett
@HermanFassett
Oct 02 2015 04:33
@Shifthawke I'm looking at it as we speak
Jose E. Pimentel
@jedpimentel
Oct 02 2015 04:33
@Jauble you might want to copy "arguments" into a new variable, before doing anything on it. Also, is there any specific reason you'd only like it to run if there are exactly 5 arguments?
Kevin J. Ortiz Rios
@Kevin3026
Oct 02 2015 04:33
I will come if i have another issue.
Jose E. Pimentel
@jedpimentel
Oct 02 2015 04:33
we'll be here... ever vigilant against the evil bugs of FCC
Jason
@Jauble
Oct 02 2015 04:33
Sorry, I left off the function call
    }

    destroyer([1, 2, 3, 1, 2, 3, 4], 2, 3, 4, "");
Herman Fassett
@HermanFassett
Oct 02 2015 04:34
@Jauble try a for (var i = 1; i < arguments.length; i++) sort of loop
Jose E. Pimentel
@jedpimentel
Oct 02 2015 04:36
@Jauble you might want to before anything copy the array into a new variable, and copy the other arguments into their own array. It'll make the rest much easier for you
Jason
@Jauble
Oct 02 2015 04:36
@jedpimentel I'll do that. I'd like it to run the if if there's 5 arguments, and run the other one otherwise, because the tests only have 4 and 5 arguments, I think.
Herman Fassett
@HermanFassett
Oct 02 2015 04:36
You don't need an if else...
Jason
@Jauble
Oct 02 2015 04:37
@HermanFassett I think I tried that, but I'll try it again
Herman Fassett
@HermanFassett
Oct 02 2015 04:37
Just use the for loop and compare value with arguments[i]
Jose E. Pimentel
@jedpimentel
Oct 02 2015 04:37
as it is, you're hard coding the logic. what if someone twies to run it with 20 variables?
Jason
@Jauble
Oct 02 2015 04:39
@HermanFassett I'll try that
Boris
@boris-in-london
Oct 02 2015 04:39
@jauble i'm a noob, so i could be out of my league here... and please correct me if i'm wrong, but on line 3 is arguments defined?
Herman Fassett
@HermanFassett
Oct 02 2015 04:40
arguments is defined for a function
Jason
@Jauble
Oct 02 2015 04:40
@jedpimentel Ya, I know, I was just getting frustrated and trying to get anything to work before I figured out better ways to do it.
Herman Fassett
@HermanFassett
Oct 02 2015 04:40
arguments is an array of all the arguments passed to the function @boris-in-london
Jason
@Jauble
Oct 02 2015 04:40
A lot of times I'll do it several different ways
Boris
@boris-in-london
Oct 02 2015 04:40
what does arguments equal too?
oh ok @HermanFassett thanks
CamperBot
@camperbot
Oct 02 2015 04:41
boris-in-london sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
Jose E. Pimentel
@jedpimentel
Oct 02 2015 04:41
@boris-in-london excelent question! arguments is an object that hold all the function inputs, (arguments[0] is the first input, arguments[1] the second, etc), it made automatically
CamperBot
@camperbot
Oct 02 2015 04:41
:star: 269 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Herman Fassett
@HermanFassett
Oct 02 2015 04:41
And guess what... Those inputs are technically called arguments!
Jose E. Pimentel
@jedpimentel
Oct 02 2015 04:42
@Jauble just remember it's fine to skip something if you get frustrated, you can always go back to it. It's only hard because it's something you'll need to get the hang of,
Boris
@boris-in-london
Oct 02 2015 04:42
good advice @jedpimentel
Herman Fassett
@HermanFassett
Oct 02 2015 04:43
@Jauble I'm skirting most of these advanced algorithms
Jason
@Jauble
Oct 02 2015 04:43
@jedpimentel I did try var args = arguments (I don't remember if that worked or why I changed it) Is that what you meant though? Sorry, I'm working on very little sleep
Boris
@boris-in-london
Oct 02 2015 04:43
i step away from the problem and watch tv for a while then come back to it. Rick and Morty is my fav atm.
Jose E. Pimentel
@jedpimentel
Oct 02 2015 04:44
@Jauble yeah, something like that. Basically, if you call a function within a function, that inner function would have different arguments, I found that out the hard way >_>
Ademola Adegbuyi
@ooade
Oct 02 2015 04:44
@HermanFassett the if statement cannot execute because arguments.length is not equal to 5
Herman Fassett
@HermanFassett
Oct 02 2015 04:44
@Jauble it'd have to be
var args = Array.prototype.slice.call(arguments);
@marhyorh not my code, that's Jauble's :P
Jason
@Jauble
Oct 02 2015 04:45
@jedpimentel Ya, I know, I just like to see if I can figure out something with what I already know, and then find ways to improve it.
Herman Fassett
@HermanFassett
Oct 02 2015 04:46
The arguments object is technically not a true array which is why it has to be converted like that
Boris
@boris-in-london
Oct 02 2015 04:46
@marhyorh destroyer([1, 2, 3, 1, 2, 3, 4], 2, 3, 4, ""); are five elements .
Jason
@Jauble
Oct 02 2015 04:46
@HermanFassett I saw that somewhere, but it wasn't explained and looked a bit intimidating lol
Herman Fassett
@HermanFassett
Oct 02 2015 04:47
Which is why I normally just call direct from arguments :P
Jason
@Jauble
Oct 02 2015 04:47
I hate just copying and pasting something in when I don't understand what it's doing.
I was trying to find out what prototype was about, but what I looked up looked like it was for another use or something.
Boris
@boris-in-london
Oct 02 2015 04:48
@jauble have you tried a debugger?
Herman Fassett
@HermanFassett
Oct 02 2015 04:48
If array generics are available you can more understandably put var args = Array.slice(arguments);
But don't rely on array generics
They're deprecated
Jason
@Jauble
Oct 02 2015 04:52
@boris-in-london I just use notepad++ and run it in Chrome and look at it with dev tools
@HermanFassett lol ok I won't
Boris
@boris-in-london
Oct 02 2015 04:55
blob
@Jauble i ran your code on the dev tools console debugger.
it seems the console goes straight to your last return statement and doesnt go to if or else.
i could be way off but have a look at the pic i posted
Boris
@boris-in-london
Oct 02 2015 05:01
so @Jauble do you want a boolean to return or the newArray?
Herman Fassett
@HermanFassett
Oct 02 2015 05:01
You return a boolean in the filter function @boris-in-london
Boris
@boris-in-london
Oct 02 2015 05:02
in your if statement it read return value !== arr[1] or arr[2] or arr[3] that should return false.
@HermanFassett bit out of me knowledge range lol i'll sit this one out. sorry @Jauble i tried.
Jason
@Jauble
Oct 02 2015 05:03
@boris-in-london how do you get that VM390? When I go into sources it doesn't look like that
Boris
@boris-in-london
Oct 02 2015 05:05
@Jauble i didn't change your code at all. it should run like mine
Jason
@Jauble
Oct 02 2015 05:05
@HermanFassett This doesn't work, but it's all I can think of with the for look right now.
Boris
@boris-in-london
Oct 02 2015 05:05
if you are trying the debugger
Jason
@Jauble
Oct 02 2015 05:05
function destroyer(arr) {
  var newArray = arr.filter(function(value, index, array){
      for (var i = 0; i < arguments.length; i++) {
          return value !== arr[i+1];
        }
    });
    console.log(newArray);
  return newArray;
}

destroyer([1, 2, 3, 1, 2, 3, 4], 2, 3, 4, "");
for loop not look lol
@boris-in-london I've never tried the debugger
Boris
@boris-in-london
Oct 02 2015 05:07
@Jauble put the dubugger; statement in your code right below where you want the debugging to start. then run it
check out line three in the pic i posted
it should start a debugger, and press F10 to go through the code step by step
Jason
@Jauble
Oct 02 2015 05:07
@HermanFassett I thought maybe it would filter out the first argument, then filter out the second argument out of what was left, and so on. I guess it doesn't work that way
Herman Fassett
@HermanFassett
Oct 02 2015 05:08
@Jauble you'll want to use var args = Array.prototype.slice.call(arguments); and loop through that, I don't think arguments actually works the same way, my bad
Also you'll probably need a simple if no else statement in the for loop
I have the finished code
You can't return true inside the for loop
Jason
@Jauble
Oct 02 2015 05:10
@boris-in-london thanks
CamperBot
@camperbot
Oct 02 2015 05:10
jauble sends brownie points to @boris-in-london :sparkles: :thumbsup: :sparkles:
:star: 183 | @boris-in-london | http://www.freecodecamp.com/boris-in-london
Jason
@Jauble
Oct 02 2015 05:10
@HermanFassett thanks I'll try that
Herman Fassett
@HermanFassett
Oct 02 2015 05:11
What is with camperbot and stealing my brownies even if it wouldn't give them anyway
Got the code working down to 12 lines total
Grr that's just as long as my previous method
Haha, combine var initialization and it's 11
Boris
@boris-in-london
Oct 02 2015 05:19
did you guys figure out why the if statement didn't work?
Ademola Adegbuyi
@ooade
Oct 02 2015 05:22
@boris-in-london it cant work
Herman Fassett
@HermanFassett
Oct 02 2015 05:23
@Jauble got it? :smile:
Boris
@boris-in-london
Oct 02 2015 05:23
@marhyorh you were right, the if statement won't work because arguements is === to 3
not 5
Jason
@Jauble
Oct 02 2015 05:25
@HermanFassett not really. I'm not sure if this is anything near what you were talking about. I know you mentioned putting in an if statement too.
function destroyer(arr) {
  var args = Array.prototype.slice.call(arguments);
  var newArray = arr.filter(function(value, index, array){
      for (var i = 0; i < args.length; i++) {
          return value !== args[i+1];
        }
    });
    console.log(newArray);
  return newArray;
}

destroyer([1, 2, 3, 1, 2, 3, 4], 2, 3, 4, "");
Herman Fassett
@HermanFassett
Oct 02 2015 05:27

Replace the return value in the for loop with

if (value === args[i])
        return false;

and right outside the for loop return true

Jason
@Jauble
Oct 02 2015 05:27
@HermanFassett thanks I'll try that
CamperBot
@camperbot
Oct 02 2015 05:27
jauble sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 270 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Jason
@Jauble
Oct 02 2015 05:32
@HermanFassett Sweet, it works! Thanks! I'm trying to figure out why it works now lol
CamperBot
@camperbot
Oct 02 2015 05:32
jauble sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:warning: jauble already gave hermanfassett points
Jason
@Jauble
Oct 02 2015 05:37
So if it returns false, it takes that value out of the array?
Herman Fassett
@HermanFassett
Oct 02 2015 05:37
filters it out yeah
Jason
@Jauble
Oct 02 2015 05:41
Ok cool. But when we start at args[0] aren't we comparing value against the array [1, 2, 3, 1, 2, 3, 4]?
Herman Fassett
@HermanFassett
Oct 02 2015 05:43
for (var i = 1;
Jason
@Jauble
Oct 02 2015 05:43
Oh, I had 0 and it seemed to work lol
I didn't even think about setting it at 1 lol.
Jason
@Jauble
Oct 02 2015 05:52
@HermanFassett this is probably a stupid question (like many of my others), but what does return true do?
Herman Fassett
@HermanFassett
Oct 02 2015 05:53
If it hasn't filtered out the value by that time, it adds it to newArray
Jason
@Jauble
Oct 02 2015 05:54
I see. Thanks
CamperBot
@camperbot
Oct 02 2015 05:54
if you want to thank someone, put an @ before their name!
Jason
@Jauble
Oct 02 2015 05:56
@HermanFassett Well, I'm gonna get some sleep. Thanks for all your help. I really appreciate it
CamperBot
@camperbot
Oct 02 2015 05:56
jauble sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:warning: jauble already gave hermanfassett points
Herman Fassett
@HermanFassett
Oct 02 2015 05:57
Yep, good night
Jason
@Jauble
Oct 02 2015 05:57
Night
Srdjan1
@Srdjan1
Oct 02 2015 06:12
need help with if and else pls
SojournerOctocat
@SojournerOctocat
Oct 02 2015 06:13
@Srdjan1 What do you mean?
Srdjan1
@Srdjan1
Oct 02 2015 06:14

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

// Only change code below this line.

// Only change code above this line.
}

// We use this function to show you the value of your variable in your output box.
var result = myFunction();if(typeof(flip) !== "undefined" && typeof(flip) === "number" && typeof(result) !== "undefined" && typeof(result) === "string"){(function(y,z){return 'flip = ' + y.toString() + ', text = ' + z;})(flip, result);}

@SojournerOctocat can u help?
you*
SojournerOctocat
@SojournerOctocat
Oct 02 2015 06:17
@Srdjan1 Which exercise are you working on?
Srdjan1
@Srdjan1
Oct 02 2015 06:17
@SojournerOctocat java
SojournerOctocat
@SojournerOctocat
Oct 02 2015 06:20
What's the name or url of the waypoint you're working on?
SojournerOctocat
@SojournerOctocat
Oct 02 2015 06:22
The instructions seem pretty straightforward, but I'm happy to help. Do you want the answer, or do you want hints?
Srdjan1
@Srdjan1
Oct 02 2015 06:22
hints would be nice
Ademola Adegbuyi
@ooade
Oct 02 2015 06:24
@Srdjan1
if(flip===0){
  return "heads"
}
else{
 return "tails"
}
SojournerOctocat
@SojournerOctocat
Oct 02 2015 06:25
Ooo-kay.
Srdjan1
@Srdjan1
Oct 02 2015 06:25
@marhyorh nice tnx
CamperBot
@camperbot
Oct 02 2015 06:25
srdjan1 sends brownie points to @marhyorh :sparkles: :thumbsup: :sparkles:
:star: 292 | @marhyorh | http://www.freecodecamp.com/marhyorh
Srdjan1
@Srdjan1
Oct 02 2015 06:26
and @SojournerOctocat tnx to you to
CamperBot
@camperbot
Oct 02 2015 06:26
srdjan1 sends brownie points to @sojourneroctocat :sparkles: :thumbsup: :sparkles:
:star: 326 | @sojourneroctocat | http://www.freecodecamp.com/sojourneroctocat
KristyCat
@KristyCat
Oct 02 2015 06:36

//Let's create an object with a two functions. One attached as a property and one not.
var Car = function() {
this.gear = 1;
function addStyle(styleMe){
return 'The Current Gear Is: ' + styleMe;
}
this.getGear = function() {
return addStyle(this.gear);
};
};

var Bike = function() {
// Only change code below this line.
speed = 100;
function addUnit(value) {
return value + "KM/H";
}

getSpeed = function () {
return addUnit(speed);
};

};

// Only change code above this line.
var myCar = new Car();
var myBike= new Bike();

if(myBike.hasOwnProperty('getSpeed')){(function() {return JSON.stringify(myBike.getSpeed());})();};
cant seem to make speed public, help pls

DTing
@dting
Oct 02 2015 06:39
@KristyCat gear is an example of a public property
KristyCat
@KristyCat
Oct 02 2015 06:40
right but it wants speed to be accessible publicly, this is what i have so far
DTing
@dting
Oct 02 2015 06:40
var Car = function() {
  this.gear = 1; // public
  function addStyle(styleMe){ // private
    return 'The Current Gear Is: ' + styleMe;
  }
  this.getGear = function() { // public
    return addStyle(this.gear);
  };
};
azaleas
@azaleas
Oct 02 2015 06:41
help agruments optional
CamperBot
@camperbot
Oct 02 2015 06:41
no wiki entry for: agruments optional
:pencil: click here to create one now!after creating your page type update to reload it here
azaleas
@azaleas
Oct 02 2015 06:41
help bonfire arguments optional
CamperBot
@camperbot
Oct 02 2015 06:41

:point_right: bonfire arguments optional [wiki]

Explanation:

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

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

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

DTing
@dting
Oct 02 2015 06:41
var Bike = function() {
  // Only change code below this line.
  speed = 100; // There is something different here from gear that makes this private
  function addUnit(value) {
    return value + "KM/H";
  }
  getSpeed = function () {
    return addUnit(speed);
  };
};
KristyCat
@KristyCat
Oct 02 2015 06:42
ok, ill work on it some more, ty
thats helpful actually
DTing
@dting
Oct 02 2015 06:43
np
KristyCat
@KristyCat
Oct 02 2015 06:50
this.getspeed WOOT WOOT
Daniel
@clevadani
Oct 02 2015 07:01
help bonfire Check for Palindromes
CamperBot
@camperbot
Oct 02 2015 07:01

:point_right: bonfire check for palindromes [wiki]

Explanation:

You have to check if the string you get as an input is a palindrome and return true if it is, and false otherwise.

:pencil: read more about bonfire check for palindromes on the FCC Wiki

vickyg12
@vickyg12
Oct 02 2015 07:02
Hi friends, my code is not getting validated for one test case in Bonfire: Falsy Bouncer

function bouncer(arr) {
// Don't show a false ID to this bouncer.
arr = arr.filter(function (n) {
return (n !== undefined && n !== null && n !== false && n !== 0 && n !== "" && n!== isNaN); });
return arr;
}

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

this is my code in it... last test case is not getting validated
NaN
Rex Schrader
@SaintPeter
Oct 02 2015 07:03
@vickyg12 isNaN(n)
Amardeep
@Amardeep91
Oct 02 2015 07:03
Hello
SojournerOctocat
@SojournerOctocat
Oct 02 2015 07:03
Hi
Yosafat Ariel
@yoskakomba
Oct 02 2015 07:04
Hello guys, need help on "waypoint-create-a-javascript-slot-machine"
please teach me a hint not the answer, so I can fully understand
  function runSlots(){
    var slotOne;
    var slotTwo;
    var slotThree;

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

    // Only change code below this line.

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

    // Only change code above this line
Prashanth Chandra
@prashcr
Oct 02 2015 07:05
Is npm 3 safe to use?
i.e. will I run into any major problems?
zentheslayer
@zentheslayer
Oct 02 2015 07:06
need help on html css 22
Yosafat Ariel
@yoskakomba
Oct 02 2015 07:07
hi @zentheslayer maybe I can help
zentheslayer
@zentheslayer
Oct 02 2015 07:07
Your p element should have the text "View more " (with a space after it)
<p> View more
<a href="http://www.freecatphotoapp.com">cat photos</a>
</p>
Yosafat Ariel
@yoskakomba
Oct 02 2015 07:07
This message was deleted
zentheslayer
@zentheslayer
Oct 02 2015 07:08
possible to just chat privately yoskakomba? i dont want to bother the other people in chat .
Vayl
@Vayl
Oct 02 2015 07:42

Guys, first exercise in jQuery. I'm asked to add: $("button").addClass("animated bounce") inside my document ready function:
<script>
$(document).ready(function() { });
</script>

Where do I add it?

between the "()" ?
DTing
@dting
Oct 02 2015 07:43
no between the {}
Vayl
@Vayl
Oct 02 2015 07:44
yeah, it just worked
DTing
@dting
Oct 02 2015 07:44
that is the body of the function anonymous function that $(document).ready calls
Vayl
@Vayl
Oct 02 2015 07:44
weird, i tried it earlier but it didnt work for some reason, probably missed something.
thanks :)
CamperBot
@camperbot
Oct 02 2015 07:44
if you want to thank someone, put an @ before their name!
Vayl
@Vayl
Oct 02 2015 07:44
thanks @dting
CamperBot
@camperbot
Oct 02 2015 07:44
vayl sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1297 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Oct 02 2015 07:44
some of the challenges used to be checked by string matching
im not sure if thats the case still but not having the }); on its own line would not let the challenge pass
something to keep in mind. Sometimes the code needs to be exactly like the challenges hint. or look at the test cases
Vayl
@Vayl
Oct 02 2015 07:45
oh okay
thanks again @dting
CamperBot
@camperbot
Oct 02 2015 07:45
vayl sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:warning: vayl already gave dting points
sina
@sigma161
Oct 02 2015 08:02
anybody there?
Herman Fassett
@HermanFassett
Oct 02 2015 08:05
Mhm
sina
@sigma161
Oct 02 2015 08:06
@HermanFassett can u help me
Herman Fassett
@HermanFassett
Oct 02 2015 08:06
Maybe, what's your problem?
sina
@sigma161
Oct 02 2015 08:06
i stuck in "Waypoint: Make Instances of Objects with a Constructor Function"
challenge
what should i do?
Herman Fassett
@HermanFassett
Oct 02 2015 08:07
So you need to add the property engines to myCar
sina
@sigma161
Oct 02 2015 08:08
i know .but how?
Herman Fassett
@HermanFassett
Oct 02 2015 08:08
I don't want to give the whole thing away because it's one line
But
You set myCar.engines equal to a number
sina
@sigma161
Oct 02 2015 08:09
oh shit .thx buddy
CamperBot
@camperbot
Oct 02 2015 08:09
if you want to thank someone, put an @ before their name!
Herman Fassett
@HermanFassett
Oct 02 2015 08:09
Yup
sina
@sigma161
Oct 02 2015 08:10
@HermanFassett by the way ive another Q
Herman Fassett
@HermanFassett
Oct 02 2015 08:10
Sure
sina
@sigma161
Oct 02 2015 08:12
how i can send code window here to solve my probleme
Herman Fassett
@HermanFassett
Oct 02 2015 08:13
I don't quite understand
sina
@sigma161
Oct 02 2015 08:16
i mean i have problem in some challenge and i want to show my codes to someone here and they can help me to solve problem . what must i do?
just copy\paste my whole code here or there is another way?
Herman Fassett
@HermanFassett
Oct 02 2015 08:26
Well yeah
help code format
CamperBot
@camperbot
Oct 02 2015 08:26

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Aleksandar B.
@aleksandar-b
Oct 02 2015 09:30

One question on this in pure JS and Angular.
MyObject.func() will always write in console "bar":

var myObject = {
    foo: "bar",
    func: function() {
        var self = this;
        console.log("outer func:  this.foo = " + this.foo);
        console.log("outer func:  self.foo = " + self.foo);
    }
};
myObject.func();

Why then in Angular i must cashe this before $http when I want to use that service?

@samosale @dting @SaintPeter
Adam Pinsky
@adampinsky
Oct 02 2015 09:50
Hello everyone. I'm working on the first zipline right. I'm supposed to reverse engineer a portfolio.( I'm using Bootstrap ) And, I don't know why its not working so far. So, the navigation list should collapse when the viewport is too small. Instead, there's nothing. I've basically copied an example straight from the Bootstrap documentation. If someone would be willing to offer sage advice I could totally use it. Thanks in advance!
    <body>
        <div class="container">
            <nav class="navbar navbar-fixed-top">
                <div class="container">
                    <div class="navbar-header">
                        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#nav-links" aria-expanded="false">
                            <span class="sr-only">Toggle navigation</span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                        <a class="navbar-brand navbar-left" href="https://freecodecamp.com/kcpinskys">Adam R. Pinsky</a>
                    </div>
                    <div class="collapse navbar-colapse navbar-right" id="nav-links">
                        <ul class="nav navbar-nav nav-pills">
                            <li class="presentation active"><a href="#home">Home <span class="sr-only">(current)</span></a></li>
                            <li class="presentation"><a href="#about">About</a></li>
                            <li class="presentation"><a href="#portfolio">Portfolio</a></li>
                            <li class="presentation"><a href="#contact">Contact</a></li>
                        </ul>
                    </div>
                </div>
            </nav>
        </div>
    </body>
Mateja Trifunovski
@Matko95
Oct 02 2015 09:51
@adampiinsky just post the codepen link
Averill
@Averill
Oct 02 2015 09:52
Hello there
I need help with Bonfire, Validate US Telephone directory.
CamperBot
@camperbot
Oct 02 2015 09:52
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Averill
@Averill
Oct 02 2015 09:53
bonefire Validate US Telephone Numbers
I wrote a regex thats working perfect as expected.
except this one --> 6505552368
Ademola Adegbuyi
@ooade
Oct 02 2015 09:54
@adampiinsky maybe u didnt add bootstrap to the pen settings
Goto settings -> Css -> Quick add -> Select bootstrap
Averill
@Averill
Oct 02 2015 09:55
automated tests says that it should return 'false' on validation.
however, we have a similar string of same length that should passes the validation. The string is 5555555555
We should get same results for 5555555555 and 6505552368, as both have same length. But the test says we should get 'true' on former and 'false' on latter.
Is it some sort of bug in that bonfire ?
or am I going wrong in direction ?
Can someone please help ?
Thanks
CamperBot
@camperbot
Oct 02 2015 09:57
if you want to thank someone, put an @ before their name!
Ademola Adegbuyi
@ooade
Oct 02 2015 10:00
@Averill what regex did you use?
Averill
@Averill
Oct 02 2015 10:00
@marhyorh this one /(1 )?(((\d\d\d))|(\d\d\d))( |-)?(\d\d\d)( |-)?(\d\d\d\d)/
Coira Ellison
@Coira
Oct 02 2015 10:01
@Averill i think it's the surrounding brackets around the 650 one
as the test says assert.deepEqual(telephoneCheck("(6505552368)"), false);
Averill
@Averill
Oct 02 2015 10:02
bingo!
Adam Pinsky
@adampinsky
Oct 02 2015 10:02
@ marhyorh I was just checking that I had added it. And, it's there. Here's the link to the pen: Adam's Pen
Averill
@Averill
Oct 02 2015 10:02
got it.
thanks @Coira
CamperBot
@camperbot
Oct 02 2015 10:03
averill sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 253 | @coira | http://www.freecodecamp.com/coira
Ademola Adegbuyi
@ooade
Oct 02 2015 10:03
Okay @Averill @adampiinsky
Ademola Adegbuyi
@ooade
Oct 02 2015 10:14
@adampiinsky no style for navbar
add navbar-default or navbar-inverse
Adam Pinsky
@adampinsky
Oct 02 2015 10:15
Thanks @marhyorh . How do you mean?
CamperBot
@camperbot
Oct 02 2015 10:15
adampiinsky sends brownie points to @marhyorh :sparkles: :thumbsup: :sparkles:
:star: 294 | @marhyorh | http://www.freecodecamp.com/marhyorh
Sebastian Dobri
@Seby56
Oct 02 2015 10:15
hi everybody
Adam Pinsky
@adampinsky
Oct 02 2015 10:16
Oh, I see what you mean. I'll give it a go.
Sebastian Dobri
@Seby56
Oct 02 2015 10:16
can someone pls help me with "Bonfire: Check for Palindromes Incomplete" ??
CamperBot
@camperbot
Oct 02 2015 10:16
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Jonathan Coleman
@jondcoleman
Oct 02 2015 10:16
@Seby56 post your code and let us know what your problem is
Sebastian Dobri
@Seby56
Oct 02 2015 10:19
This is my code :

function palindrome(str) {
str = str.toLowerCase().replace(/\s+/g, '');
var len = str.length;
for ( var i = 0; i < Math.floor(len/2); i++ ) {
if (str[i] !== str[len - 1 - i]) {
return false;
}
return true;
}

}

Jonathan Coleman
@jondcoleman
Oct 02 2015 10:19
@Seby56 can you format the code?
wiki format
CamperBot
@camperbot
Oct 02 2015 10:19

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Sebastian Dobri
@Seby56
Oct 02 2015 10:21
function palindrome(str) {
  str = str.toLowerCase().replace(/\s+/g, '');
  var len = str.length;
    for ( var i = 0; i < Math.floor(len/2); i++ ) {
        if (str[i] !== str[len - 1 - i]) {
            return false;
        }
      return true;
    }


}
And it doesn't work for " My age is 0, 0 si ega ym. "
Jonathan Coleman
@jondcoleman
Oct 02 2015 10:22
ok, thanks. And what do you feel is the problem?
CamperBot
@camperbot
Oct 02 2015 10:22
if you want to thank someone, put an @ before their name!
Sebastian Dobri
@Seby56
Oct 02 2015 10:22
The dot (.) at the end of the phrase?
Jonathan Coleman
@jondcoleman
Oct 02 2015 10:23
looks like it also fails for almostomla right?
Sebastian Dobri
@Seby56
Oct 02 2015 10:23
yes
Adam Pinsky
@adampinsky
Oct 02 2015 10:24
@marhyorh, I applied the fix you suggested and it helped. The collapsed nav button is now appearing when it should. Why are the nav links still not showing up otherwise?
....I need to take my dog for a walk so I may not be able to respond until I return :smile:
Jonathan Coleman
@jondcoleman
Oct 02 2015 10:26
@Seby56 looking at it, give me a few
Sebastian Dobri
@Seby56
Oct 02 2015 10:26
@jondcoleman ok
Aleksandar B.
@aleksandar-b
Oct 02 2015 10:27
@Seby56 I think your Regex is not right
@Seby56 try to put W+ instead of s+
Jonathan Coleman
@jondcoleman
Oct 02 2015 10:29
@Seby56 i think your return true statement is in the wrong position
Sebastian Dobri
@Seby56
Oct 02 2015 10:29
@samosale Thanks, one problem solved. But still have the "almostomla" prbolem
CamperBot
@camperbot
Oct 02 2015 10:29
seby56 sends brownie points to @samosale :sparkles: :thumbsup: :sparkles:
:star: 289 | @samosale | http://www.freecodecamp.com/samosale
Aleksandar B.
@aleksandar-b
Oct 02 2015 10:30
@Seby56 "almostomla" is not a palindrome
Sebastian Dobri
@Seby56
Oct 02 2015 10:31
@samosale I know . I moved the return true before last bracket and solved the "almostomla" problem, but I have another now: "0_0 (: /-\ :) 0-0"
Aleksandar B.
@aleksandar-b
Oct 02 2015 10:34
@Seby56 try to put some if statement inside loop, like to see if it is odd number if it is return false, if true continue to second if statement
Sebastian Dobri
@Seby56
Oct 02 2015 10:36
@samosale Honestly I think there's a bug because it says that last string is a palindrome, and it's not.
Aleksandar B.
@aleksandar-b
Oct 02 2015 10:38
@Seby56 try this:
function palindrome(str) {
  str = str.toLowerCase().replace(/\W+/g, '');
  var len = str.length;
  console.log(str);
    for ( var i = 0; i < Math.floor(len/2); i++ ) {
        if(len%2 === 0){
        if (str[i] !== str[len - 1 - i]) {
            return false;
        }
        return false;
        }
      return true;
    }


}
@Seby56 sorry, not correct
Sebastian Dobri
@Seby56
Oct 02 2015 10:40
@samosale I got 3 problems, on "A man, a plan, a canal. Panama" //"My age is 0, 0 si ega ym." //"1 eye for of 1 eye."
Saicharan N
@saicharannivarthi
Oct 02 2015 10:43
can anyone please help me for this ? " Waypoint: Make Object Properties Private "
getting an error of "Program Execution Failure
No user tests were run."
Sebastian Dobri
@Seby56
Oct 02 2015 10:44
@saicharannivarthi All you need to do is to modify this line : this.getSpeed = function
Saicharan N
@saicharannivarthi
Oct 02 2015 10:44
with an output "Program Execution Failure
No user tests were run.
"
yes , @Seby56 I did that , but still error exists.
Sebastian Dobri
@Seby56
Oct 02 2015 10:47
@saicharannivarthi Do you have the code like this
speed = 100;
  function addUnit(value) {
    return value + "KM/H";
  }

  this.getSpeed = function () {
    return addUnit(speed);
  };

};
Saicharan N
@saicharannivarthi
Oct 02 2015 10:48

yes , @Seby56 and i canged it to ,
speed = 100;
function addUnit(value) {
return value + "KM/H";
}

getSpeed = function () {
return addUnit(speed);
};

Sasa Popovic
@Zunior
Oct 02 2015 10:49
Anyone knows what is about Bonfire: Make a Person and making bob to george?
Sebastian Dobri
@Seby56
Oct 02 2015 10:49
@saicharannivarthi last three lines should be: getSpeed = function () { return addUnit(speed); };

@saicharannivarthi

this.getSpeed = function () {
    return addUnit(speed);

It worked for me!

Sasa Popovic
@Zunior
Oct 02 2015 10:52
nevermind
Saicharan N
@saicharannivarthi
Oct 02 2015 10:54
can u send the complete code ?
I may have gone wrong somewhere else .
@Seby56
Sebastian Dobri
@Seby56
Oct 02 2015 10:55
@saicharannivarthi
//Let's create an object with a two functions. One attached as a property and one not.
var Car = function() {
  this.gear = 1;
  function addStyle(styleMe){
    return 'The Current Gear Is: ' + styleMe;
  }
  this.getGear = function() {
    return addStyle(this.gear);
  };
};

var Bike = function() {
  // Only change code below this line.
  speed = 100;
  function addUnit(value) {
    return value + "KM/H";
  }

  this.getSpeed = function () {
    return addUnit(speed);
  };

};

// Only change code above this line.
var myCar = new Car();
var myBike = new Bike();

if(myBike.hasOwnProperty('getSpeed')){(function() {return JSON.stringify(myBike.getSpeed());})();};
@Zunior Can you please send me your code from "Bonfire: Check for Palindromes" ?? Please!
Saicharan N
@saicharannivarthi
Oct 02 2015 10:57
@Seby56 "checkmate ! "
Sebastian Dobri
@Seby56
Oct 02 2015 10:57
@Zunior Can you please send me your code from "Bonfire: Check for Palindromes" ?? Please!
Sasa Popovic
@Zunior
Oct 02 2015 11:00
Here it is
function palindrome(str) {
  // Good luck!
  removed = str.replace(/[^A-Z0-9]/ig,'').toLowerCase();
  removedReverse = removed.split("").reverse().join("");
  if(removed.localeCompare(removedReverse)===0) { return true; }
  else {return false;}
}



palindrome("eye");
Sebastian Dobri
@Seby56
Oct 02 2015 11:02
@Zunior Thanks!
CamperBot
@camperbot
Oct 02 2015 11:02
seby56 sends brownie points to @zunior :sparkles: :thumbsup: :sparkles:
:star: 240 | @zunior | http://www.freecodecamp.com/zunior
Sasa Popovic
@Zunior
Oct 02 2015 11:03
Is there an issue with Bonfire: Make a person??
@catapixel I saw that you answered for issue with make a person. But it still isnt working. I tried code in mozilla and it works fine
Ademola Adegbuyi
@ooade
Oct 02 2015 11:05
No @Zunior
Nikola Simovic
@nikola1970
Oct 02 2015 11:09
hey guys, how do i share a code block like the one above?
Ademola Adegbuyi
@ooade
Oct 02 2015 11:10
This message was deleted
Nikola Simovic
@nikola1970
Oct 02 2015 11:11
@marhyorh thanks, but i need more detailed help :D
CamperBot
@camperbot
Oct 02 2015 11:11
nikola1970 sends brownie points to @marhyorh :sparkles: :thumbsup: :sparkles:
:star: 295 | @marhyorh | http://www.freecodecamp.com/marhyorh
Jonathan Coleman
@jondcoleman
Oct 02 2015 11:11
@nikola1970 check this out
wiki format
CamperBot
@camperbot
Oct 02 2015 11:11

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Nikola Simovic
@nikola1970
Oct 02 2015 11:12
test
alright
thanks :)
CamperBot
@camperbot
Oct 02 2015 11:12
if you want to thank someone, put an @ before their name!
Sasa Popovic
@Zunior
Oct 02 2015 11:16
@marhyorh Ok, can you look at the code. It tells me that it cant change first and last apparently
var Person = function(firstAndLast) {

  fullname = firstAndLast.split(" ");
  firstname = fullname[0];
  lastname = fullname[1];

  this.getFirstName = function() {
    return firstname;
  }
  this.getLastName = function() {
    return lastname;
  }
  this.getFullName = function() {
    return firstname + " " + lastname;
  }
  this.setFirstName = function(first) {
    firstname = first;
  }
  this.setLastName = function(last) {
    lastname = last;
  }
  this.setFullName = function(firstAndLast) {
    fullname = firstAndLast;
  }
};


var bob = new Person('Bob Ross');
bob.getFullName();
Raygendary
@raygendary
Oct 02 2015 11:16
how to know if you are going to put something in the parameter of a method? because i saw some method that have a blank parameter.
Blauelf
@Blauelf
Oct 02 2015 11:24
@Zunior First, your local variables should be declared with var. Then, what you do with fullname, firstname, and lastname in your constructor should also be done in setFullName. You could even move that into setFullName and call this function at the end of your constructor.
I insist on using var (even if it is not enforced without strict mode) as it can avoid misunderstandings. If a variable "firstname" existed in the scope the function "Person" is declared in, this would be re-used instead of creating a new one, so all Persons would share a name.
Aleksandar Benić
@AlexBenic
Oct 02 2015 11:42
This message was deleted
This message was deleted
This message was deleted
This message was deleted
This message was deleted
This message was deleted
vere perrot
@perrot
Oct 02 2015 11:45
Hello my friend,
I am tring to solve the unit "Bonfire: Arguments Optional". I don't know how to pass test case 2 "add(2)(3) should return 5: ". Because I call this function "add(2)(3)" to test. Receiving undefined at the second arguments. The problem is how to get the second argument: expected 3?
Ademola Adegbuyi
@ooade
Oct 02 2015 11:49
@Zunior. Oh i see, for that challenge i made use of prototype like:
Person.prototype.getFullName = function(){
    return firstname + " " + lastname;
};
@perrot
Hints run :console.log(arguments); inside your add func
Raygendary
@raygendary
Oct 02 2015 11:57
is function change() is the same as var change = function()?
Ademola Adegbuyi
@ooade
Oct 02 2015 11:58
No @raygendary
Raygendary
@raygendary
Oct 02 2015 11:58
@marhyorh whats the difference?
Lionel Croes
@lionelx1
Oct 02 2015 12:00
I am currently looking for people who live The Netherlands. Regio Den Haag. Who wants to code after work or in free time together. Let me know
Blauelf
@Blauelf
Oct 02 2015 12:03
@marhyorh How did you manage the scope of firstname and lastname, then? Or did all Person instances share a common name (which would probably still pass the tests)?
Adam Pinsky
@adampinsky
Oct 02 2015 12:08

Could someone please take a look at my code and help me understand what I need to do to get my navbar nav-buttons to show up in the navbar. The collapsed nav-menu appears with the correct buttons once the viewport is small enough. But, the disappear as the viewport's size increases.

<body>
    <div class="container">
        <nav class="navbar navbar-default navbar-fixed-top">
            <div class="container">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#nav-links" aria-expanded="false">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand navbar-left" href="http://freecodecamp.com/kcpinskys">Adam R. Pinsky</a>
                </div>
                <div class="collapse navbar-colapse navbar-right" id="nav-links">
                    <ul class="nav navbar-nav nav-pills">
                        <li class="presentation"><a href="#home">Home</a></li>
                        <li class="presentation"><a href="#about">About</a></li>
                        <li class="presentation"><a href="#portfolio">Portfolio</a></li>
                        <li class="presentation"><a href="#contact">Contact</a></li>
                    </ul>
                </div>
            </div>
        </nav>
    </div>
    <div class="container" id="home">

    </div>
    <div class="container" id="about">

    </div>
    <div class="container" id="portfolio">

    </div>
    <div class="container" id="contact">

    </div>
</body>

Herer is the link to my pen.

vere perrot
@perrot
Oct 02 2015 12:09
@marhyorh thank you for your reply. I run console.log(arguments); in my chrome console. But the console prints nothing of the arguments. I try to log console.log(arguments[0]); gets 2. And log console.log(arguments[1]); gets undefined.
CamperBot
@camperbot
Oct 02 2015 12:09
perrot sends brownie points to @marhyorh :sparkles: :thumbsup: :sparkles:
:star: 296 | @marhyorh | http://www.freecodecamp.com/marhyorh
Shair Mir
@ShairMir
Oct 02 2015 12:13
bf check for palindromes
CamperBot
@camperbot
Oct 02 2015 12:13

:fire:Bonfire: Check for Palindromes :link:

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



palindrome("eye");

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

more info:  bf details | bf links | hint

Shair Mir
@ShairMir
Oct 02 2015 12:13
hint
CamperBot
@camperbot
Oct 02 2015 12:13
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Ademola Adegbuyi
@ooade
Oct 02 2015 12:16
@raygendary function change() can be called anywhere within that scope while var change = function() can only be called after its declaration
Trimpot
@Trimpot
Oct 02 2015 12:21
anyone there
Blauelf
@Blauelf
Oct 02 2015 12:24
Sure
Raygendary
@raygendary
Oct 02 2015 12:25
@marhyorh SO function change() is more flexible?
Ademola Adegbuyi
@ooade
Oct 02 2015 12:26
yes @raygendary
@adampiinsky here's your mistake
change
<div class="collapse navbar-colapse navbar-right" id="nav-links">
// to ->
<div class="nav-collapse navbar-colapse navbar-right" id="nav-links">
Aleksander Gębicki
@Takumar
Oct 02 2015 12:33
@adampiinsky <div class="collapse navbar-collapse navbar-right" id="nav-links">
Maybe in such way.
kaushalmathpal
@kaushalmathpal
Oct 02 2015 12:53
$("#left-well") .parent("target1") .css("background-color","red");
what;s wrong with this
Karolis
@Luomint
Oct 02 2015 13:07
bf roman
CamperBot
@camperbot
Oct 02 2015 13:07

:fire:Bonfire: Roman Numeral Converter :link:

function convert(num) {
 return num;
}

convert(36);

Convert the given number into a roman numeral.

more info:  bf details | bf links | hint

Karolis
@Luomint
Oct 02 2015 13:07
hint
CamperBot
@camperbot
Oct 02 2015 13:07
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Aleksander Gębicki
@Takumar
Oct 02 2015 13:08
@kaushalmathpal I think you are trying to change css of "target1" element, not "left-well"
in your code now you are trying to reach parent of "left-well". Try to find parent of "target1". $("#target1").parent()
@kaushalmathpal you call function on element "#target1" to find its parent, then you change its css as you like:
$("your_element").parent().css("your_css__give_color_or_anything");
Do yoy know what I mean?
Aleksander Gębicki
@Takumar
Oct 02 2015 13:15
You are doing "Waypoint: Target the Parent of an Element Using jQuery" now? Am i right?
kaushalmathpal
@kaushalmathpal
Oct 02 2015 13:19
 $("#target1") .parent() .css("background-color","red");
@Takumar i tried this...its still not getting right
Aleksander Gębicki
@Takumar
Oct 02 2015 13:20
@kaushalmathpal very good, but please don't put spaces before periods (dots).
kaushalmathpal
@kaushalmathpal
Oct 02 2015 13:20
@Takumar i haven't put any spaces i guess...
Aleksander Gębicki
@Takumar
Oct 02 2015 13:21
@kaushalmathpal but there are in your code you presented here.
kaushalmathpal
@kaushalmathpal
Oct 02 2015 13:21
@Takumar got ur point now...thanks..
CamperBot
@camperbot
Oct 02 2015 13:21
kaushalmathpal sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 377 | @takumar | http://www.freecodecamp.com/takumar
Aleksander Gębicki
@Takumar
Oct 02 2015 13:21
@kaushalmathpal so I understand that it works now?
kaushalmathpal
@kaushalmathpal
Oct 02 2015 13:21
yes
Aleksander Gębicki
@Takumar
Oct 02 2015 13:22
In HTML or in many places in other languages spaces are not important but here they make difference.
kaushalmathpal
@kaushalmathpal
Oct 02 2015 13:23
right
Maddy
@maddymaster
Oct 02 2015 13:29
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }
form#cat-photo-element {background-color:green;}
  h2 {
    font-family: Lobster, Monospace;
  }

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

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

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

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

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

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

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

<form action="/submit-cat-photo" id="cat-photo-form">
  <label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
  <label><input type="radio" name="indoor-outdoor"> Outdoor</label>
  <label><input type="checkbox" name="personality" checked> Loving</label>
  <label><input type="checkbox" name="personality"> Lazy</label>
  <label><input type="checkbox" name="personality"> Energetic</label>
  <input type="text" placeholder="cat photo URL" required>
  <button type="submit">Submit</button>
</form>
I cant get the form element should have the background-color of green.
@hugoender I had an internet outage the other day I couldnt respond back. thanks so much for helping. I am progressing well.
CamperBot
@camperbot
Oct 02 2015 13:30
maddymaster sends brownie points to @hugoender :sparkles: :thumbsup: :sparkles:
:star: 212 | @hugoender | http://www.freecodecamp.com/hugoender
Maddy
@maddymaster
Oct 02 2015 13:31
anybody please help me finish this waypoint in html. this is waypoint 39 waypoint-use-an-id-attribute-to-style-an-element
I cant get the form element to have the background-color of green. what am I doing wrong?
kaushalmathpal
@kaushalmathpal
Oct 02 2015 13:34
@maddymaster u have to use id element...therefore under the style element..remove form only use #
Hugo
@hugoender
Oct 02 2015 13:34
@maddymaster no problem. Let's get this resolved you. You need to use the same id name you used for the form element in the styles section
John Oss
@johnaoss
Oct 02 2015 13:34
can anyone help me in the Waypoint: Add Different Padding to Each Side of an Element? I'm adding the padding but it doesn't seem to be doing anything
Maddy
@maddymaster
Oct 02 2015 13:35
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }
#cat-photo-element {background-color:green;}
  h2 {
    font-family: Lobster, Monospace;
  }

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

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

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

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

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

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

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

<form action="/submit-cat-photo" id="cat-photo-form">
  <label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
  <label><input type="radio" name="indoor-outdoor"> Outdoor</label>
  <label><input type="checkbox" name="personality" checked> Loving</label>
  <label><input type="checkbox" name="personality"> Lazy</label>
  <label><input type="checkbox" name="personality"> Energetic</label>
  <input type="text" placeholder="cat photo URL" required>
  <button type="submit">Submit</button>
</form>
Michael Bomholt
@bomholtm
Oct 02 2015 13:35
@johnaoss link pls
Maddy
@maddymaster
Oct 02 2015 13:35
I removed it still no go @hugoender
John Oss
@johnaoss
Oct 02 2015 13:35
@bomholt
Hugo
@hugoender
Oct 02 2015 13:36
If you are trying to style an element you use form. If you are trying to style a class you use .class-name. If you are styling an id you use #id-name
@maddymaster you are not using the same id name
Exact same id name needs to be used
Read the id name carefully ;)
Michael Bomholt
@bomholtm
Oct 02 2015 13:37
@johnaoss whats the exact problem?
Carla Roos
@carlaroos
Oct 02 2015 13:37

im stuck at: Waypoint: Uncomment HTML.
Be sure to delete all trailing comment tags, i.e. -->.

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

<h2>CatPhotoApp</h2>
<!--text3-->

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

what am i supposed to do? :o

Maddy
@maddymaster
Oct 02 2015 13:37
aah @hugoender yikes! :clap:
phew got it i m onto next waypoint thanks so much owe you for this @hugoender
CamperBot
@camperbot
Oct 02 2015 13:37
maddymaster sends brownie points to @hugoender :sparkles: :thumbsup: :sparkles:
:warning: maddymaster already gave hugoender points
Michael Bomholt
@bomholtm
Oct 02 2015 13:38
you just need to do the same stuff from the red box to the green box @johnaoss
John Oss
@johnaoss
Oct 02 2015 13:38
@bomholt ohhh thank you!
CamperBot
@camperbot
Oct 02 2015 13:38
johnaoss sends brownie points to @bomholt :sparkles: :thumbsup: :sparkles:
:star: 311 | @bomholt | http://www.freecodecamp.com/bomholt
John Oss
@johnaoss
Oct 02 2015 13:38
It's picky on the order of the padding
Michael Bomholt
@bomholtm
Oct 02 2015 13:39
no problem ah lol
i just did copy and paste
:P
Sasa Popovic
@Zunior
Oct 02 2015 13:39
@Blauelf Thx for tips. But how can I call method that is inside function. It tells me that function isnt defined. I tried setfullname(something) and also this.setfullname(something) and tried to put it on beggining and on the end of function.
CamperBot
@camperbot
Oct 02 2015 13:39
zunior sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star: 326 | @blauelf | http://www.freecodecamp.com/blauelf
Jonathan Coleman
@jondcoleman
Oct 02 2015 13:39
@carlaroos do you know what an HTML comment tag is?
John Oss
@johnaoss
Oct 02 2015 13:39
yeah that definitely worked, I tried it with top/left/bot/right to no avail
Michael Bomholt
@bomholtm
Oct 02 2015 13:40
@johnaoss sometimes it cares about stupid things ... had the same kind of problem several times
Carla Roos
@carlaroos
Oct 02 2015 13:40
@jondcoleman not really.. isnt it the <!-- or the //? :worried: im new so i dont know a thing
Jonathan Coleman
@jondcoleman
Oct 02 2015 13:41
No worries @carlaroos. Check this out and see if you can figure it out: http://www.w3schools.com/html/html_comments.asp
Michael Bomholt
@bomholtm
Oct 02 2015 13:41
@johnaoss you may also send a bug report when stuff like this happens
Jonathan Coleman
@jondcoleman
Oct 02 2015 13:42
If not, let us know @carlaroos
Carla Roos
@carlaroos
Oct 02 2015 13:43
@jondcoleman now it worked. thank you :smile:
CamperBot
@camperbot
Oct 02 2015 13:43
carlaroos sends brownie points to @jondcoleman :sparkles: :thumbsup: :sparkles:
:star: 114 | @jondcoleman | http://www.freecodecamp.com/jondcoleman
Jonathan Coleman
@jondcoleman
Oct 02 2015 13:43
great!
John Oss
@johnaoss
Oct 02 2015 13:44
@bomholt is that a valid reason?
Sasa Popovic
@Zunior
Oct 02 2015 13:46
@Blauelf Oh, needed return before method
Michael Bomholt
@bomholtm
Oct 02 2015 13:47
@johnaoss i dont know. but in a real world example the css file wouldnt care if you putt top oder buttom first.
-t
John Oss
@johnaoss
Oct 02 2015 13:47
@bomholt makes sense
Michael Bomholt
@bomholtm
Oct 02 2015 13:47
or bottom
jeeez
John Oss
@johnaoss
Oct 02 2015 13:47
turns out theres already an issue created for it
so it should be fine
Michael Bomholt
@bomholtm
Oct 02 2015 13:48
it should yea
anyway happy coding :shipit:
John Oss
@johnaoss
Oct 02 2015 13:49
you too!
Kevin Diem
@kgdiem
Oct 02 2015 14:01
Hi, working on Bonfire: Sorted Union, not sure of the best way to handle an undetermined amount of arguments. Any recommended reading for this?
or just use like arguments.each?
nvm seems arrays don't have that function
arguments*
tva10
@tva10
Oct 02 2015 14:09
@kgdiem so I think you should use arguments.length;.
Kevin Diem
@kgdiem
Oct 02 2015 14:10

I used

var args = Array.prototype.slice.call(arguments);

thanks tho @tva10

CamperBot
@camperbot
Oct 02 2015 14:10
kgdiem sends brownie points to @tva10 :sparkles: :thumbsup: :sparkles:
:star: 278 | @tva10 | http://www.freecodecamp.com/tva10
tva10
@tva10
Oct 02 2015 14:11
@kgdiem so I prefer using loops there.
rickgordon86
@rickgordon86
Oct 02 2015 14:16

Hey guys can I get a little help on Waypoint: Manipulate Arrays With shift
var ourArray = ["Stimpson", "J", ["cat"]];
ourRemoved = ourArray.shift();
// ourArray now equals ["J", ["cat"]].

var myArray = ["John", 23, ["dog", 3]];
// Only change code below this line.
myArray.shift();
var myRemoved = myArray; // This should be ["John"] and myArray should now be [23, ["dog", 3]].

// Only change code above this line.

Kevin Diem
@kgdiem
Oct 02 2015 14:19
@rickgordon86 can you post it formatted?
Aleksandar B.
@aleksandar-b
Oct 02 2015 14:19
@rickgordon86 type
var myRemoved = myArray.shift();
Kevin Diem
@kgdiem
Oct 02 2015 14:19
@rickgordon86 but I think you need to do myArray = M
@samosale beat me to it lol
rickgordon86
@rickgordon86
Oct 02 2015 14:20
i tried that and its not passing
Kevin Diem
@kgdiem
Oct 02 2015 14:21
@rickgordon86 do myArray = myArray.shift(); that will work with how your code is currently written
Priya Kamath-Shenoy
@PriyaKamathShenoy
Oct 02 2015 14:23
hi. I need help with Bonfire: Find the Longest Word in a String
Srdjan1
@Srdjan1
Oct 02 2015 14:23
@rickgordon86 var myRemoved = myArray.shift();
Priya Kamath-Shenoy
@PriyaKamathShenoy
Oct 02 2015 14:23

I have given code: function findLongestWord(str) {
var strArray= str.split(' ');
var maxLength =0;
for(i=0;strArray[i].length;i++)
{
if (strArray[i].length>maxLength)
maxLength= strArray[i].length;
}
return maxLength;
}

findLongestWord("The quick brown fox jumped over the lazy dog");

Aleksandar B.
@aleksandar-b
Oct 02 2015 14:23
@rickgordon86 delete myArray.shift();
Kevin Diem
@kgdiem
Oct 02 2015 14:24
@rickgordon86 yes, just checked out the waypoint. All you need to do is add .shift(); to the variable already written
var myArray = ["John", 23, ["dog", 3]];
// Only change code below this line.

var myRemoved = myArray.shift(); // This should be ["John"] and myArray should now be [23, ["dog", 3]].

// Only change code above this line.
Michał F
@mflisiuk
Oct 02 2015 14:24

Hi, I am doing a "Falsy bouncer" challenge

function bouncer(arr) {

  var arr1 = [];

  for(i=0;i<arr.length;i++)
{   var x = Boolean(arr[i]);
  if(x) {
    console.log(arr1.push(arr[i]));
        }
  else
        {
      console.log('b');
        }
}
  return arr1;
}

bouncer(["a", "b", "c"], "");

Whats wrong with this code? Its returning only "true" arguments.

Aleksandar B.
@aleksandar-b
Oct 02 2015 14:26

@PriyaKamathShenoy this line is not correct

for(i=0;strArray[i].length;i++)

remove [i]

Priya Kamath-Shenoy
@PriyaKamathShenoy
Oct 02 2015 14:26
hi @samosale thanks for the help
Srdjan1
@Srdjan1
Oct 02 2015 14:27
@rickgordon86 var myRemoved = myArray.shift();
Kevin Diem
@kgdiem
Oct 02 2015 14:27
@PriyaKamathShenoy you also need var i = 0;
Srdjan1
@Srdjan1
Oct 02 2015 14:27
100% work
Aleksandar B.
@aleksandar-b
Oct 02 2015 14:27
@kgdiem he needs to delete myArray.shift(); that is above that code. It is changing his array. No need for two shift().
Kevin Diem
@kgdiem
Oct 02 2015 14:27
I just went to the bonfire and what I wrote is the correct answer :p we are both right
rickgordon86
@rickgordon86
Oct 02 2015 14:28
Thanks for the help but why does myArray get changed when its myRemoved we are changing ?
CamperBot
@camperbot
Oct 02 2015 14:28
if you want to thank someone, put an @ before their name!
Kevin Diem
@kgdiem
Oct 02 2015 14:30
@rickgordon86 you are setting myRemoved to the value being deleted from myArray.shift(). You can call myArray.shift() by itself and it will change the array.
tva10
@tva10
Oct 02 2015 14:31
@mflisiuk Hey, remove there all console.log(s. may be they breaks test cases.
tva10
@tva10
Oct 02 2015 14:31
@mflisiuk also then you push truthly element.
@mflisiuk
function bouncer(arr) {

  var arr1 = [];

  for(i=0;i<arr.length;i++)
{   
   if(arr[i]) 
    arr1.push(arr[i]);

}
  return arr1;
}
rickgordon86
@rickgordon86
Oct 02 2015 14:33
@kgdiem Thanks for the reply
CamperBot
@camperbot
Oct 02 2015 14:33
rickgordon86 sends brownie points to @kgdiem :sparkles: :thumbsup: :sparkles:
:star: 230 | @kgdiem | http://www.freecodecamp.com/kgdiem
janjava
@janjava
Oct 02 2015 14:34
beginners help question
how do I apply a css class declaration to h2 element
Kevin Diem
@kgdiem
Oct 02 2015 14:34
<h2 class="class"></h2>
tva10
@tva10
Oct 02 2015 14:35
@janjava <h2 class="className1 className2 ...">
janjava
@janjava
Oct 02 2015 14:36
thanks, I'm going to try it now
CamperBot
@camperbot
Oct 02 2015 14:36
if you want to thank someone, put an @ before their name!
janjava
@janjava
Oct 02 2015 14:37
@tva10 thanks, I'm going to try it now
CamperBot
@camperbot
Oct 02 2015 14:37
janjava sends brownie points to @tva10 :sparkles: :thumbsup: :sparkles:
:star: 279 | @tva10 | http://www.freecodecamp.com/tva10
Priya Kamath-Shenoy
@PriyaKamathShenoy
Oct 02 2015 14:37
@kgdiem @samosale I have changed my code:

function findLongestWord(str) {
var strArray= str.split(' ');
var maxLength =0;
for(var i=0;i<=strArray.length;i++)
{
if (strArray[i].length>maxLength)
maxLength= strArray[i].length;
}
return maxLength;
}

findLongestWord("The quick brown fox jumped over the lazy dog");

but yet i am not able to get the output right.
Aleksandar B.
@aleksandar-b
Oct 02 2015 14:38
@PriyaKamathShenoy you need curly bracket after if statement
Michał F
@mflisiuk
Oct 02 2015 14:39
@tva10 : why cannot I push truthly element? Do I have to use filter(); method?
@tva10 : console.log was causing the problem. thanks for help
CamperBot
@camperbot
Oct 02 2015 14:40
mflisiuk sends brownie points to @tva10 :sparkles: :thumbsup: :sparkles:
Priya Kamath-Shenoy
@PriyaKamathShenoy
Oct 02 2015 14:40
@samosale i tried that. but the problem is it says "cannot find property 'length' "
CamperBot
@camperbot
Oct 02 2015 14:40
:star: 280 | @tva10 | http://www.freecodecamp.com/tva10
janjava
@janjava
Oct 02 2015 14:40

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

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

Chris
@Shifthawke
Oct 02 2015 14:40
o.0
tva10
@tva10
Oct 02 2015 14:40
@mflisiuk So you should use filter there. It is easy.
Chris
@Shifthawke
Oct 02 2015 14:40
@janjava Whatcha got?
tva10
@tva10
Oct 02 2015 14:41
@mflisiuk one line code:
return arr.filter(val=>val);
Jason Fernandes
@whereissql
Oct 02 2015 14:41
shed everywhere stretching...hairball run catnip lol i love that waypoint
Chris
@Shifthawke
Oct 02 2015 14:41
I know lol.
Aleksandar B.
@aleksandar-b
Oct 02 2015 14:41
@PriyaKamathShenoy remove <= and type <
Chris
@Shifthawke
Oct 02 2015 14:41
Makes me chuckle everytime I see it.
janjava
@janjava
Oct 02 2015 14:42
@Shifthawke beginners help. I'm so stuck. trying to apply CSS class declaration .red-text to h2
Michał F
@mflisiuk
Oct 02 2015 14:42
@tva10: why (val => val) I dont get it how this function works.
Chris
@Shifthawke
Oct 02 2015 14:42
How do you know to write a class?
I don't want to just give you the answer but it goes into your h2
````
janjava
@janjava
Oct 02 2015 14:42
just following the prompt
okay, I'll try
Chris
@Shifthawke
Oct 02 2015 14:43
<h2 class=your class here>
tva10
@tva10
Oct 02 2015 14:43
@mflisiuk it is same like
arr.filter(function(val, index, arr){
    return val;
});
Michał F
@mflisiuk
Oct 02 2015 14:43

@janjava: create class declaration

.red-text {
color:red;
}

and add class to h2

<h2 class="red-text">
Chris
@Shifthawke
Oct 02 2015 14:43
@mflisiuk Don't give him the answer
Gotta let him problem solve.
Michał F
@mflisiuk
Oct 02 2015 14:43
Ok, sorry guys
janjava
@janjava
Oct 02 2015 14:44
I appreciate the help. I tried that first, it didn't work, I must've done something wrong. I'll try again
Chris
@Shifthawke
Oct 02 2015 14:44
It's ok lol. We try to get him to think. @mflisiuk
If that's what you had, then you might be missing a ; somewhere or ".
Make sure you don't put the . in the h2 class.
(I Did that first time round.)
Aleksandar B.
@aleksandar-b
Oct 02 2015 14:46
@PriyaKamathShenoy did you get correct answer?
janjava
@janjava
Oct 02 2015 14:46
thanks, going back to code camp to try again. btw, it's "her", lol
CamperBot
@camperbot
Oct 02 2015 14:46
if you want to thank someone, put an @ before their name!
janjava
@janjava
Oct 02 2015 14:48
@Shifthawke @mflisiuk thanks, going back to code camp to try again. btw, it's "her", lol
CamperBot
@camperbot
Oct 02 2015 14:48
janjava sends brownie points to @shifthawke and @mflisiuk :sparkles: :thumbsup: :sparkles:
:star: 366 | @shifthawke | http://www.freecodecamp.com/shifthawke
:star: 192 | @mflisiuk | http://www.freecodecamp.com/mflisiuk
Chris
@Shifthawke
Oct 02 2015 14:48
I was afraid you were German.
Jan becomes yahn. @janjava lol
janjava
@janjava
Oct 02 2015 14:49
lol
Chris
@Shifthawke
Oct 02 2015 14:49
We're here if you need us.
<--- Is also a she.
Priya Kamath-Shenoy
@PriyaKamathShenoy
Oct 02 2015 14:49
@samosale thanks . got it. its working now.
CamperBot
@camperbot
Oct 02 2015 14:49
priyakamathshenoy sends brownie points to @samosale :sparkles: :thumbsup: :sparkles:
:star: 292 | @samosale | http://www.freecodecamp.com/samosale
janjava
@janjava
Oct 02 2015 14:49
thanks
CamperBot
@camperbot
Oct 02 2015 14:49
if you want to thank someone, put an @ before their name!
janjava
@janjava
Oct 02 2015 14:51
@Shifthawke thanks. what's <---
Chris
@Shifthawke
Oct 02 2015 14:51
pointing to myself lol.
Jason Fernandes
@whereissql
Oct 02 2015 14:51
its pointing to herself
Chris
@Shifthawke
Oct 02 2015 14:52
I like my pointers.
janjava
@janjava
Oct 02 2015 14:52
@Shifthawke I'm so new, lol, got it now
Chris
@Shifthawke
Oct 02 2015 14:53
it's okay. You'll be shooting the breeze with us soon enough. If you didn't see it, we have a casual chat too. https://gitter.im/FreeCodeCamp/Casual
vere perrot
@perrot
Oct 02 2015 15:04
Hello,
I try to solve unit "Bonfire: Where art thou". But the test case response me a message "Unexpected token }". I don't know what's happened? And how to fix that? Thanks.
CamperBot
@camperbot
Oct 02 2015 15:04
if you want to thank someone, put an @ before their name!
tva10
@tva10
Oct 02 2015 15:06
@perrot There is JS parse error
may be you miss { or } somethere
check code yourself, or put code here
if you want
vere perrot
@perrot
Oct 02 2015 15:10
@tva10 thank for your reply. I already fix that.
CamperBot
@camperbot
Oct 02 2015 15:10
perrot sends brownie points to @tva10 :sparkles: :thumbsup: :sparkles:
:star: 281 | @tva10 | http://www.freecodecamp.com/tva10
Stathis Mitropoulos
@StathisMitro
Oct 02 2015 15:11
Hello guys, I need some help! I am in Zipline: Build a Random Quote Machine and i am trying to finish this step... I have completed the quote machine but I have problem to the twitter button. It works only for the first quote! After the first tweet it keeps the initial quote and post the same irrespective of the new quotes. Take a look to my code http://codepen.io/StathisMitro/full/EVZGqw/ and tell me whats giong wrong...
Coira Ellison
@Coira
Oct 02 2015 15:25
@StathisMitro declare theAuthor and theQuote outside your new quote click function
Maddy
@maddymaster
Oct 02 2015 15:32
<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">
    <div class="well col-xs-6">

    </div>
    <div class="well col-xs-6">

    </div>
  </div>
</div>
I cant clear this task - Add a div element with the class well inside each of your div elements with the class "col-xs-6" (waypoint-create-bootstrap-wells)
help pls :worried:
CamperBot
@camperbot
Oct 02 2015 15:33
no wiki entry for: pls worried
:pencil: click here to create one now!after creating your page type update to reload it here
Ademola Adegbuyi
@ooade
Oct 02 2015 15:36
@maddymaster add a div element with the class "well" inside the "col-xs-6" class i.e
<div class="col-xs-6">
<div class="well">
</div>
</div>
Maddy
@maddymaster
Oct 02 2015 15:38
aah okay let me try that
that worked. @marhyorh thank you! :smile: :+1:
CamperBot
@camperbot
Oct 02 2015 15:40
maddymaster sends brownie points to @marhyorh :sparkles: :thumbsup: :sparkles:
:star: 297 | @marhyorh | http://www.freecodecamp.com/marhyorh
JackSparrowthethird
@JackSparrowthethird
Oct 02 2015 15:50
@JackSparrowthethird
Is there a possibility, to put the linking right into the <button> expression?
<button class='btn btn-block' ><a href='http://freecodecamp.com/jacksparrowthethird/' target='_blank'>FreeCodeCamp</a></button>
This code puts the link only into the text
<a class='btn btn-block'> text </a> results in another design
Herman Fassett
@HermanFassett
Oct 02 2015 15:53
Try adding a type="button" to the last part
Like
<a href="#" type="button" class="btn btn-block">Text</a>
JackSparrowthethird
@JackSparrowthethird
Oct 02 2015 15:54
@HermanFassett Thank You
CamperBot
@camperbot
Oct 02 2015 15:54
jacksparrowthethird sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 272 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
JackSparrowthethird
@JackSparrowthethird
Oct 02 2015 15:57
Even with the type keyword, the design is still changed
(github link on the botton)
*bottom
Jonathan
@jonjitsu
Oct 02 2015 15:59
Anyone have the issue on codepen where bootstrap works well in the preview at the bottom but not in full page mode?
Ademola Adegbuyi
@ooade
Oct 02 2015 16:05
@JackSparrowthethird i dont get but you can check on my portfolio pen http://codepen.io/marhyorh/pen/JdQxbg
Jason Wood
@catapixel
Oct 02 2015 16:24
@Zunior you wrote "I saw that you answered for issue with make a person. But it still isnt working. I tried code in mozilla and it works fine" but I can't remember that conversation or response on github. If you have an issue or you can be more specific with where I helped so I can go back and look I will be happy to. In either case I'm glad it's working in mozilla fine.
Herman Fassett
@HermanFassett
Oct 02 2015 16:26
@marhyorh very nice
Pratik Ratnaparkhi
@pratikr1593
Oct 02 2015 16:55
function reverseString(str) {
  return str;
}

reverseString("hello", "");

You may need to turn the string into an array before you can reverse it.

Your result must be a string.

"hello" should become "olleh".
from where should I start, I tried multiple things but it gives random errors
Herman Fassett
@HermanFassett
Oct 02 2015 16:56
@pratikr1593 what've you tried?
zentheslayer
@zentheslayer
Oct 02 2015 16:56
hi can someone help me.
Add a div element with the class well inside each of your div elements with the class "col-xs-6"
its bootstrap exercise 92.
Pratik Ratnaparkhi
@pratikr1593
Oct 02 2015 16:57
@HermanFassett tried multiple code, that may sound stupid
Herman Fassett
@HermanFassett
Oct 02 2015 16:57
@zentheslayer yes, what have you tried?
Pratik Ratnaparkhi
@pratikr1593
Oct 02 2015 16:57
function reverseString(str) {
  return str;
}
var hello = "hello howdy, Greetings from Earth";

var array = hello.split(' ');




reverseString("hello", "");
Herman Fassett
@HermanFassett
Oct 02 2015 16:57
Your code should all be inside the reverseString function @pratikr1593
zentheslayer
@zentheslayer
Oct 02 2015 16:58
<div class="container-fluid">
<h3 class="text-primary text-center">jQuery Playground</h3>
<div class="row">
<div class="col-xs-6 well">
<div class="col-xs-6 well">
</div>
</div>
<div class="col-xs-6 well">
<div class="col-xs-6 well">
</div>
</div>
</div>
</div>
Christopher Clemons
@phonofidelic
Oct 02 2015 16:59
@pratikr1593 I think "array" is a reserved term. Have you tried re-assigning your "hello" variable instead?
Herman Fassett
@HermanFassett
Oct 02 2015 16:59
@zentheslayer only the outside div needs class col-xs-6 and only the inner one needs class well
JavierAlejandro
@JavierAlejandro
Oct 02 2015 16:59
Hi! :D
Herman Fassett
@HermanFassett
Oct 02 2015 17:00
@JavierAlejandro Hey
zentheslayer
@zentheslayer
Oct 02 2015 17:00
Thank you @HermanFassett !
CamperBot
@camperbot
Oct 02 2015 17:00
zentheslayer sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 273 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Herman Fassett
@HermanFassett
Oct 02 2015 17:01

@pratikr1593 Your code should be inside the function like

function reverseString(str) {
    var hello = "hello howdy, Greetings from Earth";
    var array = hello.split(' ');
    return str;
}
reverseString("hello", "");

It's still not the answer, but that's the first thing to do

Pratik Ratnaparkhi
@pratikr1593
Oct 02 2015 17:02
@HermanFassett thanks
CamperBot
@camperbot
Oct 02 2015 17:02
pratikr1593 sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
JavierAlejandro
@JavierAlejandro
Oct 02 2015 17:02
How are you? @HermanFassett one question, do you work with JS?
CamperBot
@camperbot
Oct 02 2015 17:02
:star: 274 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Herman Fassett
@HermanFassett
Oct 02 2015 17:03
@JavierAlejandro not as in a job
Stathis Mitropoulos
@StathisMitro
Oct 02 2015 17:06
@Coira Thank you very much !!! :)
CamperBot
@camperbot
Oct 02 2015 17:06
stathismitro sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 254 | @coira | http://www.freecodecamp.com/coira
Pratik Ratnaparkhi
@pratikr1593
Oct 02 2015 17:06
@HermanFassett it doesnt work
function reverseString(str) {

    var hello = "hello Howdy, Greetings from Earth";
    var array = hello.split(" ");

  var array = hello.reverse();


    return str;
}
reverseString("hello", "");
@HermanFassett I am confused. can you explain?
or tell me the code to it?
Herman Fassett
@HermanFassett
Oct 02 2015 17:07
First off, hello is messing things up because you're not using the string that's input as a parameter
So it should be var hello = str; or just use str directly
And don't declare array twice and probably name it arr so as not to use a keyword

So

var arr = ...
arr = hello.reverse();

and then you need to convert arr back into a string and return that string

And by the way, as of right now, you're telling the split function to split at every space instead of every character
Pratik Ratnaparkhi
@pratikr1593
Oct 02 2015 17:18
function reverseString(str) {
  return str;


var hello = str;
  var arr = "Hello Howdy, Greetings From Earth";

arr = hello.reverse();






}

reverseString("hello", "");
@HermanFassett am I going right?
i know somethings wrong.
But I am having a hard time with this one
I'm on Bonfire: Reverse a String
Herman Fassett
@HermanFassett
Oct 02 2015 17:19
function reverseString(str) {
    var hello = str;
    var arr = hello.reverse();
    hello = arr.... // convert back to string
    return hello;
}
Christopher Clemons
@phonofidelic
Oct 02 2015 17:20
@pratikr1593 you need your "return str" statement to be the last line in your function
ELRuncho
@ELRuncho
Oct 02 2015 17:22
This message was deleted
Stefan Stokic
@StefanStokic
Oct 02 2015 17:22
Hi guys I know im annoying, but can someone tell me what they think of the nav bar I just changed/how I could make it better? http://stefanstokic.herokuapp.com
Pratik Ratnaparkhi
@pratikr1593
Oct 02 2015 17:23
I didnt got 'arr...' line. I might be too lame, but any help is much appreciated. @HermanFassett
@phonofidelic
Herman Fassett
@HermanFassett
Oct 02 2015 17:24
You'll want to use the join() function somehow
Aleksandar B.
@aleksandar-b
Oct 02 2015 17:24
@pratikr1593 you are puting return statement in the head of your function. In that case it returns the variable and break the code from executing further
ELRuncho
@ELRuncho
Oct 02 2015 17:26
This message was deleted
Ademola Adegbuyi
@ooade
Oct 02 2015 17:26
@KingInTheNorth nice style :+1:
Aleksandar B.
@aleksandar-b
Oct 02 2015 17:26
@KingInTheNorth I could't saw your nav bar links . Only later I figured out that there are links in the right side. Maybe change color.
ELRuncho
@ELRuncho
Oct 02 2015 17:26

Hi guys, Im stuck on the Palindrome bonfire. I'm trying to remove both spaces and punctuation from the strings but if I remove the dots and commas the strings without punctiation get evaluated wrongly and viceversa. heres my code
function palindrome(str) {
str=str.replace(/./g,"");
str=str.replace(/,/g,"");
str=str.replace(/ /,"").toLowerCase();
var newstr=str.split('').reverse().join('');

if(str!=newstr){
return false;
}else{
return true;
}
}

what am I doing wrong?
Bill
@kirah1314
Oct 02 2015 17:27
help format
CamperBot
@camperbot
Oct 02 2015 17:27

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Herman Fassett
@HermanFassett
Oct 02 2015 17:27
Using replace(/\W|_/gi, "") is much cleaner
ELRuncho
@ELRuncho
Oct 02 2015 17:28
This message was deleted
@HermanFassett wouldn't that replace all non letters?
Herman Fassett
@HermanFassett
Oct 02 2015 17:30
Yes, it should work with just that one replace
Aleksandar B.
@aleksandar-b
Oct 02 2015 17:30
@ELRuncho use
str.replace(/[^A-Z0-9]/gi,"");
ELRuncho
@ELRuncho
Oct 02 2015 17:31
@HermanFassett thanks that worked.
CamperBot
@camperbot
Oct 02 2015 17:31
elruncho sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 276 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Herman Fassett
@HermanFassett
Oct 02 2015 17:31
;)
hasnaas
@hasnaas
Oct 02 2015 17:36
Hi All, I am on the "build your personal portfolio webpage " Zipline, in the portfolio section, there are links with snapshots of the webpages they refer to, any pointer on how to do that ? thanks
Jordan Bourne
@JordanBourne
Oct 02 2015 17:37
Which part are you having trouble with? The styling of it or making them links?
hasnaas
@hasnaas
Oct 02 2015 17:38
@JordanBourne making the snapshot appear
Christopher Clemons
@phonofidelic
Oct 02 2015 17:38
@hasnaas Do you mean the thumbnail images? You can use placeholder images from sites like https://placekitten.com/
Jordan Bourne
@JordanBourne
Oct 02 2015 17:39
It's just using screenshots of the destination sites
Aleksandar B.
@aleksandar-b
Oct 02 2015 17:39
@hasnaas i am using Shutter - snapshot software
hasnaas
@hasnaas
Oct 02 2015 17:39
I tried this code:
<a href="the link"><img src="#"></a>
then in javascript
$('ls').each(function() {
oups
$('a').each(function() {

var snapshotImgURL = getSnapShotOf($(this).attr('href')); // replace this with your AJAX call to get the snapshot

// set it to the image
$(this).children('img').attr('src', snapshotImgURL);

but it's not working
Christopher Clemons
@phonofidelic
Oct 02 2015 17:42
Your image tag won't show an image unless it contains a link to an actual image file
Aleksandar B.
@aleksandar-b
Oct 02 2015 17:42
@hasnaas what is getSnapShotOf()?
Bill
@kirah1314
Oct 02 2015 17:43
This message was deleted
hasnaas
@hasnaas
Oct 02 2015 17:43
@samosale found that in stackoverflow
there must be sth missing
Bill
@kirah1314
Oct 02 2015 17:48
@hasnaas oops misread your question. For me, I created a picture/file of the zipline then upload it to cloud then created a link to it
Jordan Bourne
@JordanBourne
Oct 02 2015 17:49
Can someone help me with this JSON function? I'm not sure why it's working
$.getJSON(link).done(function(data) {
      if (data.stream) {
        $("." + streamer[i]).text("Online");
      } else {
        $("." + streamer[i]).text("Offline");
      }
It's part of a codepen if someone wants the full link
Not sure why it's not working*
Aleksandar B.
@aleksandar-b
Oct 02 2015 17:50
@hasnaas the code from stack assume that you have written that function that takes snapshot via ajax.
hasnaas
@hasnaas
Oct 02 2015 17:50
@kirah1314 yes, this will work. thank you
CamperBot
@camperbot
Oct 02 2015 17:50
hasnaas sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 272 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Herman Fassett
@HermanFassett
Oct 02 2015 17:50
@JordanBourne isn't it normally
$.getJSON(link, function(data) {
}).done(function(){});
hasnaas
@hasnaas
Oct 02 2015 17:51
@samosale ok I see,
Jordan Bourne
@JordanBourne
Oct 02 2015 17:51
@HermanFassett idk maybe, I'll try that
Alexander Griswold
@AlexGriswold
Oct 02 2015 17:57
Anyone have a clue why the Chunky Monkey bonfire doesn't seem to be able to validate my code ? I'm trying to nest some while loops so maybe that's it but I dont think so....
Bill
@kirah1314
Oct 02 2015 17:58
@AlexGriswold post your codes here?
Alexander Griswold
@AlexGriswold
Oct 02 2015 17:59

function chunk(arr, size) {
var blankString = ("");
var i = 0;
while (arr.length > 0) {
while (i < size){
var popped = arr.pop();
var newString = blankString.concat(popped);
i = i+1;
}
}
return size;
}

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

it should at least be able to return SIZE but it doesnt...
Jordan Bourne
@JordanBourne
Oct 02 2015 18:01
Your first loop is infinite so it isn't compiling
Bill
@kirah1314
Oct 02 2015 18:01
yeah both your while is infinite loop
@AlexGriswold ^
Alexander Griswold
@AlexGriswold
Oct 02 2015 18:03
ok back to the drawing board - thanks!
CamperBot
@camperbot
Oct 02 2015 18:03
if you want to thank someone, put an @ before their name!
Bill
@kirah1314
Oct 02 2015 18:03
@AlexGriswold a blank string is '' or ""
This message was deleted
Abhisek Pattnaik
@abhisekp
Oct 02 2015 18:34
explain format
CamperBot
@camperbot
Oct 02 2015 18:34

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Abhisek Pattnaik
@abhisekp
Oct 02 2015 18:35
explain format
CamperBot
@camperbot
Oct 02 2015 18:35

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Abhisek Pattnaik
@abhisekp
Oct 02 2015 18:35
explain code format
CamperBot
@camperbot
Oct 02 2015 18:35

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Abhisek Pattnaik
@abhisekp
Oct 02 2015 18:35
explain code formatting
CamperBot
@camperbot
Oct 02 2015 18:35

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Abhisek Pattnaik
@abhisekp
Oct 02 2015 18:35
@AlexGriswold :point_up: October 3, 2015 12:05 AM
sry! for too many commands. Bad connectivity. :'(
Alexander Griswold
@AlexGriswold
Oct 02 2015 18:40
lol all good
Finally figured out chunky monkey!
'''
CamperBot
@camperbot
Oct 02 2015 18:40
:bulb: to format code use backticks! ``` more info
Alexander Griswold
@AlexGriswold
Oct 02 2015 18:40
This message was deleted
CamperBot
@camperbot
Oct 02 2015 18:40
:bulb: to format code use backticks! ``` more info
Alexander Griswold
@AlexGriswold
Oct 02 2015 18:41
This message was deleted
CamperBot
@camperbot
Oct 02 2015 18:41
:bulb: to format code use backticks! ``` more info
Alexander Griswold
@AlexGriswold
Oct 02 2015 18:44
function chunk(arr, size) {
var newArray = new Array();
while (arr[1] != null) {     
  var sliced = arr.splice(size);
  newArray = newArray.concat([arr]);
  arr = sliced;
}  
  return newArray;
}


chunk(["a", "b", "c", "d", "e", "f"], 2, "");
was totally overthinking it as usual
Herman Fassett
@HermanFassett
Oct 02 2015 18:44
At least you don't underthink like me
Alexander Griswold
@AlexGriswold
Oct 02 2015 18:44
hah
It's amazing what you can find just typing your question into google.
Herman Fassett
@HermanFassett
Oct 02 2015 18:46
yup
Laura Veee
@Cyclokitty
Oct 02 2015 19:18
I'm stuck on Bonfire: Return Largest Numbers in Array
'''
CamperBot
@camperbot
Oct 02 2015 19:18
:bulb: to format code use backticks! ``` more info
Laura Veee
@Cyclokitty
Oct 02 2015 19:18
This message was deleted
CamperBot
@camperbot
Oct 02 2015 19:18
:bulb: to format code use backticks! ``` more info
Laura Veee
@Cyclokitty
Oct 02 2015 19:19
This message was deleted
function largestOfFour(arr) {
  var newArr = [] ;
  var big = 0;
  for (var i= 0; i< arr.length; i++) {
      if (arr[i] > big) {
          big = arr[i];
          newArr.push(big);
      }
   return newArr;         
  }
}
largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]], "");
Sorry about that. I keep messing up the backticks with pretty much every other key on my laptop.
Jason Wood
@catapixel
Oct 02 2015 19:20
This message was deleted
Tyler Moeller
@TylerMoeller
Oct 02 2015 19:21

For some reason, my tooltips don't hide when I click on a checkbox. Anyone know the fix/workaround?
HTML:

<div style="margin: 2em 0 0 2em">
    <label id="checkbox"><input id="checkbox" type="checkbox">Checkbox</label>
</div>

JS:

  $('#checkbox').tooltip({
    title: "This tooltip won't disappear when the checkbox is checked.",
    placement: "right"
  })

JS Fiddle: http://jsfiddle.net/eLax5hdq/

I tried adding this after, but no luck...
$('#checkbox').tooltip().click(function() {
    $(this).tooltip("close");
});
Alexander Griswold
@AlexGriswold
Oct 02 2015 19:22
Jason Wood
@catapixel
Oct 02 2015 19:24
This message was deleted
Laura Veee
@Cyclokitty
Oct 02 2015 19:24
oo! A math max function! @AlexGriswold Thanks!
CamperBot
@camperbot
Oct 02 2015 19:24
cyclokitty sends brownie points to @alexgriswold :sparkles: :thumbsup: :sparkles:
:star: 119 | @alexgriswold | http://www.freecodecamp.com/alexgriswold
Laura Veee
@Cyclokitty
Oct 02 2015 19:25
@catapixel Thanks, looks like I'm not actually touching the other arrays
CamperBot
@camperbot
Oct 02 2015 19:25
cyclokitty sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 403 | @catapixel | http://www.freecodecamp.com/catapixel
Alexander Griswold
@AlexGriswold
Oct 02 2015 19:25
@Cyclokitty You need to access the nested arrays
hakimnasir
@hakimnasir
Oct 02 2015 19:27
This message was deleted
Laura Veee
@Cyclokitty
Oct 02 2015 19:28
Do I need a for loop for each nested array?
Jason Wood
@catapixel
Oct 02 2015 19:31
@TylerMoeller ids need to be unique and you have the same one applied to your label and your input. May not be your problem but I'd start there...
Michael L.
@mlyonstudent
Oct 02 2015 19:32
var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;
function myFunction(){
  // Create an if-else statement here to return "heads" if flip is 0. Otherwise return "tails".

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


  // Only change code above this line.
}

// We use this function to show you the value of your variable in your output box.
var result = myFunction();if(typeof(flip) !== "undefined" && typeof(flip) === "number" && typeof(result) !== "undefined" && typeof(result) === "string"){(function(y,z){return 'flip = ' + y.toString() + ', text = ' + z;})(flip, result);}
Anyone know what I'm doing wrong here?
Jason Wood
@catapixel
Oct 02 2015 19:32
@Cyclokitty Yes, you loop through the main array to get each in turn and then need to loop through the subArrays unless you use the Math.max() method that @AlexGriswold pointed out earlier
Tyler Moeller
@TylerMoeller
Oct 02 2015 19:32
Thanks @catapixel for taking a look. The duplicate IDs are not the issue. Updated here: http://jsfiddle.net/eLax5hdq/4/
CamperBot
@camperbot
Oct 02 2015 19:32
tylermoeller sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 404 | @catapixel | http://www.freecodecamp.com/catapixel
Alexander Griswold
@AlexGriswold
Oct 02 2015 19:33
if 0 = 1?
@mlyonstudent do you mean if (flip = 1)?
Michael L.
@mlyonstudent
Oct 02 2015 19:34
The instructions read "Create if and else statements to return the string "heads" if the flip variable is zero, or else return the string "tails" if the flip variable is not zero."
@AlexGriswold ^
Alexander Griswold
@AlexGriswold
Oct 02 2015 19:35
In your code you are checking if 0 = 1
you probably want to check if the flip = 1
Jason Wood
@catapixel
Oct 02 2015 19:35
@TylerMoeller your tooltip is responding to hover not check/click at the moment when I look at it at JSFiddle
Michael L.
@mlyonstudent
Oct 02 2015 19:35
@AlexGriswold So just replace 0=1 to flip=1 ?
Laura Veee
@Cyclokitty
Oct 02 2015 19:36
Ok @catapixel ! Thanks again. Gonna switch my if loop to the math max (haven't tried that yet). Then, work on the nested arrays.
CamperBot
@camperbot
Oct 02 2015 19:36
cyclokitty sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:warning: cyclokitty already gave catapixel points
Alexander Griswold
@AlexGriswold
Oct 02 2015 19:39
@mlyonstudent if flip = 0, return heads, else return tails
Michael L.
@mlyonstudent
Oct 02 2015 19:40
var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;
function myFunction(){
  // Create an if-else statement here to return "heads" if flip is 0. Otherwise return "tails".

  // Only change code below this line.
if (flip === 0) {
  return heads;
} else {
  return tails;
}
My output keeps coming out as "tails is not defined"
Tyler Moeller
@TylerMoeller
Oct 02 2015 19:41
@catapixel That hover state must get stuck when the checkbox is checked. I'll try to debug some more. Even tried adding a onclick function to the label to close the tooltip, but that doesn't work either.
function closeToolTip() {
$('#checkbox-label').tooltip().click(function() {
    $(this).tooltip("destroy");
});
}
Michael L.
@mlyonstudent
Oct 02 2015 19:41
@AlexGriswold ^
Tyler Moeller
@TylerMoeller
Oct 02 2015 19:42
@mlyonstudent make "heads" and "tails" strings by surrounding in quotes
Plessey Mathews
@PlesseyMathews
Oct 02 2015 19:42
@hessproject Thanks for the detailed explanation.
CamperBot
@camperbot
Oct 02 2015 19:42
plesseymathews sends brownie points to @hessproject :sparkles: :thumbsup: :sparkles:
:star: 2 | @hessproject | http://www.freecodecamp.com/hessproject
Jason Wood
@catapixel
Oct 02 2015 19:42
@TylerMoeller when I refresh the page I get the tooltip on hover whether I check the box or not. I get it and it disappears when I hover over the label and then stop hovering...The behavior is independent of the checkbox being checked or not...
Michael L.
@mlyonstudent
Oct 02 2015 19:42
@AlexGriswold That did the trick, thank you!!
CamperBot
@camperbot
Oct 02 2015 19:42
mlyonstudent sends brownie points to @alexgriswold :sparkles: :thumbsup: :sparkles:
:star: 120 | @alexgriswold | http://www.freecodecamp.com/alexgriswold
Alexander Griswold
@AlexGriswold
Oct 02 2015 19:43
@mlyonstudent Yup they needs quotes. Right now JS is trying to think of them as variables
Tyler Moeller
@TylerMoeller
Oct 02 2015 19:43
@catapixel Yes, I want the tooltip on hover. For some reason that hover state gets stuck when I check the checkbox. I was hoping to find a way to clear the tooltip after check/uncheck to work around this.
Michael L.
@mlyonstudent
Oct 02 2015 19:44
@AlexGriswold That's odd, the instructions considered heads and tails as strings.
Jason Wood
@catapixel
Oct 02 2015 19:44
@TylerMoeller when you check the box and the "hover gets stuck" it is listening for a second click to clear. If you check, get it stuck, and then click anywhere it will go away...I'd focus in on your click method...
Tyler Moeller
@TylerMoeller
Oct 02 2015 19:47
Thanks @catapixel - appreciate the help
CamperBot
@camperbot
Oct 02 2015 19:47
tylermoeller sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:warning: tylermoeller already gave catapixel points
GenavieveMarie
@GenavieveMarie
Oct 02 2015 19:59
help $Use Conditional Logic with If and Else Statements
CamperBot
@camperbot
Oct 02 2015 19:59
no wiki entry for: use conditional logic with if and else statements
:pencil: click here to create one now!after creating your page type update to reload it here
Irina
@2Irina2
Oct 02 2015 19:59
Hiii!!
Anyone here to help me with my portfolio webpage?
javaNewbTL
@javaNewbTL
Oct 02 2015 20:00
Guys I am stuck, I have a #cat-photo-element in my <style> tag and now I am trying to apply a background color to a id without use a class
id="cat-photo-form" class="background-color: green" not letting me continue
although it does do what I want it to, it is not how the exercise prefers
Herman Fassett
@HermanFassett
Oct 02 2015 20:02
Show your code @javaNewbTL
Oliver
@Dadsaster
Oct 02 2015 20:03
^^^ post code please
Irina
@2Irina2
Oct 02 2015 20:03
I need to create a navigation bar with multiple buttons on it, one on the left and 4 on the right.. But they donot show on a single line and the first one goes above the other 4
Laura Veee
@Cyclokitty
Oct 02 2015 20:03
omg I think I got it!
Oliver
@Dadsaster
Oct 02 2015 20:03
@2Irina2 - are you using bootstrap?
Laura Veee
@Cyclokitty
Oct 02 2015 20:04
the math.max was awesome
If so
Irina
@2Irina2
Oct 02 2015 20:04
Yup.. I'm at the portfolio webpage zipline
javaNewbTL
@javaNewbTL
Oct 02 2015 20:04
<form action="/submit-cat-photo" <id ="cat-photo-form, background-color: green">
<label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
Irina
@2Irina2
Oct 02 2015 20:04
and i added all the libraries