These are chat archives for FreeCodeCamp/Help

12th
Nov 2015
Stephanie
@stephyli
Nov 12 2015 00:01
anyone know this?
Use split to create an array of words from string and assign it to array.
My response which does not work is var array = string.split("");
M Used
@mildused
Nov 12 2015 00:02
@stephyli I'll PM you and help you there
Stephanie
@stephyli
Nov 12 2015 00:03
ok where can I get PM? I am new to this
M Used
@mildused
Nov 12 2015 00:04
Check the left of this page
And you'll see my messages popup
Stephanie
@stephyli
Nov 12 2015 00:26

var joinMe = ["Split","me","into","an","array"];

// Only change code below this line.

var joinedString = joinMe.join("Split","me","into","an","array");

// Only change code above this line.

(function() {return joinedString;})();
what do they mean by join with spaces?

Herman Fassett
@HermanFassett
Nov 12 2015 00:44
Have a space in the join() instead of the words @stephyli
" "
Whatever is inbetween those parentheses is what the elements will be joined with
CaffeineQueen
@CaffeineQueen
Nov 12 2015 01:22
What is wrong with this line? $("#target5").clone().appendTo("left-well");
never mind, I found it
Andy
@Zubenna
Nov 12 2015 01:29
Hello everyone.
I am new in this course, I have a question please..
DJ
@qualitymanifest
Nov 12 2015 01:30
@Zubenna let's hear it
Andy
@Zubenna
Nov 12 2015 01:30
How do I apply a target class to a button element?
DJ
@qualitymanifest
Nov 12 2015 01:31
@Zubenna which waypoint is this that you're working on
Andy
@Zubenna
Nov 12 2015 01:33
@qualitymanifest creating a class to target with jQuery Selectors
DJ
@qualitymanifest
Nov 12 2015 01:35
@Zubenna each of your buttons already have the classes btn and btn-default. just add target to them.
Isaiah
@Buckhalton
Nov 12 2015 01:35
var oldArray = [1,2,3,4,5];

// Only change code below this line.

var newArray = oldArray;
var addThree = oldArray.map(function(val){
  return val + 3;
}); 
// Only change code above this line.

(function() {return newArray;})();
Im trying to add 3 to each value in the array, can someone tell me what I am doing wrong?
DJ
@qualitymanifest
Nov 12 2015 01:37
@Buckhalton the function returns newArray, so your problem is that you're making a new variable addThree which isn't being returned
Murilo Martins
@theonemurilo
Nov 12 2015 01:37
why are you returning newArray on the final attempt
?
yep, @qualitymanifest is right
DJ
@qualitymanifest
Nov 12 2015 01:37
@theonemurilo we said that at pretty much the exact same time haha
Murilo Martins
@theonemurilo
Nov 12 2015 01:38
@qualitymanifest haha
Andy
@Zubenna
Nov 12 2015 01:39
@qualitymanifest Thanks . its ok now.
CamperBot
@camperbot
Nov 12 2015 01:39
zubenna sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 366 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Isaiah
@Buckhalton
Nov 12 2015 01:39
@qualitymanifest @theonemurilo Thanks, I'm having a slow day as you can see :P
CamperBot
@camperbot
Nov 12 2015 01:39
buckhalton sends brownie points to @qualitymanifest and @theonemurilo :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for theonemurilo
:star: 367 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
DJ
@qualitymanifest
Nov 12 2015 01:39
no problem guys
Murilo Martins
@theonemurilo
Nov 12 2015 01:41
This is completely normal @Buckhalton
@camperbot now I have it
DJ
@qualitymanifest
Nov 12 2015 01:48
thanks @theonemurilo
CamperBot
@camperbot
Nov 12 2015 01:48
qualitymanifest sends brownie points to @theonemurilo :sparkles: :thumbsup: :sparkles:
:star: 15 | @theonemurilo | http://www.freecodecamp.com/theonemurilo
DJ
@qualitymanifest
Nov 12 2015 01:48
yep there you go
Murilo Martins
@theonemurilo
Nov 12 2015 01:49
thanks :)
renren89
@renren89
Nov 12 2015 02:15
  it('sorts by given value of properties', () => {
    const state = [
      { name: 'Edward', value: 21 },
      { name: 'Sharpe', value: 37 },
      { name: 'And', value: 45 },
      { name: 'The', value: -12 },
      { name: 'Magnetic' },
      { name: 'Zeros', value: 37 }
    ];
    const nextState = state.sort( (a,b) => {
      if ( a.value == b.value ) return 0;
      if ( a.value < b.value ) return -1;
      return 1;

    });
    console.log(JSON.stringify(nextState, null, 2));
    const newState = [
      { name: 'Magnetic' },
      { name: 'The', value: -12 },
      { name: 'Edward', value: 21 },
      { name: 'Sharpe', value: 37 },
      { name: 'Zeros', value: 37 },
      { name: 'And', value: 45 }
    ];
    expect(nextState).to.deep.equal(newState);
  });
anyone know what's the deal with safari not being able to deepEqual these? Passes in firefox and chrome(s)
Lorenzo Tortorici
@Lorenzo611
Nov 12 2015 02:33
im stuck at the begining "Use a CSS Class to Style an Element"
mariocatch
@mariocatch
Nov 12 2015 02:33
@Lorenzo611 sure, what's up
@Lorenzo611 Do you remember when you applied a style directly to an html element?
Lorenzo Tortorici
@Lorenzo611
Nov 12 2015 02:34
yes
but that was with HTML this is CSS
mariocatch
@mariocatch
Nov 12 2015 02:34
correct, so the only difference is the css is a style that targets a part of your HTML
so let's say you have a paragraph of text in your html, and you have a style on it that changes its color to red
Lorenzo Tortorici
@Lorenzo611
Nov 12 2015 02:35
ok
mariocatch
@mariocatch
Nov 12 2015 02:35
now let' s say you have 5 paragraphs and you want all of their colors to be red... if you use a style then you have to copy and paste style="color: red;" on all the paragraphs
that's repetitive and can get ugly later on
this is where css comes in. with css you can simply do something like p { color: red; }
and now all paragraphs in your html will be red
so now you wont need to put a style on each html paragraph
now let's say you want to make all paragraphs AND all h1 tags red... instead of creating a css selector that looks for p tags like above, we can create a css class instead.
.red { color: red; }
this is a class in css called red
in order to point your HTML elements to it, you must use the class attribute in your html
so in your html you can have <p class="red">This is a paragraph, that has a class of red, so the color should be red since my class in css targets this class and changes its color to red.</p>
the selector in css to create a class must start with a dot operator .red is a class called red. .red-text is a class called red-text
Lorenzo Tortorici
@Lorenzo611
Nov 12 2015 02:43
so if I need to make a h2 element red but I am not allowed to use STYLE="COLOR: RED" what do I do
mariocatch
@mariocatch
Nov 12 2015 02:43
you can use two of the ways i showed you above
Lorenzo Tortorici
@Lorenzo611
Nov 12 2015 02:44
ok thanks your awesome
mariocatch
@mariocatch
Nov 12 2015 02:44
you can either target h2 elements with css h2 { color:red; } or you can create a class in the css .red { color: red; } and then target it with your html <h2 class="red">foo</h2>
Lorenzo Tortorici
@Lorenzo611
Nov 12 2015 02:44
ok
thanks
Ana Maria Vesga
@anamavesga
Nov 12 2015 02:52
Hello world!
CamperBot
@camperbot
Nov 12 2015 02:52

welcome to FreeCodeCamp @anamavesga!

Craig Morrison
@frogmorton
Nov 12 2015 02:57
Welcome @anamavesga
Andrew Bechini
@powhunter158
Nov 12 2015 03:04
Screen Shot 2015-11-11 at 9.44.27 PM.png
Unsure of where the div closing tag is to be placed?
Craig Morrison
@frogmorton
Nov 12 2015 03:05
After the form?
I'm assuming all elements are meant to be nested in the fluid container div
Andrew Bechini
@powhunter158
Nov 12 2015 03:08
"nest all of our HTML in a div element with the class container-fluid"
Craig Morrison
@frogmorton
Nov 12 2015 03:08
There you go
That is not talking about HTML or body tags... Just everything else.
Did it work for you, @powhunter158 ?
Ginn4364
@Ginn4364
Nov 12 2015 03:12
I need help
this is really frustrating
Craig Morrison
@frogmorton
Nov 12 2015 03:13
What's up @Ginn4364 ?
Ginn4364
@Ginn4364
Nov 12 2015 03:13
lastNameLength should be equal to eight.
You should be getting the length of lastName by using .length like this: lastName.length.
Those are the objectives
so i set var lastNameLength = abcdefgh;
Craig Morrison
@frogmorton
Nov 12 2015 03:14
I'm familiar with that... What's your code look like?
Ginn4364
@Ginn4364
Nov 12 2015 03:14

var firstNameLength = 0;
var lastNameLength = "abcdefgh";
var firstName = "Ada";

firstNameLength = firstName.length;

var lastName = "Lovelace";

// Only change code below this line.

lastNameLength = lastName;

// Only change code above this line.

if(typeof(lastNameLength) !== "undefined"){(function(){return lastNameLength;})();}

Hans van Riet
@hansinla
Nov 12 2015 03:15
@Ginn4364 abcdefgh is not a length. A length is an integer. You get the length of a string str by doing str.length
Craig Morrison
@frogmorton
Nov 12 2015 03:15
What they mean is not for you to assign it a value...
They already made lastName = "Lovelace";
Ginn4364
@Ginn4364
Nov 12 2015 03:15
So var lastNameLength = 8;
?
Craig Morrison
@frogmorton
Nov 12 2015 03:16
No
Ginn4364
@Ginn4364
Nov 12 2015 03:16
Ugh
Craig Morrison
@frogmorton
Nov 12 2015 03:16
They want you to understand how to check the length of a string, using the .length property
Andrew Bechini
@powhunter158
Nov 12 2015 03:17
Am I supposed to include both sets of lists? @frogmorton
Ginn4364
@Ginn4364
Nov 12 2015 03:17
With lastName.length;
Got that
How do I set lastNameLength equal to 8?
Thats whats confusing me
Craig Morrison
@frogmorton
Nov 12 2015 03:17
You don't
Ginn4364
@Ginn4364
Nov 12 2015 03:18
wut
Craig Morrison
@frogmorton
Nov 12 2015 03:18
How many letters does Lovelace have?
Ginn4364
@Ginn4364
Nov 12 2015 03:18
8
Craig Morrison
@frogmorton
Nov 12 2015 03:19
Ok, we're going to confirm that, by assigning lastNameLength = ?
Ginn4364
@Ginn4364
Nov 12 2015 03:19
"Lovelace"?
etowahs
@etowahs
Nov 12 2015 03:20
This message was deleted
Craig Morrison
@frogmorton
Nov 12 2015 03:21
No, again, the only reason they told you 8 is so you know if you do it correctly
Ginn4364
@Ginn4364
Nov 12 2015 03:21
Gonna be 100% honest, I don't understand any of this
Craig Morrison
@frogmorton
Nov 12 2015 03:21
What expression will spit out the 8, ( the .length of the var lastName?)?
Ok. Let's break it down then.
You have 2 different vars that matter to you right now, lastName and lastNameLength
Ginn4364
@Ginn4364
Nov 12 2015 03:23
Yes
Craig Morrison
@frogmorton
Nov 12 2015 03:24
lastName holds a string value of "Lovelace",
Ginn4364
@Ginn4364
Nov 12 2015 03:24
Yes
Craig Morrison
@frogmorton
Nov 12 2015 03:24
Which you want to check the length of, using the .length property
The result of that property's check should go into the other var, lastNameLength, which currently = 0
Ginn4364
@Ginn4364
Nov 12 2015 03:27
So, 8?
Craig Morrison
@frogmorton
Nov 12 2015 03:27
@powhunter158 include everything
@Ginn4364 who is doing the check? You? Or JavaScript?
Ginn4364
@Ginn4364
Nov 12 2015 03:27
JavaScript
Craig Morrison
@frogmorton
Nov 12 2015 03:28
Ok, so how do you reassign a variable a new value in JavaScript?
Andrew Bechini
@powhunter158
Nov 12 2015 03:28
Thanks @frogmorton! Appreciate the help
CamperBot
@camperbot
Nov 12 2015 03:28
powhunter158 sends brownie points to @frogmorton :sparkles: :thumbsup: :sparkles:
:star: 321 | @frogmorton | http://www.freecodecamp.com/frogmorton
Craig Morrison
@frogmorton
Nov 12 2015 03:29
@powhunter158 np :)
Victor
@Evaderei
Nov 12 2015 03:29
Hey Everyone
Ginn4364
@Ginn4364
Nov 12 2015 03:29
I have no idea. I'm gonna quit for today, im not good at this stuff. Thanks for being patient with me, night.
Victor
@Evaderei
Nov 12 2015 03:30
I'm trying doing random quote machine: http://codepen.io/Evaderei/pen/VvVQYL
Craig Morrison
@frogmorton
Nov 12 2015 03:30
Hang on
Finish this, it's one line of code.
Victor
@Evaderei
Nov 12 2015 03:31
I can't figure out how to change the href of the twitter button after the quote is changed.
Any help would be appreciated.
Craig Morrison
@frogmorton
Nov 12 2015 03:32
@Ginn4364 my point is, you're not limited to assigning strings or numbers to variables... You can also assign math or JavaScript methods
EmeraldKnight8
@EmeraldKnight8
Nov 12 2015 03:32
Hello All!
Will someone please help me with the Slot Machine problem
Victor
@Evaderei
Nov 12 2015 03:33
I've done that before @EmeraldKnight8 , what'd you need help with?
Craig Morrison
@frogmorton
Nov 12 2015 03:33
@Ginn4364 R u there? Try this.... lastNameLength = lastName.length;
EmeraldKnight8
@EmeraldKnight8
Nov 12 2015 03:34
not sure what to do do with this function here
Victor
@Evaderei
Nov 12 2015 03:35
@frogmorton lastNameLength = lastName.length seems pretty redundant
but i'd suppose that'd save computation cycles?
sunquick
@sunquick
Nov 12 2015 03:36
<img src="https://s3.amazonaws.com/freecodecamp/relaxing-cat.jpg"> I have an issue with this code.
Your image should have a src attribute that points to the kitten image.
EmeraldKnight8
@EmeraldKnight8
Nov 12 2015 03:37

// Only change code below this line.

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

// Only change code above this line.

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

if(slotOne !== undefined && slotTwo !== undefined && slotThree !== undefined){
  $(".logger").html(slotOne + " " + slotTwo + " " + slotThree);
}
return [slotOne, slotTwo, slotThree];

}

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

Craig Morrison
@frogmorton
Nov 12 2015 03:37
@Evaderei it is redundant, but in the beginning JS waypoints, they are introducing the concepts in a very basic way
Victor
@Evaderei
Nov 12 2015 03:38
@sunquick works fine for me, maybe there's a problem with the surrounding code
Craig Morrison
@frogmorton
Nov 12 2015 03:38
@sunquick what is happening with it?
Assuming the url is correct, it looks fine to me
sunquick
@sunquick
Nov 12 2015 03:40
a.PNG
please take a look
Victor
@Evaderei
Nov 12 2015 03:40
@EmeraldKnight8 Would you mind posting a link to the challenge?
EmeraldKnight8
@EmeraldKnight8
Nov 12 2015 03:40
will do
Victor
@Evaderei
Nov 12 2015 03:41
@sunquick get rid of the space between src= and "https://s3.amazonaws.com/freecodecamp/relaxing-cat.jpg"
no space
h4r1m4u
@h4r1m4u
Nov 12 2015 03:41
@sunquick you're supposed to use the image URL given to you in the sidebar: https://bit.ly....
Victor
@Evaderei
Nov 12 2015 03:42
so it'll be like src="http://example.com"
ha @h4r1m4u good catch
sunquick
@sunquick
Nov 12 2015 03:42
thank you so much, guys
I fixed
Craig Morrison
@frogmorton
Nov 12 2015 03:44
They offer you source links in those way points
EmeraldKnight8
@EmeraldKnight8
Nov 12 2015 03:44
First time doing this ..how do I post the link without all the extra text
Craig Morrison
@frogmorton
Nov 12 2015 03:45
On the ziplines, when you actually need to gather your own resources, THEN you can do that
Victor
@Evaderei
Nov 12 2015 03:45
@EmeraldKnight8
Serenity
@qmikew1
Nov 12 2015 03:46
@SaintPeter are you around?
Victor
@Evaderei
Nov 12 2015 03:46
I just spent 3+ hours on Random Quote Machine
Still can't get the twitter button down
I'm beat haha
EmeraldKnight8
@EmeraldKnight8
Nov 12 2015 03:47
How do i get the link to this particular challenge without copying and pasting the entire link
Juan Martínez
@jbmartinez
Nov 12 2015 03:47
is @SaintPeter here? we have a troll
Victor
@Evaderei
Nov 12 2015 03:47
have you done that Waypoint yet, @frogmorton
EmeraldKnight8
@EmeraldKnight8
Nov 12 2015 03:47
@Evaderei
Victor
@Evaderei
Nov 12 2015 03:47
holy crap, i just found out what you're talking about aha @EmeraldKnight8
i'll find it
forget the link, give me a title
CamperBot
@camperbot
Nov 12 2015 03:48
:trollface: troll problems? notify admins here
Victor
@Evaderei
Nov 12 2015 03:49
oh snap, bot thinks i'm a troll?
h4r1m4u
@h4r1m4u
Nov 12 2015 03:50
@Evaderei what's the issue with your zipline?
Craig Morrison
@frogmorton
Nov 12 2015 03:50
@Evaderei I've done pretty much all Waypoints
@EmeraldKnight8 on some waypoints, you do just copy and paste
CamperBot
@camperbot
Nov 12 2015 03:52
:trollface: troll problems? notify admins here
Craig Morrison
@frogmorton
Nov 12 2015 03:52
Who's the troll?
CamperBot
@camperbot
Nov 12 2015 03:52
:trollface: troll problems? notify admins here
h4r1m4u
@h4r1m4u
Nov 12 2015 03:53
@frogmorton he's in the /FreeCodeCamp channel. looks like a bot to me, actually
Victor
@Evaderei
Nov 12 2015 03:53
@frogmorton @h4r1m4u I'm doing random quote machine, and I want to add tweeting the quotes out as a function. I added a tweet button, but I don't know how to dynamically update the pre-filled text in the tweets.
Juan Martínez
@jbmartinez
Nov 12 2015 03:53
@frogmorton there's a troll in the main room. @HSB01
h4r1m4u
@h4r1m4u
Nov 12 2015 03:54
@Evaderei can you link your pen?
Rory Smith
@alanbuchanan
Nov 12 2015 03:54
it's some kid copy and pasting, you can even see the 'v' sometimes
i guess he's having a bad day. or a strange one
Serenity
@qmikew1
Nov 12 2015 03:55
anybody with admin rights to ban the troll pasting over and over in the main room?
h4r1m4u
@h4r1m4u
Nov 12 2015 03:55
welcome to the internet :(
Craig Morrison
@frogmorton
Nov 12 2015 03:55
@Evaderei I am on that one too, but haven't tried coding the tweet button yet
CamperBot
@camperbot
Nov 12 2015 03:56
:trollface: troll problems? notify admins here
Victor
@Evaderei
Nov 12 2015 03:56
I changed the outlook of the site so it's easier for debugging
Juan Martínez
@jbmartinez
Nov 12 2015 03:56
@alanbuchanan disappointing, I thought he/she had written some code for that
Craig Morrison
@frogmorton
Nov 12 2015 03:56
Got it
CamperBot
@camperbot
Nov 12 2015 03:56
:trollface: troll problems? notify admins here
Victor
@Evaderei
Nov 12 2015 03:56
Closest thing I've got to a solution is http://tumblr.christophercamps.com/post/4072517874/dynamic-tweet-button-text-using-jquery @frogmorton @h4r1m4u
Juan Martínez
@jbmartinez
Nov 12 2015 03:56
but gitter is dragging now, or it's just me
Alexander Pritchard
@Pritchard
Nov 12 2015 03:56
Are there any mods or admins available?
Hans van Riet
@hansinla
Nov 12 2015 03:58
@Evaderei If you want a solution for the Twitter button, you should research ‘Twitter Intent’, by far the easiest solution.
Rory Smith
@alanbuchanan
Nov 12 2015 03:59
it's pretty silly that cbot does nothing to prevent that kind of spam, given that it's one of the first things new users see when they sign up
if not cbot then perhaps it should be a gitter measure
Craig Morrison
@frogmorton
Nov 12 2015 03:59
What a jacka$$
Hans van Riet
@hansinla
Nov 12 2015 04:00
@Evaderei If you want a solution for the Twitter button, you should research ‘Twitter Intent’, by far the easiest solution.
Craig Morrison
@frogmorton
Nov 12 2015 04:00
@hansinla has the right idea, @Evaderei
Victor
@Evaderei
Nov 12 2015 04:01
@hansinla @frogmorton thanks for teaching me to fish
CamperBot
@camperbot
Nov 12 2015 04:01
evaderei sends brownie points to @hansinla and @frogmorton :sparkles: :thumbsup: :sparkles:
:star: 576 | @hansinla | http://www.freecodecamp.com/hansinla
:star: 322 | @frogmorton | http://www.freecodecamp.com/frogmorton
h4r1m4u
@h4r1m4u
Nov 12 2015 04:01

@Evaderei ok, you populate the tweet button when the pages initially loads with this line:

 $(".twitter-share-button").attr('href', 'https://twitter.com/intent/tweet?text=' + encodedQuote);

you need to do something similar in the click handler for the 'New Quote' button

Victor
@Evaderei
Nov 12 2015 04:01
ah apparently thanks is a magic word here
h4r1m4u
@h4r1m4u
Nov 12 2015 04:01

@Evaderei you populate the tweet button when the page initially loads with this line:

 $(".twitter-share-button").attr('href', 'https://twitter.com/intent/tweet?text=' + encodedQuote);

you need to add something similar within the click handler for the New Quote button. otherwise you only generate the new quote, but never update the tweet button

Victor
@Evaderei
Nov 12 2015 04:04
I use that same line again in the click handler.
h4r1m4u
@h4r1m4u
Nov 12 2015 04:04
damn this lagging chat
Victor
@Evaderei
Nov 12 2015 04:04
Does it not cause the .twitter-share-button to change it's href attr?
h4r1m4u
@h4r1m4u
Nov 12 2015 04:07
i'm sorry, i missed that. the issue is that you target the tweet button with this selector .twitter-share-button. but since the button is generated with the twitter widget script, its markup changes. it doesn't have a .twitter-share-button class
Victor
@Evaderei
Nov 12 2015 04:08
i just inspected it, all of the markup changes holy crud
it's got its own body and header and everything
Victor
@Evaderei
Nov 12 2015 04:13
this twitter button is going down tonite!
h4r1m4u
@h4r1m4u
Nov 12 2015 04:16
@Evaderei since you're using the twitter widget script, you can use its factory function to generate the tweet button dynamically: https://dev.twitter.com/web/tweet-button/javascript-create.
check the example on the documentation page. you'll just need to tweak it a little and pass it your quote as the parameter instead of the 'Hello World' text
Eric James
@LyteTec
Nov 12 2015 04:16
<type input="form" <form action="/submit-cat-photo"></form>
Victor
@Evaderei
Nov 12 2015 04:16
@h4r1m4u thanks alot, lazy me just glazed over that
CamperBot
@camperbot
Nov 12 2015 04:16
evaderei sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 644 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 12 2015 04:17
you're welcome
Eric James
@LyteTec
Nov 12 2015 04:24
Guys I am stuck.
<form input action="/submit-cat-photo">
</form>
Nest your text input element within a form element.
h4r1m4u
@h4r1m4u
Nov 12 2015 04:26
@LyteTec 'nest' means put one element inside another. yout <input> needs to go inside your <form>:
<form action=....>
  <input type=....>
</form>
Eric James
@LyteTec
Nov 12 2015 04:26
AH I see thanks
h4r1m4u
@h4r1m4u
Nov 12 2015 04:27
no prob
Victor
@Evaderei
Nov 12 2015 04:29
@h4r1m4u I don't know where twttr.widgets.createShareButton is supposed to go
does it go inside $document.ready?
oh wait i think i have a lead
h4r1m4u
@h4r1m4u
Nov 12 2015 04:31
ideally you'd have a function createTweetButton()which would contain the twitter code, so that you can call the function whenever you need to create the button - which is on the initial page load and when you click the New Quote button
Mylz Lopez
@ArchedZero
Nov 12 2015 04:36
can someone help me with a problem?
h4r1m4u
@h4r1m4u
Nov 12 2015 04:37
@ArchedZero what's the issue?
Mylz Lopez
@ArchedZero
Nov 12 2015 04:38
im trying to nest a div element in another div.
<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">
   <div class="col-xs-6">
    <div class="col-xs-6">

     </div>
   </div>
 </div>
</div>
h4r1m4u
@h4r1m4u
Nov 12 2015 04:39
ok. and what's not working?
Mylz Lopez
@ArchedZero
Nov 12 2015 04:40
the two <div class="col-xs-6"> is supposed to be nested in the <div class="row">
its not accepting the code
h4r1m4u
@h4r1m4u
Nov 12 2015 04:40
ah. i see. you've nested the two .col-xs-6 divs in the .row div. but you've also nested one of the .col-xs-6 div inside the other
Mylz Lopez
@ArchedZero
Nov 12 2015 04:41
ohhhh
h4r1m4u
@h4r1m4u
Nov 12 2015 04:41
both the .col-xs-6 divs should be direct children of the .row div
Mylz Lopez
@ArchedZero
Nov 12 2015 04:41
ok it works
thanks @h4r1m4u
CamperBot
@camperbot
Nov 12 2015 04:41
archedzero sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 645 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 12 2015 04:42
you're welcome :sparkles:
HasheemSebastianBakir
@HasheemSebastianBakir
Nov 12 2015 05:03
This message was deleted
This message was deleted
Abhisek Pattnaik
@abhisekp
Nov 12 2015 05:04
@terakilobyte :point_up: November 12, 2015 10:33 AM
Victor
@Evaderei
Nov 12 2015 05:07
Woo hoo finished! @h4r1m4u
time to break it
Zachary Ryals
@ZachRyals
Nov 12 2015 05:11
'''
CamperBot
@camperbot
Nov 12 2015 05:11
:bulb: to format code use backticks! ``` more info
Zachary Ryals
@ZachRyals
Nov 12 2015 05:12

```
var Car = function(wheels, seats, engines) {
//Change this constructor
this.wheels = 4;
this.seats = 1;
this.engines = 1;
};

//Try it out here
var myCar = new Car(3,1,2);

// Only change code above this line

(function() {return JSON.stringify(myCar);})();

```Am I doing this wrong, it looks right but it's now working.

Hans van Riet
@hansinla
Nov 12 2015 05:20

@ZachRyals You are assigning static numbers

this.wheels = 4;
this.seats = 1;
this.engines = 1;

but you should use the variables wheels, seats, engines

Zachary Ryals
@ZachRyals
Nov 12 2015 05:21
Where?
Hans van Riet
@hansinla
Nov 12 2015 05:23
@ZachRyals here: var Car = function(wheels, seats, engines) {
use those vars in your assignments.
Zachary Ryals
@ZachRyals
Nov 12 2015 05:25
Isn't that what I did?
Hans van Riet
@hansinla
Nov 12 2015 05:26
@ZachRyals No you set it to 4, 1, 1 I’ll give you one example, you figure out the others
this.wheels =  wheels;
Majd900
@Majd900
Nov 12 2015 05:27
Hello !
Hans van Riet
@hansinla
Nov 12 2015 05:27
@Majd900 hi
Zachary Ryals
@ZachRyals
Nov 12 2015 05:28
Okay, thank you hansinla
Hans van Riet
@hansinla
Nov 12 2015 05:29
@ZachRyals no problem.
ninjax0
@ninjax0
Nov 12 2015 05:42

so like... i'm supposed to be "nesting my text input element within a form element" everything seems to be structured correctly, but i'm not sure on how to actually nest it:

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

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

h4r1m4u
@h4r1m4u
Nov 12 2015 05:45
@ninjax0 your <input> element needs to go inside the <form> element (that's what 'nest' implies):
<form action="...">
 <input type="..." ...>
</form>
Mylz Lopez
@ArchedZero
Nov 12 2015 06:16
can anyone tell me if this is right?
<script>$(document).ready (function() 
    { }); 
</script>
h4r1m4u
@h4r1m4u
Nov 12 2015 06:17
other than the space between .ready and (function() it looks ok
This message was deleted
Mylz Lopez
@ArchedZero
Nov 12 2015 06:18
it still doesn't work
hmm
h4r1m4u
@h4r1m4u
Nov 12 2015 06:20
when you say it doesn't work, what does that mean?
Mylz Lopez
@ArchedZero
Nov 12 2015 06:21
whenever I run the test the checklist for the lesson disappears and it doesn't let me go on to the next lesson
im pretty sure I have everything right
h4r1m4u
@h4r1m4u
Nov 12 2015 06:22
try to reset the code (with the reset button in the sidebar), reload the page and use the same code again
sometimes the waypoints stop working
clearing your browser's cache may also help
LMartir
@LMartir
Nov 12 2015 06:30
hey @h4r1m4u , how did you post that image? looking for help with "Add Borders Around your Element" would like to post pic/
Elliott McNary
@bighitbiker3
Nov 12 2015 06:31
Anyone have any ideas how I can get this clock to show the break time? it goes from 0:00 right to 4:59 (if the break time is 5:00)
ignore the visual bugs and stuff, just shortening the timer for testing right now
h4r1m4u
@h4r1m4u
Nov 12 2015 06:31
@LMartir which image?
LMartir
@LMartir
Nov 12 2015 06:32
an image of the waypoint im working on
im using snipping tool but which form do i use to upload it in for this forum
h4r1m4u
@h4r1m4u
Nov 12 2015 06:33
you just drag the image into the chat window
LMartir
@LMartir
Nov 12 2015 06:33
ok ill try it
Agori Nelson
@Agorinelson
Nov 12 2015 06:33
greetings
LMartir
@LMartir
Nov 12 2015 06:34
didnt work. opened a whole new page
i'll try something else...
Herman Fassett
@HermanFassett
Nov 12 2015 06:35
Too small
:smile:
LMartir
@LMartir
Nov 12 2015 06:35
darn
ok, back to the drawing board
nope...
<a href="http://lookpic.com/O/i2/976/Lih3ZpnJ.jpeg" target="_blank"><img src="http://lookpic.com/O/t2/976/Lih3ZpnJ.jpeg" border="0"></a>
Herman Fassett
@HermanFassett
Nov 12 2015 06:37
I got it
:P
LMartir
@LMartir
Nov 12 2015 06:37
nope again...
h4r1m4u
@h4r1m4u
Nov 12 2015 06:37
@LMartir you can also just post the code here directly. or simply paste the URL from your browser
LMartir
@LMartir
Nov 12 2015 06:38
ok
h4r1m4u
@h4r1m4u
Nov 12 2015 06:38
i actually don't like the images, as you can't edit them. so when you want to help someone, you need to retype everything
LMartir
@LMartir
Nov 12 2015 06:38
by any chance could you guide me on this?
h4r1m4u
@h4r1m4u
Nov 12 2015 06:38
sure
wiki format
CamperBot
@camperbot
Nov 12 2015 06:38

:point_right: code format [wiki]

Inline code

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

Code Block

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

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

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

How to Code

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

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

h4r1m4u
@h4r1m4u
Nov 12 2015 06:38
:point_up:
LMartir
@LMartir
Nov 12 2015 06:38
lol
ok
Herman Fassett
@HermanFassett
Nov 12 2015 06:39
@LMartir Add semi colons in your thick-green-border class and it should work
h4r1m4u
@h4r1m4u
Nov 12 2015 06:39
backtick is the key normally under the escape on your keyboard (to the left of number 1 key)
LMartir
@LMartir
Nov 12 2015 06:40
ok I'll try it
Ian Barker
@IanBarkerDev
Nov 12 2015 06:40
Anyone on?
h4r1m4u
@h4r1m4u
Nov 12 2015 06:40
nope, all bots here :D
Avrozavr
@Avrozavr
Nov 12 2015 06:40
@Malical on what?
LMartir
@LMartir
Nov 12 2015 06:40
YOU WERE RIGHT @HermanFassett
Ian Barker
@IanBarkerDev
Nov 12 2015 06:40
Oh alright then. I'll leave the bots be.
Herman Fassett
@HermanFassett
Nov 12 2015 06:41
:D
LMartir
@LMartir
Nov 12 2015 06:41
thanks @HermanFassett
CamperBot
@camperbot
Nov 12 2015 06:41
lmartir sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 573 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Herman Fassett
@HermanFassett
Nov 12 2015 06:41
Yep
Ian Barker
@IanBarkerDev
Nov 12 2015 06:41
Don't want to wear them out.
Wait. Can I change an href with jQuery?
h4r1m4u
@h4r1m4u
Nov 12 2015 06:41
some call it jQuery, some call it magic
LMartir
@LMartir
Nov 12 2015 06:41
something so small and so simple can be such a pain
Ian Barker
@IanBarkerDev
Nov 12 2015 06:42
Of course when I go to ask for help I think of anotehr way to do it.
I call it magic.
h4r1m4u
@h4r1m4u
Nov 12 2015 06:42
same here. baffles me every day
Ian Barker
@IanBarkerDev
Nov 12 2015 06:42
Well if this doesnt' work then I'll come here again to complain about asynchronous ajax.
h4r1m4u
@h4r1m4u
Nov 12 2015 06:42
sounds like a plan
Ian Barker
@IanBarkerDev
Nov 12 2015 06:49
What's the chances that this works the first time?
5%?
manojromina
@manojromina
Nov 12 2015 06:57
Nest your text input element within a form element.? in html
Ian Barker
@IanBarkerDev
Nov 12 2015 06:57
Well it didn't work.
But now I have a different problem of course.
h4r1m4u
@h4r1m4u
Nov 12 2015 06:58
@Malical what's the issue?
Ian Barker
@IanBarkerDev
Nov 12 2015 06:59
So I'm doing Wikipedia, and working with their nightmare of an API. And I'm trying to get the page ids. And maybe it's just that I've been up for too long, but the ID is stored inside an object with the name as ... the ... id. Which I don't know.
h4r1m4u
@h4r1m4u
Nov 12 2015 07:00
i'm not sure i fully understand. could you rephrase this bit: "but the ID is stored inside an object with the name as ... the ... id. Which I don't know." or post the sample of the object?
also, what do you need the id for?
Ian Barker
@IanBarkerDev
Nov 12 2015 07:01
{
    "batchcomplete": "",
    "query": {
        "pages": {
            "452098": {
                "pageid": 452098,
                "ns": 0,
                "title": "SVT"
            }
        }
    }
}
It seems to be the way to - Wait. Can I just have it be the title?
Regardless, am I being stupid with this issue?
Herman Fassett
@HermanFassett
Nov 12 2015 07:02
You shouldn't need id I don't think
Ian Barker
@IanBarkerDev
Nov 12 2015 07:02
Okay.
But regardless, how would one get it seeing as you get that back?
h4r1m4u
@h4r1m4u
Nov 12 2015 07:04
you could iterate over the "pages" object. in pseudocode
for each 'page' in 'pages':
 return 'page'.'pageid'
Herman Fassett
@HermanFassett
Nov 12 2015 07:04
My call had more options I think
Like a snippet
Rick
@rick1827
Nov 12 2015 07:06
I'm stuck on waypoint 140
Create decimal numbers
Herman Fassett
@HermanFassett
Nov 12 2015 07:07
Follow the example
h4r1m4u
@h4r1m4u
Nov 12 2015 07:07
what have you tried so far @rick1827 ?
Rick
@rick1827
Nov 12 2015 07:07
That's thing not sure where start
h4r1m4u
@h4r1m4u
Nov 12 2015 07:08
Let's create a variable myDecimal and give it a decimal value.
how do you create a variable myDecimal?
Rick
@rick1827
Nov 12 2015 07:08
oh crap
Stupid
Sorry I didn't read
h4r1m4u
@h4r1m4u
Nov 12 2015 07:08
:) no problem
Del
@RoboDel
Nov 12 2015 07:09

Racking my brain here and can't get this one...?
`var myMin = 24;

var myMax = 44;

function myFunction() {

return Math.floor(Math.random() * (myMin >= myMax + 1)) +myMax;`
myFunction() should use use both myMax and myMin, and return a random number in your range.

Elliott McNary
@bighitbiker3
Nov 12 2015 07:09
Got it to work...but now it's skipping :01 when I tell the break timer to stop! Any tips? I can't for the life of me understand why it's skipping :01 http://s.codepen.io/bighitbiker3/debug/JYeXgE
Rick
@rick1827
Nov 12 2015 07:10
Thanks h4r1m4u
Ian Barker
@IanBarkerDev
Nov 12 2015 07:10
Hehe. So they have links. But it's asynchronous. So their all mixed up.
they're*
That won't be a problem right?
h4r1m4u
@h4r1m4u
Nov 12 2015 07:12
@RoboDel you have a mistake in the return statement in your function: return Math.floor(Math.random() * (myMin >= myMax + 1)) +myMax; have a look at what the formula to generate the random number from the min / max range should look like
Del
@RoboDel
Nov 12 2015 07:14
@h4r1m4u Ok, I'll study it some more.
Ian Barker
@IanBarkerDev
Nov 12 2015 07:18
Finnnne. I did it the way that works instead of the way that doesn't. But where's the fun in that?
Del
@RoboDel
Nov 12 2015 07:19
@h4r1m4u I replaced the <= with a - and generate a random # between my min and max...?...
return Math.floor(Math.random() * (myMin - myMax + 1)) +myMax;
myFunction() should use use both myMax and myMin, and return a random number in your range.
h4r1m4u
@h4r1m4u
Nov 12 2015 07:20
@RoboDel alright, so you fixed one of the issues. nice. there's another problem. check the formula again to see where you should be using the max number and where min
Kofi A.
@iamkarsoft
Nov 12 2015 07:20
stuck on bonfire
can anyone help?
Elliott McNary
@bighitbiker3
Nov 12 2015 07:21
which bonfire?
Kofi A.
@iamkarsoft
Nov 12 2015 07:21
the first one
and i can't seem to move on
Elliott McNary
@bighitbiker3
Nov 12 2015 07:22
What's your issue?
h4r1m4u
@h4r1m4u
Nov 12 2015 07:22
@iamkarsoft you mean the 'Meet Bonfire' bonfire?
Del
@RoboDel
Nov 12 2015 07:22
@h4r1m4u Ok...I got it to work but I don't know why it does now...?...
`return Math.floor(Math.random() * (myMax - myMin + 1)) +myMin;~
Kofi A.
@iamkarsoft
Nov 12 2015 07:23
@h4r1m4u @bighitbiker3 reverse string
i am able to reverse the strings
but how can i do it for all at the same time
if thats what they are asking
Elliott McNary
@bighitbiker3
Nov 12 2015 07:24
@iamkarsoft can you post your code?
Kofi A.
@iamkarsoft
Nov 12 2015 07:24
@bighitbiker3 reverseString("hello").split('').reverse().join('');
h4r1m4u
@h4r1m4u
Nov 12 2015 07:25
@RoboDel the best way to understand the maths behind it is to substitute the variable names with some actual numbers and then do the calculations. it'll make sense if you write it down on a piece of paper. the main reason it's so complicated is that Math.random() generates a random float number between 0 and 1 (e.g. 0.23 or 0.85). the rest of the formula just ensures that you get whole numbers instead of floats and within your min/max range
Avrozavr
@Avrozavr
Nov 12 2015 07:25
@iamkarsoft dont write hello
@iamkarsoft return str.split("").reverse().join("")
h4r1m4u
@h4r1m4u
Nov 12 2015 07:27
@iamkarsoft you're supposed to create the function that does the reversal:
function reverseString(str) {
 // the code that reverses the string goes here
return str; // here you return the reversed string
}
you've learned how to create and work with functions in the previous waypoints. this is no different
Del
@RoboDel
Nov 12 2015 07:27
@h4r1m4u thanks
CamperBot
@camperbot
Nov 12 2015 07:27
robodel sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 646 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Kofi A.
@iamkarsoft
Nov 12 2015 07:28
@Avrozavr @h4r1m4u thanks solved it., i spent ours figuring out what was going wrong...
CamperBot
@camperbot
Nov 12 2015 07:28
iamkarsoft sends brownie points to @avrozavr and @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 233 | @avrozavr | http://www.freecodecamp.com/avrozavr
:star: 647 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 12 2015 07:28
@iamkarsoft great
Avrozavr
@Avrozavr
Nov 12 2015 07:28
@iamkarsoft glad to help
h4r1m4u
@h4r1m4u
Nov 12 2015 07:29
@RoboDel check out the wiki resource for the challenge as well: https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Waypoint-Generate-Random-Whole-Numbers-within-a-Range. it explains how it works in detail
Del
@RoboDel
Nov 12 2015 08:47

Is this a bug?
$($(".slot")[0]).html('<img src = "' + images[slotOne - 1] + '">'); $($(".slot")[1]).html('<img src = "' + images[slotTwo - 1] + '">'); $($(".slot")[2]).html('<img src = "' + images[slotThree - 1] + '">');
everything seems to be working?
$($('.slot')[0]).html('<img src = "' + images[slotOne-1] + '">');

Set up all three slots like this, then click the "Go" button to play the slot machine.

Del
@RoboDel
Nov 12 2015 08:58
@h4r1m4u thanks I had no Idea Wiki did this
CamperBot
@camperbot
Nov 12 2015 08:58
robodel sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 648 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 12 2015 08:59
@RoboDel make sure you have no spaces around the - operator: images[slotOne - 1]. technically it doesn't matter, but this waypoint doesn't like the blank space around the minus
my pleasure
Del
@RoboDel
Nov 12 2015 09:10
@h4r1m4u Yep, that's all it was; once again I applaud your genius .............. Does every WayPoint have a wiki page to explain things out like that...?...because I'm not finding another like that
h4r1m4u
@h4r1m4u
Nov 12 2015 09:12
@RoboDel no problem, bud. the main wiki page for the challenges is here: https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Map. i haven't gone through it, so i'm not sure how detailed the pages for the individual challenges are
the question about the random number generation that you had is fairly common (a lot of people are baffled by it), so i guess someone took the time to write the page and explain it
Del
@RoboDel
Nov 12 2015 09:14
I'm still confused on that one... I cloned that page to my git to go over it more
jpjenkins
@jpjenkins
Nov 12 2015 09:26
good morning people :)
I'm having a little trouble understanding this mdn post, can someone help me out?
Actually, now that I'm writing it, I semi-understand, there are just holes in my brain need filled still :)
AYE EVANS
@ignorantusguru
Nov 12 2015 09:49
hello world
CamperBot
@camperbot
Nov 12 2015 09:49

welcome to FreeCodeCamp @ignorantusguru!

Jurtly
@Jurtly
Nov 12 2015 09:50
@ignorantusguru thats a funny name
Aleksander Gębicki
@Takumar
Nov 12 2015 09:50
@ignorantusguru welcome to FCC community - Happy Coding!
AYE EVANS
@ignorantusguru
Nov 12 2015 09:51
lol @Jurtly because I seem to be i bit ignorant about coding and I hope to walk my way up to a guru
thanks for the notice @Takumar
CamperBot
@camperbot
Nov 12 2015 09:51
ignorantusguru sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 690 | @takumar | http://www.freecodecamp.com/takumar
Jurtly
@Jurtly
Nov 12 2015 09:51
@ignorantusguru gl hermano
AYE EVANS
@ignorantusguru
Nov 12 2015 09:52
I need help on my first jQuery waypoint, I am a bit confused on how to apply the animated bounce style to by button
Michael Cheung
@m6cheung
Nov 12 2015 09:52
@ignorantusguru post your code?
AYE EVANS
@ignorantusguru
Nov 12 2015 09:53

ok @m6cheung here it is:

<script>
$(document).ready(function() {

});

</script>

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

Michael Cheung
@m6cheung
Nov 12 2015 09:54
@ignorantusguru ok
so the question is asking for you to make all the buttons bounce?
AYE EVANS
@ignorantusguru
Nov 12 2015 09:56
yeah I got I honestly to know where to put the jquery code thats what I mean man
@m6cheung
Michael Cheung
@m6cheung
Nov 12 2015 09:56
in the script tag, your have it correct
AYE EVANS
@ignorantusguru
Nov 12 2015 09:57
OK leme give it the try I'll hit you back on the result, thanks @m6cheung for the tip
CamperBot
@camperbot
Nov 12 2015 09:57
ignorantusguru sends brownie points to @m6cheung :sparkles: :thumbsup: :sparkles:
:star: 254 | @m6cheung | http://www.freecodecamp.com/m6cheung
Michael Cheung
@m6cheung
Nov 12 2015 09:58
@ignorantusguru ok for sure, just make sure you read the problem carefully. sometimes the answer is staring right at you
Ishan
@ishanism
Nov 12 2015 10:05
hi, i am getting " strSeperate[i] is undefined"

function findLongestWord(str) {
  var strSeperate=str.split(' ');
  var longestLength = 0;
  for (i=1; i<=strSeperate.length; i++){
    var strLength = strSeperate[i].length;
    if (longestLength < strLength){
      longestLength = strLength;
    }
  }
  //return strLength;
  return longestLength;
}

findLongestWord("The quick brown fox jumped over the lazy dog");
i can't understand why.
AYE EVANS
@ignorantusguru
Nov 12 2015 10:06

hey @m6cheung can you please look this up and see where i flawed

script>
$(document).ready(function() {

});

$("button").addClass("animated bounce")

</script>

Ishan
@ishanism
Nov 12 2015 10:07
@ignorantusguru there is no semicolon at the end of $("button").addClass("animated bounce") and also at beginning it's <script>(I hope thats copy-paste error :D
Michael Cheung
@m6cheung
Nov 12 2015 10:07
@ignorantusguru so when you do $(document).ready(function() {
});
what does this mean?
Ishan
@ishanism
Nov 12 2015 10:09

also as @m6cheung mentioned your document ready function is empty.

```

try
< script>
$(document).ready(function() {
$("button").addClass("animated bounce");
});
</script>
Prefu
@Prefu
Nov 12 2015 10:10
Hi i'm at Waypoint: Make Instances of Objects with a Constructor Function. Why var myCar.nickname = "string"; doesn't work
Michael Cheung
@m6cheung
Nov 12 2015 10:10
@ishanism you should help make sure he understands
@ishanism before giving the answer but kudos!
Ishan
@ishanism
Nov 12 2015 10:11
ok :) it's my first time coming so,
by the way can you look at my problem, above. i can't seem to find any problem there :D
AYE EVANS
@ignorantusguru
Nov 12 2015 10:11
Ok guys @ishanism @m6cheung I'm going reply but i need to wire this in
Michael Cheung
@m6cheung
Nov 12 2015 10:12
@ishanism let me see real quick
@ishanism try starting the loop at 0, not 1
so that it starts at the first item in the array and n
Ishan
@ishanism
Nov 12 2015 10:14
it still says the same.
oh wait i understood.
Prefu
@Prefu
Nov 12 2015 10:14
can anyone help me ? P
Ishan
@ishanism
Nov 12 2015 10:15
if it starts from 0 then i have to make it end at last index so thats i<=strSeperate.length. thanks @m6cheung .
CamperBot
@camperbot
Nov 12 2015 10:15
ishanism sends brownie points to @m6cheung :sparkles: :thumbsup: :sparkles:
:star: 256 | @m6cheung | http://www.freecodecamp.com/m6cheung
Ishan
@ishanism
Nov 12 2015 10:15
i am coming from qbasic so always end up starting array from 1
AYE EVANS
@ignorantusguru
Nov 12 2015 10:15
Ok to you @m6cheung $(document) = "button", "ready" = addClass and (function() = animated bounce right?
Michael Cheung
@m6cheung
Nov 12 2015 10:16
@ignorantusguru no youre originally ready function was correct,
$(document).ready(function() {

});
Ishan
@ishanism
Nov 12 2015 10:16
@Prefu just a minute i will look into it.
Michael Cheung
@m6cheung
Nov 12 2015 10:17
@ignorantusguru this says that when the document is ready and has loaded, i want to run some code within the the ready function
Ishan
@ishanism
Nov 12 2015 10:17
@Prefu can you show what you have done till now. paste all the code.
Michael Cheung
@m6cheung
Nov 12 2015 10:18
@ignorantusguru so wherre should animated bounce be located?
@ishanism did ou figure out the longest length problem?
AYE EVANS
@ignorantusguru
Nov 12 2015 10:23
hmm i guess inside the () just after funcion, Am i right?
Michael Cheung
@m6cheung
Nov 12 2015 10:24
@ignorantusguru no inside the () would where arguments(if any) would go, but if you want to a function to have contents, you have to place your code inside the function body
Ishan
@ishanism
Nov 12 2015 10:25
@m6cheung yes. thanks.
CamperBot
@camperbot
Nov 12 2015 10:25
ishanism sends brownie points to @m6cheung :sparkles: :thumbsup: :sparkles:
:warning: ishanism already gave m6cheung points
Michael Cheung
@m6cheung
Nov 12 2015 10:25
so finally, it should have a format like this
$(document).ready(function() {

//code that you want to run when the document is ready

});
AYE EVANS
@ignorantusguru
Nov 12 2015 10:27
brb @m6cheung
Wow, just did it, thanks @m6cheung you're teacher
CamperBot
@camperbot
Nov 12 2015 10:29
ignorantusguru sends brownie points to @m6cheung :sparkles: :thumbsup: :sparkles:
:warning: ignorantusguru already gave m6cheung points
Michael Cheung
@m6cheung
Nov 12 2015 10:29
@ignorantusguru np gl with everything
AYE EVANS
@ignorantusguru
Nov 12 2015 10:31
I just followed you, can i follow you on other network maybe
@m6cheung ?
Michael Cheung
@m6cheung
Nov 12 2015 10:32
@ignorantusguru mm i only have this and github at the moment
@ignorantusguru thanks tho!
CamperBot
@camperbot
Nov 12 2015 10:32
m6cheung sends brownie points to @ignorantusguru :sparkles: :thumbsup: :sparkles:
:star: 110 | @ignorantusguru | http://www.freecodecamp.com/ignorantusguru
AYE EVANS
@ignorantusguru
Nov 12 2015 10:34
Ill Keep track here and git....gl to you too @m6cheung
ilanjb
@ilanjb
Nov 12 2015 10:56
How do I add the JQuery library and the Animate.css library to my own html?
Ashutosh Anand
@Ashu0039
Nov 12 2015 11:04
Hey, can someone help me figure out what we need to do for the problem: Create a JS slot machine?
Alexander Køpke
@alexanderkopke
Nov 12 2015 11:06
@ilanjb you link to it in the head tags
https://daneden.github.io/animate.css/ here you can download animate.css
http://jquery.com/ here is a where you download jquery but you can also link directly to it if you find a link
@Ashu0039 what is hte problem?
Ashutosh Anand
@Ashu0039
Nov 12 2015 11:12
I'm generating random nos using a fn..This is my code
function runSlots(){ return Math.floor(Math.random() * (3 - 1 + 1)) + 1; }
Then i store in 3 variables named slotOne, slotTwo and slotThree; as var slotOne = runSlots();
@alexanderkopke But when im submitting the code, i get the error slotOne should be a random number. and similarly for other two. What am i doing wrong?
Aleksander Gębicki
@Takumar
Nov 12 2015 11:16
@Ashu0039 maybe FCC doesn't understand that you used a function and looks for direct assignment: slotOne = Math.floor...
Your code may be 100% correct.
Alexander Køpke
@alexanderkopke
Nov 12 2015 11:17
ok you have to make a random number for each of the variables... var slotOne = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
Ashutosh Anand
@Ashu0039
Nov 12 2015 11:18
i tried that too..but same error
Aleksander Gębicki
@Takumar
Nov 12 2015 11:18
This message was deleted
sunilgeorgejohn
@sunilgeorgejohn
Nov 12 2015 11:19
hi
Ashutosh Anand
@Ashu0039
Nov 12 2015 11:19
@Takumar Can you help me how?
Aleksander Gębicki
@Takumar
Nov 12 2015 11:20
@Ashu0039 this was a bad guess. Show your entire code.
Andrei Kiselev
@gitkiselev
Nov 12 2015 11:20
Somebody help me with task "Yor p elementshould contain the first few words of the provided additional kitty ipsum text. "
Ashutosh Anand
@Ashu0039
Nov 12 2015 11:20
@Takumar <script>
function runSlots(){
return Math.floor(Math.random() (3 - 1 + 1)) + 1;
}
var slotOne = Math.floor(Math.random()
(3 - 1 + 1)) + 1;
console.log(typeof(slotOne));
var slotTwo = Math.floor(Math.random() (3 - 1 + 1)) + 1;
var slotThree = Math.floor(Math.random()
(3 - 1 + 1)) + 1;
</script>
Alexander Køpke
@alexanderkopke
Nov 12 2015 11:20

here is my code

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

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

// Only change code below this line.
slotOne = Math.floor(Math.random() * (3-1+1)) +1;
slotTwo = Math.floor(Math.random() * (3-1+1)) +1;
slotThree = Math.floor(Math.random() * (3-1+1)) +1;;


// Only change code above this line.
@gitkiselev sure.. what is the problem?
Aleksander Gębicki
@Takumar
Nov 12 2015 11:21
@Ashu0039 problem may be that you had already defined three variables: var slotOne; var slotTwo; var slotThree; and you had to assign values to them later.
sunilgeorgejohn
@sunilgeorgejohn
Nov 12 2015 11:23

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

</style>

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

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

<p 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>= for gitkislev

Ashutosh Anand
@Ashu0039
Nov 12 2015 11:23

@Takumar @alexanderkopke ok i tried this now <script>
var slotOne, slotTwo, slotThree;

function runSlots(){
return Math.floor(Math.random() (3 - 1 + 1)) + 1;
}
slotOne = Math.floor(Math.random()
(3-1+1)) +1;

slotTwo = Math.floor(Math.random() (3-1+1)) +1;
slotThree = Math.floor(Math.random()
(3-1+1)) +1;
</script>...same error

Aleksander Gębicki
@Takumar
Nov 12 2015 11:23

@Ashu0039 you missed multiplication:

var slotOne = Math.floor(Math.random() (3 - 1 + 1)) + 1;

If you correct this, you can use your function:

    slotOne = runSlots();
Archna Lal
@lalarchna
Nov 12 2015 11:26
I have add an a element that links to http://freecatphotoapp.com
Ashutosh Anand
@Ashu0039
Nov 12 2015 11:26
@Takumar I have specified that in code..doesn't work
Archna Lal
@lalarchna
Nov 12 2015 11:26
and my code is <a href:"http://freecatphotoapp.com"> cat photos</a>
this is not working
Ashutosh Anand
@Ashu0039
Nov 12 2015 11:26
<script>
var slotOne, slotTwo, slotThree;
slotOne = Math.floor(Math.random() (3-1+1)) +1;
slotTwo = Math.floor(Math.random()
(3-1+1)) +1;
slotThree = Math.floor(Math.random() * (3-1+1)) +1;
</script> @Takumar Here's the code again
Alexander Køpke
@alexanderkopke
Nov 12 2015 11:27

ok reset your code and only enter code inside this:

// Only change code below this line.
slotOne = Math.floor(Math.random() (3-1+1)) +1;
slotTwo = Math.floor(Math.random() (3-1+1)) +1;
slotThree = Math.floor(Math.random() (3-1+1)) +1;

// Only change code above this line.
Aleksander Gębicki
@Takumar
Nov 12 2015 11:27

multiplication -> '*'

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

or your function:

function runSlots(){
return Math.floor(Math.random() * (3 - 1 + 1)) + 1;
}
sunilgeorgejohn
@sunilgeorgejohn
Nov 12 2015 11:27
@lalarchna which waypoint is it
Ashutosh Anand
@Ashu0039
Nov 12 2015 11:28
I have specified that in code..it seems * is not printed here when i copy and paste the code
Alexander Køpke
@alexanderkopke
Nov 12 2015 11:28
@lalarchna <a href= you used <a href:
Archna Lal
@lalarchna
Nov 12 2015 11:28
link to external pages with anchor elements
ok
Alexander Køpke
@alexanderkopke
Nov 12 2015 11:28
used = sign like this <a href="http://freecatphotoapp.com"> cat photos</a>
Ashutosh Anand
@Ashu0039
Nov 12 2015 11:29

<script>
var slotOne, slotTwo, slotThree;
function runSlots(){
return Math.floor(Math.random() * (3 - 1 + 1)) + 1;
}

slotOne = runSlots();
slotTwo = runSlots();
slotThree = runSlots();
</script> ...here's the updated code @Takumar @alexanderkopke

sunilgeorgejohn
@sunilgeorgejohn
Nov 12 2015 11:30

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

<style>
.red-text {
color: red;
}
<style> .a =cat photos </style>
h2 {
font-family: Lobster, Monospace;
}

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

<p>Here's a <a href="http://freecatphotoapp.com"> link to cat photos</a> for you to follow.</p>
.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
border-radius: 50%;
}

<p>Here's a = cat photos <a href="http://freecatphotoapp.com"> link to "cat photos"</a> for you to follow.</p>

.smaller-image {
width: 100px;
}

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

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

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

this was my solution
Ashutosh Anand
@Ashu0039
Nov 12 2015 11:31
Error nessage: slotOne should be a random number.
slotTwo should be a random number.
slotThree should be a random number.
*message
sunilgeorgejohn
@sunilgeorgejohn
Nov 12 2015 11:32
@alexanderkopke where do u add # for the dead link
Aleksander Gębicki
@Takumar
Nov 12 2015 11:33

@Ashu0039 if this is Waypoint: Create a JavaScript Slot Machine
you shortened existing code:

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

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

    // Only change code below this line.

    // Only change code above this line.

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

    if(slotOne !== undefined && slotTwo !== undefined && slotThree !== undefined){
      $(".logger").html(slotOne + " " + slotTwo + " " + slotThree);
    }
    return [slotOne, slotTwo, slotThree];
  }

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

between comments put:

slotOne = Math.floor....

You have created your function runSlots() which returns one random number, but there was another function runSlots() which return array of 3 numbers which you should change.

Alexander Køpke
@alexanderkopke
Nov 12 2015 11:33
href="#"
@sunilgeorgejohn
sunilgeorgejohn
@sunilgeorgejohn
Nov 12 2015 11:35
cool
Alexander Køpke
@alexanderkopke
Nov 12 2015 11:36
@Takumar his code may be correct but if he alters it maybe FCC won't be able pass it as correct
Ashutosh Anand
@Ashu0039
Nov 12 2015 11:36
@Takumar Thanks. I think the whole code wasn't loaded. I got a blank canvas in the start of the problem
CamperBot
@camperbot
Nov 12 2015 11:36
ashu0039 sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 693 | @takumar | http://www.freecodecamp.com/takumar
Aleksander Gębicki
@Takumar
Nov 12 2015 11:37
@Ashu0039 last two weeks I sometimes also get blank screen without existing code, so I hit "Reset" button and everything works OK.
Ashutosh Anand
@Ashu0039
Nov 12 2015 11:37
@Takumar Ok. Thanks for the info
CamperBot
@camperbot
Nov 12 2015 11:37
ashu0039 sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:warning: ashu0039 already gave takumar points
Aleksander Gębicki
@Takumar
Nov 12 2015 11:38
@Ashu0039 so maybe create your function with another name i.e.
function getRandomNo(){
  return Math.floor(Math.random() * (3 - 1 + 1)) + 1;
}
Ashutosh Anand
@Ashu0039
Nov 12 2015 11:40
It worked. The code I initially was not complete. The code you gave was the proper one. I added the lines between the comment lines and it worked.
Aleksander Gębicki
@Takumar
Nov 12 2015 11:41
@Ashu0039 good job. That is the thing that I don't like, when something is not working and it is not our fault. It is good when you can ask someone and save a lot of time.
jpjenkins
@jpjenkins
Nov 12 2015 11:55
  • (3 - 1 + 1) ... why write it like this?
Aleksander Gębicki
@Takumar
Nov 12 2015 12:01
@jpjenkins it is a formula to generate random number from given range.
jpjenkins
@jpjenkins
Nov 12 2015 12:01
I understand, but why write it as 3-1+1?
Aleksander Gębicki
@Takumar
Nov 12 2015 12:03
@jpjenkins you can shorten it if you like, but it shows you that you get in such way numbers from range [1, 3] for range [min, max] it will be: (max - min + 1) + min
Of course when you are familiar with Math.random() method you can shorten it freely.
jpjenkins
@jpjenkins
Nov 12 2015 12:04
ah, longhanded for clarity, like pseudo parameter representation
Alexander Køpke
@alexanderkopke
Nov 12 2015 12:05
ah.. I wondered about that too. thanks for explaining @Takumar
jpjenkins
@jpjenkins
Nov 12 2015 12:05
thanks @Takumar :)
CamperBot
@camperbot
Nov 12 2015 12:05
jpjenkins sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 695 | @takumar | http://www.freecodecamp.com/takumar
AYE EVANS
@ignorantusguru
Nov 12 2015 12:07
hello world I Need help with waypoint 116
CamperBot
@camperbot
Nov 12 2015 12:07

welcome to FreeCodeCamp @ignorantusguru!

AYE EVANS
@ignorantusguru
Nov 12 2015 12:07
Changing Css using jQuery
<script>
$(document).ready(function() {

$("#target1").css("color, red");

});
</script>
Alexander Køpke
@alexanderkopke
Nov 12 2015 12:09
quotes around both color and red.. like this ("color", "red");
AYE EVANS
@ignorantusguru
Nov 12 2015 12:10
:smile: thanks @alexanderkopke
CamperBot
@camperbot
Nov 12 2015 12:10
ignorantusguru sends brownie points to @alexanderkopke :sparkles: :thumbsup: :sparkles:
:star: 199 | @alexanderkopke | http://www.freecodecamp.com/alexanderkopke
Alexander Køpke
@alexanderkopke
Nov 12 2015 12:10
:)
AYE EVANS
@ignorantusguru
Nov 12 2015 12:11
and I've trying to see where the bug was, crazy life with coding though but we'll make it through, thanks once again @alexanderkopke
CamperBot
@camperbot
Nov 12 2015 12:11
ignorantusguru sends brownie points to @alexanderkopke :sparkles: :thumbsup: :sparkles:
:warning: ignorantusguru already gave alexanderkopke points
AYE EVANS
@ignorantusguru
Nov 12 2015 12:28
hello @alexanderkopke you still there
Alexander Køpke
@alexanderkopke
Nov 12 2015 12:28
yes
looking in from time to time
AYE EVANS
@ignorantusguru
Nov 12 2015 12:29
oh okay you good with jQuery ?
Alexander Køpke
@alexanderkopke
Nov 12 2015 12:31
not an expert.. just started here a couple of days ago
started on bonfire today
AYE EVANS
@ignorantusguru
Nov 12 2015 12:32
then you musta gone passed this waypoint, I'm trying to remove a target, I'm trying to remove an element using Jquery
Aleksander Gębicki
@Takumar
Nov 12 2015 12:32
@ignorantusguru and what's your problem?
Alexander Køpke
@alexanderkopke
Nov 12 2015 12:34
use $("#target4").remove(); to remove a target
AYE EVANS
@ignorantusguru
Nov 12 2015 12:35

targeting the element, i need to understand the concept and not just do it to get an answer please help @Takumar

<script>
$(document).ready(function() {
$("#target1").css("color", "red");
$("#target1").prop("disabled", true);


});
</script>

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

Aleksander Gębicki
@Takumar
Nov 12 2015 12:36
@ignorantusguru you already know how to target element because you changed "css" of your "target1" element.
AYE EVANS
@ignorantusguru
Nov 12 2015 12:36
say I am trying to remove target1 element
Alexander Køpke
@alexanderkopke
Nov 12 2015 12:36
$() <- is where you 'target' or select what you want to use.. $(document) for example is the whole page
Aleksander Gębicki
@Takumar
Nov 12 2015 12:36
@ignorantusguru if you want to remove element, first you need to find it. So you find it by: ("#target1") and then you call remove(); class on this element.
hash - means specific id, if it is class you use period in front of name of the class.
Muhammad Asif
@MuhammadAsifMA
Nov 12 2015 12:37
Hey I need some help
var Car = function() {
  this.wheels = 4;
  this.engines = 1;
  this.seats = 1;
};

// Only change code below this line.

var myCar = new Car();
var myCar.nickname = "whatever";
Alexander Køpke
@alexanderkopke
Nov 12 2015 12:37
whereas $("#target4") selects the id target4
Muhammad Asif
@MuhammadAsifMA
Nov 12 2015 12:37
It is showing error in the last line
Alexander Køpke
@alexanderkopke
Nov 12 2015 12:38
@MuhammadAsifMA don't use var again.. 'var' is only to create a new variable
myCar.nickname = "whatever";
Muhammad Asif
@MuhammadAsifMA
Nov 12 2015 12:39
@alexanderkopke thanks :)
CamperBot
@camperbot
Nov 12 2015 12:39
muhammadasifma sends brownie points to @alexanderkopke :sparkles: :thumbsup: :sparkles:
:star: 201 | @alexanderkopke | http://www.freecodecamp.com/alexanderkopke
Alexander Køpke
@alexanderkopke
Nov 12 2015 12:39
:)
Muhammad Asif
@MuhammadAsifMA
Nov 12 2015 12:39
Now, once the myCar instance is created it can be used like any other object and can have its properties accessed and modified the same way you would usually. For example:

var myCar.turboType = "twin";

Our myCar variable now has a property turboType with a value of "twin".
@alexanderkopke they have made a mistake in the explanation.
AYE EVANS
@ignorantusguru
Nov 12 2015 12:40
OK brb @alexanderkopke and @Takumar
Alexander Køpke
@alexanderkopke
Nov 12 2015 12:40
you are right @MuhammadAsifMA
they put var MyCar.turbotype... that is mistake..
AYE EVANS
@ignorantusguru
Nov 12 2015 12:44
$("#target4").remove();
@Takumar @alexanderkopke
worked but I need to understand why there is not declaration inside the remove function? @Takumar @alexanderkopke
thanks @alexanderkopke @Takumar
CamperBot
@camperbot
Nov 12 2015 12:46
ignorantusguru sends brownie points to @alexanderkopke and @takumar :sparkles: :thumbsup: :sparkles:
:warning: ignorantusguru already gave alexanderkopke points
:star: 697 | @takumar | http://www.freecodecamp.com/takumar
Alexander Køpke
@alexanderkopke
Nov 12 2015 12:48
I guess because you remove the whole element and there is nothing more to do than just remove it. So it doesn't need more than just the command
Aleksander Gębicki
@Takumar
Nov 12 2015 12:48
@ignorantusguru I started write too late :-) @alexanderkopke is right. What would you like to do more? You have element which you want to remove, and you remove it.
AYE EVANS
@ignorantusguru
Nov 12 2015 12:49
ok thanks @Takumar @alexanderkopke
CamperBot
@camperbot
Nov 12 2015 12:49
ignorantusguru sends brownie points to @takumar and @alexanderkopke :sparkles: :thumbsup: :sparkles:
:warning: ignorantusguru already gave takumar points
:warning: ignorantusguru already gave alexanderkopke points
AYE EVANS
@ignorantusguru
Nov 12 2015 12:50
makes sense :+1:
1ilya0
@1ilya0
Nov 12 2015 12:51
Hello, guys. Could you help me? I'd know how to write in the code: "You should have removed all the values from the array that are greater than 5". Thanks in advance.)
Alexander Køpke
@alexanderkopke
Nov 12 2015 12:51
sometimes programming is simple. Thankfully so! array.reverse() is the same thing. Reverse the array and that is it
@1ilya0 ok could you post what you have so far?
Alexander Køpke
@alexanderkopke
Nov 12 2015 13:13
hmm I don't understand why palindrome("0_0 (: /-\ :) 0-0") should return true. The only one I can't make work
hmm I guess I will make an if check for letters and returning true is non is found
Coira Ellison
@Coira
Nov 12 2015 13:40
@alexanderkopke you have to remove all punctuation. you'll end up with 0000
@alexanderkopke nvm, i just realised that was 30 minutes ago! gitter playing up :p
Katherine
@KWW8488
Nov 12 2015 13:52
blob
Hi everyone, I'm stuck on an elementary FCC challenge. I cannot get my text to turn red using the following class structure :
Can anyone help me and/or point out what I am doing incorrectly?
Thank you!
Jim Villanueva
@jimvillanueva
Nov 12 2015 13:54
yes. you need to apply the CSS to your p tag
<p class="red-text">
Katherine
@KWW8488
Nov 12 2015 13:54
Apologies, the red text is supposed to be applied only to the h2 tag
Jim Villanueva
@jimvillanueva
Nov 12 2015 13:54
<h2 class="red-text"> then
I think I made that mistake as well.
Katherine
@KWW8488
Nov 12 2015 13:55
I tried that and it worked. It is only in this form : .red-text {color: red; } that it doesn't work.
Jim Villanueva
@jimvillanueva
Nov 12 2015 13:55
which exercise are you working on?
oh nevermind, it looks like you got it
Katherine
@KWW8488
Nov 12 2015 13:56
Use a CSS Class to Style an Element.
The code is correct, at least based on the FCC explanation, but it doesn't work.
Jim Villanueva
@jimvillanueva
Nov 12 2015 13:57

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

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

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

ohhh
you put the <h2> BEFORE the <style> tag
it has to go after.
Katherine
@KWW8488
Nov 12 2015 13:58
Just switched the location of the h2 element, but it still doesn't work.
Jim Villanueva
@jimvillanueva
Nov 12 2015 13:59
I just gave you the working code
so, give that a look. also look at this to understand why the style must go at the top. http://www.w3schools.com/tags/tag_style.asp
good luck
Katherine
@KWW8488
Nov 12 2015 13:59
Thank you Jim! Will take a look.
SumaiyaRh
@SumaiyaRh
Nov 12 2015 14:00
Hi guys
I'm stuck on the Iterate over arrays w map challenge
Jigno Alfred V. Venezuela
@iamjigz
Nov 12 2015 14:01
Hi, when I share my bonfire solution as github gist, should it be added to my repo or something?
SumaiyaRh
@SumaiyaRh
Nov 12 2015 14:01
Would be great if someone could point me in the right direction
Aleksander Gębicki
@Takumar
Nov 12 2015 14:01
@SumaiyaRh what is your problem?
SumaiyaRh
@SumaiyaRh
Nov 12 2015 14:02

var oldArray = [1,2,3,4,5];

// Only change code below this line.

var newArray = oldArray;

var addThree = oldArray.map(function(val){

return val + 3;

});

But this doesn't add 3 to every variable in the array
:s
Jigno Alfred V. Venezuela
@iamjigz
Nov 12 2015 14:03
var newArray = oldArray.map(function(val) {
return val + 3;
});
Can you try that one? @SumaiyaRh
SumaiyaRh
@SumaiyaRh
Nov 12 2015 14:04
yoooo that worked!
Aleksander Gębicki
@Takumar
Nov 12 2015 14:04
@SumaiyaRh it creates new array callaed "addThree" which contains values from oldArray but +3
SumaiyaRh
@SumaiyaRh
Nov 12 2015 14:04
thanks man :D
Aleksander Gębicki
@Takumar
Nov 12 2015 14:04
so the only problem was names of your array. FCC expected "newArray" not "addThree".
Jigno Alfred V. Venezuela
@iamjigz
Nov 12 2015 14:04
No problem! :D
yes @Takumar
SumaiyaRh
@SumaiyaRh
Nov 12 2015 14:04
@Takumar thanks, I made a similar mistake in one of the previous challenges.
CamperBot
@camperbot
Nov 12 2015 14:04
sumaiyarh sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 701 | @takumar | http://www.freecodecamp.com/takumar
SumaiyaRh
@SumaiyaRh
Nov 12 2015 14:05
Practice makes perfect tho :clap:
thanks for your help guys
Aleksander Gębicki
@Takumar
Nov 12 2015 14:06
@SumaiyaRh I hope you are right, I practice and practice and practice...
CaffeineQueen
@CaffeineQueen
Nov 12 2015 14:10
It is like learning a new language, minus the "listener" having any idea you aren't fluent
davees
@davees
Nov 12 2015 14:17
any idea why i cant run my code anymore? i click on "run tests" and nothing happens
Aleksander Gębicki
@Takumar
Nov 12 2015 14:18
@davees you don't run IE?
davees
@davees
Nov 12 2015 14:20
no im on chrome
Aleksander Gębicki
@Takumar
Nov 12 2015 14:22
"Reset" button sometimes work in such case. Copy your code to clipboard (or file) and reset exercise.
jennrobbie1124
@jennrobbie1124
Nov 12 2015 14:34
@davees I'm having the same problem right now, and reset didn't work, but I am on IE
Jim Villanueva
@jimvillanueva
Nov 12 2015 14:34
working fine for me on firefox
CaffeineQueen
@CaffeineQueen
Nov 12 2015 14:37
Who runs IE? And why?
I only have IE for my husband's outdated Army crap that won't run on anything else except years-old versions of IE.
Jim Villanueva
@jimvillanueva
Nov 12 2015 14:39
some folks stick with defaults.. XD
moment of silence for Netscape Communicator
jennrobbie1124
@jennrobbie1124
Nov 12 2015 14:39
I'm going to switch to chrome and see if that works
Aleksander Gębicki
@Takumar
Nov 12 2015 14:40
IE is good for downloading Firefox ;-)
Jim Villanueva
@jimvillanueva
Nov 12 2015 14:40
it sure is
I tried FCC on IE9 and it didn't turn out well
Jason Wood
@catapixel
Nov 12 2015 14:40
@CaffeineQueen I have a number of customers who are still IE only. In fact they only support up to IE 9. No Windows 11 for me lol
Jim Villanueva
@jimvillanueva
Nov 12 2015 14:40
about 80% of the site did not display properly
CamperBot
@camperbot
Nov 12 2015 14:40
you need to ask about @someone!
Jim Villanueva
@jimvillanueva
Nov 12 2015 14:41
which actually I would figure that this site would have planned for. XD
Hm, so according to this the majority of folks are using Chrome right now.. http://www.w3schools.com/browsers/browsers_stats.asp
Noticed quite a few apps out there that "kindly" offer to install Chrome for you as your default browser unless you check a box. Could be why..
er, unless you UNcheck a box
AYE EVANS
@ignorantusguru
Nov 12 2015 14:45
in my opinion its because Chrome seem to be the sh*t right now, virtually with stress working with
CaffeineQueen
@CaffeineQueen
Nov 12 2015 14:47
My (ex)boss uses IE. Drives me nuts.
AYE EVANS
@ignorantusguru
Nov 12 2015 14:47

lastNameLength = lastName;
lastNameLength = 8;
lastName .length;

why is this indicating that it "Expected an assignemtn or function and instead saw an expression" yet it take me pass the waypoint

@Takumar
CaffeineQueen
@CaffeineQueen
Nov 12 2015 14:48
I'm still on Windows 7 but at least I have FireFox and Chrome, Opera too on my husband's computer that runs 8
Pranay Kothapalli
@kotAPI
Nov 12 2015 14:48
lastName .length needs to be assigned
AYE EVANS
@ignorantusguru
Nov 12 2015 14:49
ok now i'm confused @kotAPI , I only what the waypoint instructed
and it took me pass i only needed to know why the "warning" red sign
Pranay Kothapalli
@kotAPI
Nov 12 2015 14:50
.length is something you use to get the length of a string
it passes because it's not really an error, its more like a warning
you are asking for length of "lastName" but not really using it;
it's like saying "I like turtles" and just leaving others in awkward silence, and not explaining why you like turtles
AYE EVANS
@ignorantusguru
Nov 12 2015 14:51
what then do i need to fix, I want to be sure why the warning would there if everything was okay
Pranay Kothapalli
@kotAPI
Nov 12 2015 14:51
just delete this line
lastName .length;

also, if i may suggest some corrections

lastNameLength = lastName .length;

delete the other two lines, it's redundant and more concise

AYE EVANS
@ignorantusguru
Nov 12 2015 14:53

wont let me pass now, maybe you look it all up:

var firstNameLength = 0;
var lastNameLength = 0;
var firstName = "Ada";

firstNameLength = firstName.length;

var lastName = "Lovelace";

// Only change code below this line.

lastNameLength = lastName;
lastNameLength = 8;

Pranay Kothapalli
@kotAPI
Nov 12 2015 14:56
// Only change code below this line.
lastNameLength = lastName.length;
that's it
lastNameLength = 8;
why are you assigning 8?
Herman Fassett
@HermanFassett
Nov 12 2015 14:57
Hard coding?
Pranay Kothapalli
@kotAPI
Nov 12 2015 14:57
seems like it :D
AYE EVANS
@ignorantusguru
Nov 12 2015 14:57
:smile: cos I am still an ignorant working my way
Pranay Kothapalli
@kotAPI
Nov 12 2015 14:57
don't calculate, make the computer calculate
AYE EVANS
@ignorantusguru
Nov 12 2015 14:57
lol really funny but makes alota sense now thanks @kotAPI
CamperBot
@camperbot
Nov 12 2015 14:57
ignorantusguru sends brownie points to @kotapi :sparkles: :thumbsup: :sparkles:
:star: 244 | @kotapi | http://www.freecodecamp.com/kotapi
Pranay Kothapalli
@kotAPI
Nov 12 2015 14:58
any time bud, now go and build piedpiper
AYE EVANS
@ignorantusguru
Nov 12 2015 14:59
:+1:
saurav
@sauravkarki2
Nov 12 2015 15:26
can someone
waypoint exercise : iterate with map?
Peter Daily
@thepeted
Nov 12 2015 15:28
@sauravkarki2 I can try :-) whatsup
saurav
@sauravkarki2
Nov 12 2015 15:29
@thepeted hey umm...well i really don't understand this exercise
Peter Daily
@thepeted
Nov 12 2015 15:29
K.. lemme read it. Do you know about forEach yet?
fkneist
@fkneist
Nov 12 2015 15:29
Hi, I'm coming from the beginner tutorial. Heard about FCC yesterday on a JS meetup... and I directly have a question: does someone have experience with archiving websites in a accurate fashion. At the moment I'm using warcprox+phantomJS
Peter Daily
@thepeted
Nov 12 2015 15:31
@sauravkarki2 what .map() does is 1. loop through each of the elements in an array 2. let you alter something about that element 3. push that element to a new array
so if you write it correctly, it will become newArray() will be based on oldArray() and will be [4,5,6,7,8]
saurav
@sauravkarki2
Nov 12 2015 15:33
@thepeted so whatever changes we make in using map is pushed into a new array??
Peter Daily
@thepeted
Nov 12 2015 15:33
@sauravkarki2 yep, you got it.
saurav
@sauravkarki2
Nov 12 2015 15:34
@thepeted ohh...well i think i understood ...thank you :)
CamperBot
@camperbot
Nov 12 2015 15:34
sauravkarki2 sends brownie points to @thepeted :sparkles: :thumbsup: :sparkles:
:star: 372 | @thepeted | http://www.freecodecamp.com/thepeted
Peter Daily
@thepeted
Nov 12 2015 15:35
its the same as oldArray.forEach(function(el){ newArray.push(el + 3); })
@sauravkarki2 give it a go - its a really cool function, you will use it a lot!
saurav
@sauravkarki2
Nov 12 2015 15:36
@thepeted ok :)
Peter Daily
@thepeted
Nov 12 2015 15:36
excuse my scruffy syntax!
Tiffany L.
@tlanderstx
Nov 12 2015 15:38

Waypoint: Create a Custom Heading <div class="row container-fluid">
<div class="col-xs-8">
<h2 class="text-primary text-center">
CatPhotoApp
</h2>
</div>
<div class="col-xs-4">
<a href="#">
<img class="img-responsive thick-green-border" src="https://bit.ly/fcc-relaxing-cat">
</a>
</div>
</div>

I'm getting an error telling me to make sure all of my div elements have closing tags??? What am I missing?

Aleksander Gębicki
@Takumar
Nov 12 2015 15:41
@tlanderstx you have 2 starting <div> and 3 closing </div>. No, 3 starting, sorry.
fkneist
@fkneist
Nov 12 2015 15:41
remove the last </div>
Tiffany L.
@tlanderstx
Nov 12 2015 15:42
Wow, that's was tricky...LOL- hmmmm, maybe I ought to take a break. Thank you!!
Avrozavr
@Avrozavr
Nov 12 2015 15:43
@Takumar it's where if starts
Aleksander Gębicki
@Takumar
Nov 12 2015 15:43
@tlanderstx try to format your code using backticks. It's easier to read.
wiki format
CamperBot
@camperbot
Nov 12 2015 15:43

:point_right: code format [wiki]

Inline code

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

Code Block

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

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

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

How to Code

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

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

Tiffany L.
@tlanderstx
Nov 12 2015 15:44
I'll try that, thanks. Removing the last </div> didn't work.
fkneist
@fkneist
Nov 12 2015 15:45
I oversaw the first line, sorry
Aleksander Gębicki
@Takumar
Nov 12 2015 15:45

Your code formatted, is it easier to read?

 <div class="row container-fluid">
  <div class="col-xs-8">
    <h2 class="text-primary text-center">CatPhotoApp</h2>
  </div>
  <div class="col-xs-4">
    <a href="#"><img class="img-responsive thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>
  </div>
</div>

My code:

<div class="container-fluid">
  <div class="row">
    <div class="col-xs-8">
      <h2 class="text-primary text-center">CatPhotoApp</h2>
    </div>
    <div class="col-xs-4">  
      <a href="#"><img class="img-responsive thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>
    </div>
  </div>
saurav
@sauravkarki2
Nov 12 2015 15:46
screenshot-www.freecodecamp.com 2015-11-12 21-30-01.png
@thepeted could you check what i did wrong in this code ??
Peter Daily
@thepeted
Nov 12 2015 15:50
@sauravkarki2 aha - so you have coded it as if it was a forEach() function. But map() will automatically return a new array with the changes you make to el
8001268
@8001268
Nov 12 2015 15:50
i need help
Peter Daily
@thepeted
Nov 12 2015 15:50
@sauravkarki2 MDN will explain it better than me - check this link! https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map
Avrozavr
@Avrozavr
Nov 12 2015 15:50
@tlanderstx that's not all the code, is it?
null@8001268 with what?
8001268
@8001268
Nov 12 2015 15:51

<h2 style="color: blue">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>

Avrozavr
@Avrozavr
Nov 12 2015 15:51
null@8001268 what waypoint is it?
8001268
@8001268
Nov 12 2015 15:52
Use CSS Selectors to Style Elements
Aleksander Gębicki
@Takumar
Nov 12 2015 15:52
@tlanderstx You have added another class to <div> which already has class "container-fluid".
That's why number of divs was wrong.
Peter Daily
@thepeted
Nov 12 2015 15:53
@sauravkarki2 you don't need to tell it to push to the new array. Also, remember that .map() will return a new array. eg. var newArray = oldArray.map()
Tiffany L.
@tlanderstx
Nov 12 2015 15:53
@Takumar Thank you. Finally got it!
CamperBot
@camperbot
Nov 12 2015 15:53
tlanderstx sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 703 | @takumar | http://www.freecodecamp.com/takumar
Aleksander Gębicki
@Takumar
Nov 12 2015 15:54
@tlanderstx it was difficult to see problem from the part of code, it looked ok. I had to look at waypoint.
null@8001268 remember about semicolon when you style elements.
<h2 style="color: blue;">
Avrozavr
@Avrozavr
Nov 12 2015 15:55
you need to separate styles
null@8001268
8001268
@8001268
Nov 12 2015 15:56
umm ok i tink i got it @Avrozavr
Avrozavr
@Avrozavr
Nov 12 2015 15:56
<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>
kind of like this
null@8001268 my indentation sucks =)))
Sawredjet
@sawredjet
Nov 12 2015 15:58
Does anyone know how to create more than one class and give them both to an element?
fkneist
@fkneist
Nov 12 2015 15:58
class="classA classB classC"
Moroni
@moroniscow
Nov 12 2015 15:58
I am stuck. i don't know how to do anchor text. this is what i have. where does the anchor text go. then i also need to create and a element that links to a specific link. this is what i have right now.
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

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

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

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

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

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

<p 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>
Avrozavr
@Avrozavr
Nov 12 2015 15:59
@sawredjet <p class="class1 class2">
Sawredjet
@sawredjet
Nov 12 2015 15:59
@fkneist
@Avrozavr
Avrozavr
@Avrozavr
Nov 12 2015 16:00
@moroniscow which waypoint is it?
Moroni
@moroniscow
Nov 12 2015 16:00
Waypoint: Link to External Pages with Anchor Elements
Avrozavr
@Avrozavr
Nov 12 2015 16:01
@moroniscow You need to create links
Marilynvillano
@Marilynvillano
Nov 12 2015 16:02
hello
I am marylin
Anthony
@Guzko
Nov 12 2015 16:03
How do I do this? Give your form's text input field a class of form-control. Do I put it in the <form class="">
<form action="/submit-cat-photo">
    <div class="row">
      <div class="col-xs-6">
        <label><input type="radio" name="indoor-outdoor"> Indoor</label>
      </div>
      <div class="col-xs-6">
        <label><input type="radio" name="indoor-outdoor"> Outdoor</label>
      </div>
    </div>
    <div class="row">
      <div class="col-xs-4">
        <label><input type="checkbox" name="personality"> Loving</label>
      </div>
      <div class="col-xs-4">
        <label><input type="checkbox" name="personality"> Lazy</label>
      </div>
      <div class="col-xs-4">
        <label><input type="checkbox" name="personality"> Crazy</label>
      </div>
    </div>
    <input type="text" placeholder="cat photo URL" required>
    <button type="submit">Submit</button>
  </form>
Moroni
@moroniscow
Nov 12 2015 16:03
How is this?
<p>Here's a <a href="http://freecatphotoapp.com"> Cat Photos</a> linkfor you to follow.</p>
Rajath
@Rajath13
Nov 12 2015 16:05
@sauravkarki2 the correct code is
var newArray= oldArray.map(function(val){
return val+3;
});
Avrozavr
@Avrozavr
Nov 12 2015 16:05
@moroniscow
saurav
@sauravkarki2
Nov 12 2015 16:05
screenshot-www.freecodecamp.com 2015-11-12 21-49-35.png
Avrozavr
@Avrozavr
Nov 12 2015 16:05
<p>Here's a <a href="http://freecatphotoapp.com"> link to cat photos</a> for you to follow.</p>
saurav
@sauravkarki2
Nov 12 2015 16:05
@thepeted thanks mann it worked!!
CamperBot
@camperbot
Nov 12 2015 16:05
sauravkarki2 sends brownie points to @thepeted :sparkles: :thumbsup: :sparkles:
:warning: sauravkarki2 already gave thepeted points
Avrozavr
@Avrozavr
Nov 12 2015 16:06
@Guzko what waypoint?
8001268
@8001268
Nov 12 2015 16:09
@Avrozavr i need your help again
Avrozavr
@Avrozavr
Nov 12 2015 16:09
null@8001268 sure
8001268
@8001268
Nov 12 2015 16:10
on this one Waypoint: Use a CSS Class to Style an Element
Peter Daily
@thepeted
Nov 12 2015 16:11
@sauravkarki2 whoop! \o/
Avrozavr
@Avrozavr
Nov 12 2015 16:11
null@8001268 what's the problem?
fkneist
@fkneist
Nov 12 2015 16:11
is there a codecamp chat for general webdev problems?
8001268
@8001268
Nov 12 2015 16:12
idk what it means when its like your h2 element shoul d declare a red-text
Avrozavr
@Avrozavr
Nov 12 2015 16:14
null@8001268 there is an example <h2 class="blue-text">
AYE EVANS
@ignorantusguru
Nov 12 2015 16:14
can you import your code here?
8001268
@8001268
Nov 12 2015 16:14
??
AYE EVANS
@ignorantusguru
Nov 12 2015 16:15
null@8001268
8001268
@8001268
Nov 12 2015 16:16

<style>
h2 {
color: red;
}
</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>

Peter Daily
@thepeted
Nov 12 2015 16:16
wiki format
CamperBot
@camperbot
Nov 12 2015 16:16

:point_right: code format [wiki]

Inline code

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

Code Block

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

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

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

How to Code

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

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

Avrozavr
@Avrozavr
Nov 12 2015 16:17
<style>
  .red-text {
    color: red;
  }
</style>

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

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
null@8001268
see?
class is with a dot
8001268
@8001268
Nov 12 2015 16:18
ohhh ok tanks
thanks*
Avrozavr
@Avrozavr
Nov 12 2015 16:19
null@8001268 you're welcome
Alexander Køpke
@alexanderkopke
Nov 12 2015 16:19
info markdown
wiki markdown
CamperBot
@camperbot
Nov 12 2015 16:20
no wiki entry for: markdown
:pencil: click here to create one now!after creating your page type update to reload it here
CaffeineQueen
@CaffeineQueen
Nov 12 2015 16:31
I'm confused by this car thing, I keep getting "wheels is not defined"
Avrozavr
@Avrozavr
Nov 12 2015 16:31
@CaffeineQueen which waypoint?
CaffeineQueen
@CaffeineQueen
Nov 12 2015 16:31
Make Unique Objects by Passing Parameters to our Constructor
Avrozavr
@Avrozavr
Nov 12 2015 16:32
@CaffeineQueen can you post your code?
CaffeineQueen
@CaffeineQueen
Nov 12 2015 16:32

//Change this constructor
this.wheels = wheels;
this.seats = seats;
this.engines = engines;
};

//Try it out here
var myCar = new Car(3,1,2);

Avrozavr
@Avrozavr
Nov 12 2015 16:33
got this at the top? var Car = function(wheels, seats, engines) {
@CaffeineQueen
CaffeineQueen
@CaffeineQueen
Nov 12 2015 16:34
var Car = function() {
Avrozavr
@Avrozavr
Nov 12 2015 16:34
@CaffeineQueen you need parameters too
CaffeineQueen
@CaffeineQueen
Nov 12 2015 16:34
Ah, my eyes were skipping over that
Avrozavr
@Avrozavr
Nov 12 2015 16:34
@CaffeineQueen yea, mine too
at first
CaffeineQueen
@CaffeineQueen
Nov 12 2015 16:35
thank you @Avrozavr
CamperBot
@camperbot
Nov 12 2015 16:35
caffeinequeen sends brownie points to @avrozavr :sparkles: :thumbsup: :sparkles:
:star: 236 | @avrozavr | http://www.freecodecamp.com/avrozavr
Aleksander Gębicki
@Takumar
Nov 12 2015 16:35
@CaffeineQueen you are allowed to change entire constructor.
Avrozavr
@Avrozavr
Nov 12 2015 16:35
@CaffeineQueen glad to help
@Takumar I know some things at least =)))
Aleksander Gębicki
@Takumar
Nov 12 2015 16:36
@Avrozavr very good, you can help others :thumbsup:
CaffeineQueen
@CaffeineQueen
Nov 12 2015 16:36
This is like trying to learn several dialects at once.
Avrozavr
@Avrozavr
Nov 12 2015 16:36
@Takumar trying to do so, yes
@CaffeineQueen one at a time =)
CaffeineQueen
@CaffeineQueen
Nov 12 2015 16:37
I feel like I should have a textbook or 5 to reference
Avrozavr
@Avrozavr
Nov 12 2015 16:38
@CaffeineQueen Yea, I had this thought in mind too
but it's hard for me to write
Alexander Køpke
@alexanderkopke
Nov 12 2015 16:44
camberbot can be helpful just type: wiki topic(<-chose topic)
Logan Jones
@nagol2012
Nov 12 2015 16:48
how do I use the nickname property?
Avrozavr
@Avrozavr
Nov 12 2015 16:49
@nagol2012 what you mean?
Logan Jones
@nagol2012
Nov 12 2015 16:49

Now, once the myCar instance is created it can be used like any other object and can have its properties accessed and modified the same way you would usually. For example:

var myCar.turboType = "twin";

Our myCar variable now has a property turboType with a value of "twin".

In the editor, use the Car constructor to create a new instance and assign it to myCar.

Then give myCar a nickname property with a string value.

I cant get that last line of this challenge
Alexander Køpke
@alexanderkopke
Nov 12 2015 16:50
@nagol2012 click a name with the mouse and it will appear here on text
wiki nickname
CamperBot
@camperbot
Nov 12 2015 16:50
no wiki entry for: nickname
:pencil: click here to create one now!after creating your page type update to reload it here
Avrozavr
@Avrozavr
Nov 12 2015 16:51
@nagol2012 what waypoint is it?
Logan Jones
@nagol2012
Nov 12 2015 16:51
@Avrozavr
Waypoint: Make Instances of Objects with a Constructor Function
Alexander Køpke
@alexanderkopke
Nov 12 2015 16:52
oops.. thought you meant nicknames here in chat
Logan Jones
@nagol2012
Nov 12 2015 16:52
@alexanderkopke haha :p no not quite
Alexander Køpke
@alexanderkopke
Nov 12 2015 16:53
ok first create instance of Car.. like so: var myCar = Car();
Logan Jones
@nagol2012
Nov 12 2015 16:54
okay I got that!
Alexander Køpke
@alexanderkopke
Nov 12 2015 16:54
then give it nickname property with value like so: myCar.nickname = "choose some nickname";
Logan Jones
@nagol2012
Nov 12 2015 16:54
just the line below that?
Alexander Køpke
@alexanderkopke
Nov 12 2015 16:54
yes
Logan Jones
@nagol2012
Nov 12 2015 16:55
I got a error that says cannot set property nickname of undefined
Alexander Køpke
@alexanderkopke
Nov 12 2015 16:56
can you post the two lines?
Logan Jones
@nagol2012
Nov 12 2015 16:56
var myCar = Car(); {
myCar.nickname= "whip";
Alexander Køpke
@alexanderkopke
Nov 12 2015 16:56
remove {
AYE EVANS
@ignorantusguru
Nov 12 2015 16:56
@Avrozavr and @alexanderkopke this basic JavaScript isn't looking basic to me I think I need to understand this nitty gritty if I must survive In-house
Logan Jones
@nagol2012
Nov 12 2015 16:57
still has a program execution failure :/
Avrozavr
@Avrozavr
Nov 12 2015 16:57
@ignorantusguru aha, I get you here
Alexander Køpke
@alexanderkopke
Nov 12 2015 16:58
@ignorantusguru true it can have a steep learning curve.. it can take some time.. don't give up
@nagol2012 ok can you post the whole code?
AYE EVANS
@ignorantusguru
Nov 12 2015 16:58
I need to understand how those string values are evaluated cow I keep getting twisted
Logan Jones
@nagol2012
Nov 12 2015 16:58
var myCar = Car();
myCar.nickname= "whip";
this.wheels = 4;
this.engines = 1;
this.seats = 1;
Coira Ellison
@Coira
Nov 12 2015 16:59
@nagol2012 var myCar = new Car();
Logan Jones
@nagol2012
Nov 12 2015 16:59
that did it. much appreciated!!
Coira Ellison
@Coira
Nov 12 2015 16:59
you need the new to create a new object
:)
Alexander Køpke
@alexanderkopke
Nov 12 2015 16:59
doh.. I forgot new too.. sorry :(
no wonder it didn't work
Logan Jones
@nagol2012
Nov 12 2015 17:00
i just copied your code @alexanderkopke haha. but i get it now. thanks much to ya both!
CamperBot
@camperbot
Nov 12 2015 17:00
nagol2012 sends brownie points to @alexanderkopke :sparkles: :thumbsup: :sparkles:
:star: 202 | @alexanderkopke | http://www.freecodecamp.com/alexanderkopke
AYE EVANS
@ignorantusguru
Nov 12 2015 17:00
Any simpler resource I might have to look at before I proceed with my FCC project here ?@alexanderkopke @Avrozavr
Alexander Køpke
@alexanderkopke
Nov 12 2015 17:01
@ignorantusguru well, truth be told I do google a lot and use camperbot too to find how to do something
Avrozavr
@Avrozavr
Nov 12 2015 17:01
@ignorantusguru on JS?
AYE EVANS
@ignorantusguru
Nov 12 2015 17:02
Yeah, for more basic JS
Alex Jester
@alexjester
Nov 12 2015 17:03
I'm trying to reverse myArray in Waypoint:Reverse Arrays with reverse... could someone help me with this challenge? My code looks like this right now:
var myArray = reverse.newArray;
AYE EVANS
@ignorantusguru
Nov 12 2015 17:03

var firstLetterOfFirstName = "";

var firstLetterOfLastName = "";
3

4
var firstName = "Ada";
5

6
firstLetterOfFirstName = firstName[0];
7

8
var lastName = "Lovelace";
9

10
firstLetterOfLastName = lastName[0];

Avrozavr
@Avrozavr
Nov 12 2015 17:03
@ignorantusguru I'm reading "smarter way to learn javascript"
AYE EVANS
@ignorantusguru
Nov 12 2015 17:04
Ok remember how you answered the above code I just posted, I need to know how and why it 0 and just maybe I can go through the next waypoint
Avrozavr
@Avrozavr
Nov 12 2015 17:05
@ignorantusguru in javascript, numeration starts at zero
Alexander Køpke
@alexanderkopke
Nov 12 2015 17:05
https://www.codecademy.com/learn/javascript I think this one might be simpler but I don't remember if it is
Avrozavr
@Avrozavr
Nov 12 2015 17:06
@alexanderkopke it is, a bit
Tiffany Grevious
@DevchamploO
Nov 12 2015 17:06
I am having trouble understanding the instructions on "Waypoint: Make Object Properties Private" Help please?
Alexander Køpke
@alexanderkopke
Nov 12 2015 17:08
@alexjester what is the name of the variable that has an array stored ?
AYE EVANS
@ignorantusguru
Nov 12 2015 17:08
And ends at ? @Avrozavr
Avrozavr
@Avrozavr
Nov 12 2015 17:08
@DevchamploO let me look into it
@ignorantusguru depends on length of a string
mohanrajkumarplus
@mohanrajkumarplus
Nov 12 2015 17:08

hi i am in - Waypoint: Bring your JavaScript Slot Machine to Life

    // Only change code below this line.
    selector$(".slot");
    $($(".slot")[0]).html(slotOne);
    $($(".slot")[0]).html(slotTwo);
    $($(".slot")[0]).html(slotThree);


    // Only change code above this line.

what is that I am doing wrong,

AYE EVANS
@ignorantusguru
Nov 12 2015 17:08
Thanks @alexanderkopke looking it up
CamperBot
@camperbot
Nov 12 2015 17:08
ignorantusguru sends brownie points to @alexanderkopke :sparkles: :thumbsup: :sparkles:
:star: 203 | @alexanderkopke | http://www.freecodecamp.com/alexanderkopke
4everstudent
@4everstudent
Nov 12 2015 17:11
waypoint make unique objects by passing parameters to our constructor
Alexander Køpke
@alexanderkopke
Nov 12 2015 17:12
@mohanrajkumarplus remove selector$(".slot");
Avrozavr
@Avrozavr
Nov 12 2015 17:13
@DevchamploO this. makes private
Alexander Køpke
@alexanderkopke
Nov 12 2015 17:13
$(".slot") <--- is the selector..
mohanrajkumarplus
@mohanrajkumarplus
Nov 12 2015 17:15
@alexanderkopke thank you for your help. But the below code is also not working
    // Only change code below this line.
    $(".slot");
    $($(".slot")[0]).html(slotOne);
    $($(".slot")[0]).html(slotTwo);
    $($(".slot")[0]).html(slotThree);


    // Only change code above this line.
CamperBot
@camperbot
Nov 12 2015 17:15
mohanrajkumarplus sends brownie points to @alexanderkopke :sparkles: :thumbsup: :sparkles:
:star: 204 | @alexanderkopke | http://www.freecodecamp.com/alexanderkopke
Alexander Køpke
@alexanderkopke
Nov 12 2015 17:15
remove the first line: $(".slot");
leave the rest as they are
Avrozavr
@Avrozavr
Nov 12 2015 17:16
$($(".slot")[0]).html(slotOne);
    $($(".slot")[0]).html(slotTwo);
    $($(".slot")[0]).html(slotThree);
@mohanrajkumarplus like this
Moroni
@moroniscow
Nov 12 2015 17:16
I am trying to create a form element. this is what i have and i am unsure what is wrong.
<form action="<input type="text"placeholder="cat photo URL"</form>
CaffeineQueen
@CaffeineQueen
Nov 12 2015 17:16
Help, reverse array?
CamperBot
@camperbot
Nov 12 2015 17:16

:point_right: waypoint reverse arrays with reverse [wiki]

You can use the .reverse() function to reverse the contents of an array.

var array = [1,2,3,4,5,6,7];

array = array.reverse();

:pencil: read more about waypoint reverse arrays with reverse on the FCC Wiki

Avrozavr
@Avrozavr
Nov 12 2015 17:18
@CaffeineQueen it's simple
Coira Ellison
@Coira
Nov 12 2015 17:18
@mohanrajkumarplus you're using [0] for all three slots, but you want [0], [1], [2]
AYE EVANS
@ignorantusguru
Nov 12 2015 17:18
@alexanderkopke @Avrozavr
Avrozavr
@Avrozavr
Nov 12 2015 17:18
@Coira oh, right
@ignorantusguru yup
mohanrajkumarplus
@mohanrajkumarplus
Nov 12 2015 17:18
@alexanderkopke @Avrozavr ya removed that line, still it is not working : (
    // Only change code below this line.
  //  $(".slot");
    $($(".slot")[0]).html(slotOne);
    $($(".slot")[0]).html(slotTwo);
    $($(".slot")[0]).html(slotThree);


    // Only change code above this line.
CaffeineQueen
@CaffeineQueen
Nov 12 2015 17:18
@Avrozavr too simple. I added something in the parentheses
Coira Ellison
@Coira
Nov 12 2015 17:19
@mohanrajkumarplus change the numbers
Avrozavr
@Avrozavr
Nov 12 2015 17:19
@CaffeineQueen how's the addon?
CaffeineQueen
@CaffeineQueen
Nov 12 2015 17:19
Haven't tried it yet. Have to leave for work soon.
mohanrajkumarplus
@mohanrajkumarplus
Nov 12 2015 17:19
@Coira yes it worked :clap:
NGcoder2015
@NGcoder2015
Nov 12 2015 17:19
please help me with this nesting line.
Coira Ellison
@Coira
Nov 12 2015 17:19
great!
Avrozavr
@Avrozavr
Nov 12 2015 17:19
@CaffeineQueen it's evening here
Tiffany Grevious
@DevchamploO
Nov 12 2015 17:19
@Avrozavr thanks I left out capital letters
CamperBot
@camperbot
Nov 12 2015 17:19
devchamploo sends brownie points to @avrozavr :sparkles: :thumbsup: :sparkles:
:star: 238 | @avrozavr | http://www.freecodecamp.com/avrozavr
mohanrajkumarplus
@mohanrajkumarplus
Nov 12 2015 17:19
thank you very much @Coira @Avrozavr @alexanderkopke
CamperBot
@camperbot
Nov 12 2015 17:19
mohanrajkumarplus sends brownie points to @coira and @avrozavr and @alexanderkopke :sparkles: :thumbsup: :sparkles:
:warning: mohanrajkumarplus already gave alexanderkopke points
:star: 239 | @avrozavr | http://www.freecodecamp.com/avrozavr
:star: 300 | @coira | http://www.freecodecamp.com/coira
CaffeineQueen
@CaffeineQueen
Nov 12 2015 17:20
@Avrozavr it is afternoon here
NGcoder2015
@NGcoder2015
Nov 12 2015 17:20
<p> view more <a href= "http://www.freecatphotoapp.com">cat photos</a> </p>
what am i doing wrong completing this nesting waypoints
AYE EVANS
@ignorantusguru
Nov 12 2015 17:20
var firstName = "Ada";
2

3
var secondLetterOfFirstName = firstName[1];
4

5
var lastName = "Lovelace";
6

7
var thirdLetterOfLastName = lastName;
8

9

10
// Only change code above this line.
11

12
(function(v){return v;})(thirdLetterOfLastName);
Avrozavr
@Avrozavr
Nov 12 2015 17:20
@DevchamploO no problem
AYE EVANS
@ignorantusguru
Nov 12 2015 17:21
Look this up and pls explain a lik
Avrozavr
@Avrozavr
Nov 12 2015 17:21
@ignorantusguru if the first letter is 0, then what should be third letter?
@ignorantusguru take a guess
AYE EVANS
@ignorantusguru
Nov 12 2015 17:23
2 right ?
Avrozavr
@Avrozavr
Nov 12 2015 17:23
yep
you got it
AYE EVANS
@ignorantusguru
Nov 12 2015 17:23
Since we starry from 0 instead of 1
Alexander Køpke
@alexanderkopke
Nov 12 2015 17:23
@moroniscow <form action="/submit-cat-photo"> <input type="text" placeholder="cat photo URL"></form>
Avrozavr
@Avrozavr
Nov 12 2015 17:24
@CaffeineQueen work on night shifts?
AYE EVANS
@ignorantusguru
Nov 12 2015 17:24
Started and thanks @Avrozavr
CamperBot
@camperbot
Nov 12 2015 17:24
ignorantusguru sends brownie points to @avrozavr :sparkles: :thumbsup: :sparkles:
:warning: ignorantusguru already gave avrozavr points
CaffeineQueen
@CaffeineQueen
Nov 12 2015 17:24
Not really, just odd hours. They don't like me there in the morning or something.
It is pretty much my "last day" anyway
Avrozavr
@Avrozavr
Nov 12 2015 17:25
@CaffeineQueen got new job already?
@ignorantusguru you're welcome
CaffeineQueen
@CaffeineQueen
Nov 12 2015 17:25
no
Avrozavr
@Avrozavr
Nov 12 2015 17:26
@CaffeineQueen you will find it, I'm sure
Logan Jones
@nagol2012
Nov 12 2015 17:26
Any ideas what could be wrong here? the public methods are not returning anything
var myBike = new Bike(); {
var gear = 5;
this.setGear = 7;
this.getGear = 9;
}
Avrozavr
@Avrozavr
Nov 12 2015 17:27
@nagol2012 what waypoint?
Logan Jones
@nagol2012
Nov 12 2015 17:27
make object properties private
in object oriented!
AYE EVANS
@ignorantusguru
Nov 12 2015 17:27
<p> view more <a href= "http://www.freecatphotoapp.com">cat photos</a> </p>
Aleksander Gębicki
@Takumar
Nov 12 2015 17:29
@ignorantusguru big letters and spaces. "View more ", and ... com"> cat photos</a></p>
@Avrozavr are you working on @nagol2012 problem?
Avrozavr
@Avrozavr
Nov 12 2015 17:30
@nagol2012 hm... I got this but don't remember how
Logan Jones
@nagol2012
Nov 12 2015 17:30
yeah I am unsure on what i wants i guees
I understand the methods but not how they want them assembled
Avrozavr
@Avrozavr
Nov 12 2015 17:31
@Takumar was searching for my solution
no luck
AYE EVANS
@ignorantusguru
Nov 12 2015 17:31
<p> View more <a href="http://free photoshop.com"> Cat photos </a> </p>
Aleksander Gębicki
@Takumar
Nov 12 2015 17:32
@ignorantusguru " cat photos" was with small letters as I remember.
AYE EVANS
@ignorantusguru
Nov 12 2015 17:32
@NGcoder2015 Did you see the references help ?
Logan Jones
@nagol2012
Nov 12 2015 17:32
no space after free @ignorantusguru
Avrozavr
@Avrozavr
Nov 12 2015 17:32
@ignorantusguru cat photos
lowercase
AYE EVANS
@ignorantusguru
Nov 12 2015 17:33
I got it thanks
Aleksander Gębicki
@Takumar
Nov 12 2015 17:36

@nagol2012 you have to create constructor like in example. Object "myBike" is created for you. You have to place code between comments:

var Bike = function() {
  // Only change code below this line.

  // Only change code above this line.
};

place there your code (this is not fully right but you will correct this):

var gear = 5;
this.setGear = 7;
this.getGear = 9;
@nagol2012 using "var" you declare private properties, so you did this right for "gear".
jpjenkins
@jpjenkins
Nov 12 2015 17:39
hint
CamperBot
@camperbot
Nov 12 2015 17:39
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Aleksander Gębicki
@Takumar
Nov 12 2015 17:39
@nagol2012 on the other side "setGear" and "getGear" are public (declared using this and this is right) but they should be methods not properties. Check how getSpeed() method is declared.
Avrozavr
@Avrozavr
Nov 12 2015 17:41
@Takumar i'll be going have a good evening
Aleksander Gębicki
@Takumar
Nov 12 2015 17:43
@Avrozavr thanks, the same to you.
CamperBot
@camperbot
Nov 12 2015 17:43
takumar sends brownie points to @avrozavr :sparkles: :thumbsup: :sparkles:
:star: 240 | @avrozavr | http://www.freecodecamp.com/avrozavr
Aleksander Gębicki
@Takumar
Nov 12 2015 17:44
@nagol2012 how's your code?
Andrew Bechini
@powhunter158
Nov 12 2015 17:48
"Make sure each of your div elements has a closing tag." Any input would be great!
/Users/Bechini/Desktop/Screen Shot 2015-11-12 at 12.47.02 PM.png
Screen Shot 2015-11-12 at 12.47.02 PM.png
Aleksander Gębicki
@Takumar
Nov 12 2015 17:50
@powhunter158 You don't have to put every radio button or checkbox in single <div class="row">
Which waypoint it is?
var myCar = new Car();

myCar.wheels = 3;
myCar.seats = 1;
myCar.engines = 2;
Never mind sorry
I did read at number 2 the line said "//Change this constructor" and my code have been deleted :)
Andrew Bechini
@powhunter158
Nov 12 2015 17:56
@Takumar #95
Aleksander Gębicki
@Takumar
Nov 12 2015 17:58
@powhunter158 there are not so many waypoints in Bootstrap section. Is it "15. Waypoint: Responsively Style Radio Buttons"?
if so, you have to put your radio buttons in a single row.
<div class="row">
  <div class="col-xs-6>
   <label><input type="radio" name="indoor-outdoor"> Indoor</label>
  </div>
</div>
in the same way add second <div> with second radio button (of course inside external <div class="row">)
Alexander Køpke
@alexanderkopke
Nov 12 2015 18:03
also most of the divs aren't being closed
in the picture I mean
Logan Jones
@nagol2012
Nov 12 2015 18:06
@Takumar working on it, had to go into a meeting at work quick.

var gear = 10;
this.getGear = function() {
speed =3;

this.setGear = function() {
speed =3;

program execution failure..
Aleksander Gębicki
@Takumar
Nov 12 2015 18:09
@nagol2012 you have to close body of your functions. When you have opened '{' remember about closing it with '}'.
Also look at names. Why do you think one method is called "getGear()" and second "setGear"?
James Kim
@jameskim1980
Nov 12 2015 18:10
<script>
$(document).ready(function() {$("button").addClass(animated);$(".btn").addClass(shake);
$("#target1").addClass(btn-primary).addClass(animated).addClass(animated);
});
</script>
Logan Jones
@nagol2012
Nov 12 2015 18:10

so like.. var gear = 10;
this.getGear = function() {
speed =3; }

this.setGear = function() {
speed =3; }

ayy yes :)
James Kim
@jameskim1980
Nov 12 2015 18:10
Your #target1 element should have the classes animated‚ shake and btn-primary.
Logan Jones
@nagol2012
Nov 12 2015 18:10
thanks mate!
James Kim
@jameskim1980
Nov 12 2015 18:10
what am I doing wrong here
?
Aleksander Gębicki
@Takumar
Nov 12 2015 18:10
@nagol2012 not so fast...
Logan Jones
@nagol2012
Nov 12 2015 18:10
that cleared the challenge though..
Aleksander Gębicki
@Takumar
Nov 12 2015 18:11
@nagol2012 but that's not enough, your code should work good :-) not only pass tests.
Logan Jones
@nagol2012
Nov 12 2015 18:11
but would that not actually work?
Aleksander Gębicki
@Takumar
Nov 12 2015 18:11
so what for you need two functions with different names which do the same? First and second set "speed" property.
One should set "gear" property and second should return "gear" property. Please correct this.
Paul Tregoning
@PaulTregoning
Nov 12 2015 18:12
hello i have started coding today and im stuck on how to declare a red-text class
Logan Jones
@nagol2012
Nov 12 2015 18:13
@Takumar okay that makes sense, adjusting now
Aleksander Gębicki
@Takumar
Nov 12 2015 18:13
@jameskim1980 show your code, so we can look at it and correct.
The same @PaulTregoning, do you have something?
MANNY
@emmanuelpenuel
Nov 12 2015 18:13
@PaulTregoning <style>
.redtext
</style>
James Kim
@jameskim1980
Nov 12 2015 18:14
<script>
$(document).ready(function() {$("button").addClass(animated);$(".btn").addClass(shake);
$("#target1").addClass(btn-primary).addClass(animated).addClass(animated);
});
</script>
Akaash Vankamamidi
@akaashv92
Nov 12 2015 18:14
function largestOfFour(arr) {
  // You can do this!
  var largest = 0;
  for(var i=0; i < arr.length; i++){
    for(var n=0;n < arr[i].length; n++){
      if (arr[n]>largest) {
         largest = arr[n];
    }
      arr[i] = largest;
    }

  }
  return arr;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
James Kim
@jameskim1980
Nov 12 2015 18:14
Your #target1 element should have the classes animated‚ shake and btn-primary.
Akaash Vankamamidi
@akaashv92
Nov 12 2015 18:14
can someone tell me what the mistake is?
James Kim
@jameskim1980
Nov 12 2015 18:15
how do you guys share code like that? like it appears in FCC?
with black background
MANNY
@emmanuelpenuel
Nov 12 2015 18:15
@akaashv92 please can tell me what i am doing wrong
Markus Kiili
@Masd925
Nov 12 2015 18:15
@jameskim1980 Try quoting the class names on .addClass methods.
Aleksander Gębicki
@Takumar
Nov 12 2015 18:15
@jameskim1980 use three backticks before and after your code.
Akaash Vankamamidi
@akaashv92
Nov 12 2015 18:16
@emmanuelpenuel can you paste your code again?
James Kim
@jameskim1980
Nov 12 2015 18:16
I did try quoting that didnt help
the backticks didnt work as well
Nicole F.
@gitasong
Nov 12 2015 18:17
Help! Can someone take a question?
CamperBot
@camperbot
Nov 12 2015 18:17
no wiki entry for: can someone take a question
:pencil: click here to create one now!after creating your page type update to reload it here
Akaash Vankamamidi
@akaashv92
Nov 12 2015 18:17
```
Markus Kiili
@Masd925
Nov 12 2015 18:17
@jameskim1980 post code again.
Akaash Vankamamidi
@akaashv92
Nov 12 2015 18:17
this one
Bill
@kirah1314
Nov 12 2015 18:17
help format
CamperBot
@camperbot
Nov 12 2015 18:17

:point_right: code format [wiki]

Inline code

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

Code Block

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

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

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

How to Code

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

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

James Kim
@jameskim1980
Nov 12 2015 18:18
\\<script>
$(document).ready(function() {$("button").addClass(animated);$(".btn").addClass(shake);
$("#target1").addClass(btn-primary).addClass(animated).addClass(animated);
});
</script>\\
Akaash Vankamamidi
@akaashv92
Nov 12 2015 18:19
``` then press shift+ enter
you will find the closing ```
Markus Kiili
@Masd925
Nov 12 2015 18:19
@akaashv92 You should zero the largest at the start of i loop.
Nicole F.
@gitasong
Nov 12 2015 18:19
Can someone take a question?
Akaash Vankamamidi
@akaashv92
Nov 12 2015 18:19
paste the code between that
then ctrl+enter
@Masd925 okay lemme try that
James Kim
@jameskim1980
Nov 12 2015 18:20
Your #target1 element should have the classes animated‚ shake and btn-primary.
  $(document).ready(function() {$("button").addClass(animated);$(".btn").addClass(shake);
  $("#target1").addClass(btn-primary).addClass(animated).addClass(animated);                          
});
</script>
Sree Harsha Subraveti
@gasperno
Nov 12 2015 18:20
@gitasong what is it?
Aleksander Gębicki
@Takumar
Nov 12 2015 18:20
@akaashv92 your array arr has two dimensions, so you should access elements of it like that: arr[i][n];
Also in each iteration start with largest variable set to first element of each subarray: largerst = [i][0];
Nicole F.
@gitasong
Nov 12 2015 18:21
@gasperno Waypoint #191, I believe: Make Object Properties Private.
It's a rewrite from a couple of days ago. There's still a bunch of things that are unexplained--for instance, how to create a function inside of a constructor (we've only been taught how to create properties).
Sree Harsha Subraveti
@gasperno
Nov 12 2015 18:22
@gitasong are you suggesting an edit?
Nicole F.
@gitasong
Nov 12 2015 18:23
I've already suggested it. I need help solving the problem, given the lack of instructions.
James Kim
@jameskim1980
Nov 12 2015 18:23
Thanks guys I figured it out
they did indeed need to all be in quotes
Akaash Vankamamidi
@akaashv92
Nov 12 2015 18:23
@Takumar thanks! i mstill figuring it out
CamperBot
@camperbot
Nov 12 2015 18:23
akaashv92 sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
Sree Harsha Subraveti
@gasperno
Nov 12 2015 18:23
oh okay.
CamperBot
@camperbot
Nov 12 2015 18:23
:star: 707 | @takumar | http://www.freecodecamp.com/takumar
Sree Harsha Subraveti
@gasperno
Nov 12 2015 18:24
@gitasong bring it on.
Aleksander Gębicki
@Takumar
Nov 12 2015 18:24
@akaashv92 One more thing. You cannot write largest value to array "arr" because you work on it. Create new temporary array for saving largest values from each subarray.
Sree Harsha Subraveti
@gasperno
Nov 12 2015 18:25
@gitasong give me a moment.. I am reading what the question is
Akaash Vankamamidi
@akaashv92
Nov 12 2015 18:25
function largestOfFour(arr) {
  // You can do this!

  for(var i=0; i < arr.length; i++){

    for(var n=0;n < arr[i].length; n++){
       var largest = 0;
      if (arr[i][n]>largest) {

         largest = arr[i][n];
    }
      arr[i] = largest;
    }

  }
  return arr;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
i did this
and it worls only for the given values
oh no, its taking only the first value of each sub array
Sree Harsha Subraveti
@gasperno
Nov 12 2015 18:26
@gitasong did you try something?
Nicole F.
@gitasong
Nov 12 2015 18:26
@gasperno I tried several things. I have no idea what I'm doing, because there have been no instructions for how to do this.
Apparently, we're supposed to intuit the syntax from the universe.
Sree Harsha Subraveti
@gasperno
Nov 12 2015 18:27
@gitasong there are two types of properties. 1) that are available to access from outside the object.(also known as public) and 2) that are restricted to access from within the object(private)
Nicole F.
@gitasong
Nov 12 2015 18:27
I get that part. We're constructing methods here, not properties.
Logan Jones
@nagol2012
Nov 12 2015 18:28
I am getting a error from a line of code that came standard and is below the "do not change" line. what is wrong with this? (function() {return newArray;})()
Aleksander Gębicki
@Takumar
Nov 12 2015 18:30
@akaashv92 I prefer not to set largest variable to 0. What if you get as parameters subarray [-2, -14,-6, -234928347] ? 0 will become largest value although it doesn't exist in subarray.
Markus Kiili
@Masd925
Nov 12 2015 18:30
@akaashv92 This works:
function largestOfFour(arr) {

  for(var i=0; i < arr.length; i++){
    var largest = 0;
    for(var n=0;n < arr[i].length; n++){
       if (arr[i][n]>largest) {
         largest = arr[i][n];
       }
     }
     arr[i] = largest;
  }
  return arr;
}
Sree Harsha Subraveti
@gasperno
Nov 12 2015 18:31
@gitasong can you paste the code here.
Markus Kiili
@Masd925
Nov 12 2015 18:31
@akaashv92 and Takumar is right.
Mike G.
@mgraham134
Nov 12 2015 18:31
 var oldArray = [1,2,3,4,5];
// Only change code below this line.
var newArray = oldArray;

var addThree = oldArray.map(function(val) {
  return array + 3;

});


// Only change code above this line.

(function() {return newArray;})();
Do you guys know what the issue is here?
Akaash Vankamamidi
@akaashv92
Nov 12 2015 18:32
thanks @Masd925 @Takumar
CamperBot
@camperbot
Nov 12 2015 18:32
akaashv92 sends brownie points to @masd925 and @takumar :sparkles: :thumbsup: :sparkles:
:warning: akaashv92 already gave takumar points
:star: 284 | @masd925 | http://www.freecodecamp.com/masd925
Aleksander Gębicki
@Takumar
Nov 12 2015 18:33
@Masd925 it doesn't work, because @akaashv92 is modifying array "arr" on which he still works!
AYE EVANS
@ignorantusguru
Nov 12 2015 18:33
@Avrozavr was an angel, @Takumar do you know of any resource for basic and simplified JavaScript before I can proceed with the Fcc's
Akaash Vankamamidi
@akaashv92
Nov 12 2015 18:33
yes im trying to save it into another array
Markus Kiili
@Masd925
Nov 12 2015 18:34
@Takumar @akaashv92 code is looping over indices, so it can change arr values during the loop.
Aleksander Gębicki
@Takumar
Nov 12 2015 18:34
@akaashv92 I wrote you earlier: :point_up: 12 listopada 2015 19:24
Alexander Køpke
@alexanderkopke
Nov 12 2015 18:34

@mgraham134 ``` var array = [1,2,3,4,5];

array = array.map(function(val){
return val + 3;
});```

Nicole F.
@gitasong
Nov 12 2015 18:34
var Car =