These are chat archives for FreeCodeCamp/Help

14th
Nov 2015
Jonathan
@jonathantimm
Nov 14 2015 00:16
Anyone know how I can get my waypoint numbers corrected?
I started FCC early but have started over a couple times, and as a result it looks like I've done 263 challenges, which can't be accurate hehe
Craig Morrison
@frogmorton
Nov 14 2015 00:25
@jonathantimm those are brownies, aren't they?
Jonathan
@jonathantimm
Nov 14 2015 00:28
i guess so, i'm just realizing that @frogmorton
so i guess i want to keep them? hah
Jonathan
@jonathantimm
Nov 14 2015 00:46
Anyone able to explain the difference between arrays and indexes?
Hong Keun Kim
@HenryKim23
Nov 14 2015 00:48
hi there i don't understand what is this means..Be sure to delete all trailing comment tags, i.e. -->.
Akshat Oswal
@akshat01
Nov 14 2015 00:50
I am working on the palindrome detection bon fire. If I know the logic right, I would remove spaces and punctuations, reverse the string and then compare
Can someone help me understand how to remove punctuations? I managed to remove spaces
Jonathan
@jonathantimm
Nov 14 2015 00:51
@HenryKim23 comments start with <!-- and end with -->
so it's just saying, look for the trailing tags, like -->, and delete them
if you want to tell me what challenge you're on, i'll look at it
mariocatch
@mariocatch
Nov 14 2015 00:53
@HenryKim23
<!-- This is a comment in HTML -->
<h1>Hello, world</h1>

<!-- 
  This is another comment.
  It spans multiple lines.
-->
<h2>Foobar</h2>
Akshat Oswal
@akshat01
Nov 14 2015 00:56
?
anyone wants to join me on the Palindrome bonfire?
Jonathan
@jonathantimm
Nov 14 2015 00:58
@mariocatch you're less lazy than i am :-)
Michael Lefkowitz
@lfkwtz
Nov 14 2015 00:58
This message was deleted
DJ
@qualitymanifest
Nov 14 2015 00:59
@akshat01 might want to try https://gitter.im/FreeCodeCamp/LetsPair
@akshat01 otherwise just give it a try and if you get stuck post your code here
@qualitymanifest nevermind i just saw what you wrote above. just post your code and i'll try to give some advice
Akshat Oswal
@akshat01
Nov 14 2015 01:01
@qualitymanifest Thanks. Posted there.
I am not sure how to write the regex.
probably need to go back a few waypoints again
Sylva
@sylvalynn
Nov 14 2015 01:04
What's an i element for?
Without being too lazy, MDN has everything you'd need to know about questions like that.
DJ
@qualitymanifest
Nov 14 2015 01:05
@akshat01 i wouldn't go back on waypoints, just check out some docs, i like http://www.w3schools.com/jsref/jsref_obj_regexp.asp
Sylva
@sylvalynn
Nov 14 2015 01:05
Yay! This is why i asked: I know w3 schools, but now I know about MDN tooo!
DJ
@qualitymanifest
Nov 14 2015 01:06
@akshat01 if you go to that scroll down to "metacharacters", some nice options there
Sylva
@sylvalynn
Nov 14 2015 01:06
You guys are the best; thanks @qualitymanifest
CamperBot
@camperbot
Nov 14 2015 01:06
sylvalynn sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 374 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
DJ
@qualitymanifest
Nov 14 2015 01:06
@sylvalynn no problem - but it was actually @mariocatch :wink2:
Sylva
@sylvalynn
Nov 14 2015 01:07
Oops. Got confused reading
Thanks @mariocatch
CamperBot
@camperbot
Nov 14 2015 01:07
sylvalynn sends brownie points to @mariocatch :sparkles: :thumbsup: :sparkles:
:star: 34 | @mariocatch | http://www.freecodecamp.com/mariocatch
Sylva
@sylvalynn
Nov 14 2015 01:09
I always knew i for italic, but didn't understand why the waypoint was having me use it for font awesome. It makes sense that it's more any text that is set off, and that it would be useful in that it allows classes, being an element and all
I'm new to code camp as of yesterday and overall am pretty impressed at the pacing - this is the first question I've had, and other than the endless color changing, it seems to trust the camper to pick things up pretty quickly.
mariocatch
@mariocatch
Nov 14 2015 01:11
@sylvalynn Best answer to the question that I've seen yet: http://stackoverflow.com/a/11135302/449688

To quote the perfect answer to why <i> is used for icons in a lot of CSS frameworks:

Awful practice. It is a triumph of performance over semantics.

We've just accepted it as a standard because it is convenient, not because it is semantically correct.
Sylva
@sylvalynn
Nov 14 2015 01:12
Ah. So in a sense I was right to question this use?
mariocatch
@mariocatch
Nov 14 2015 01:12
yep :) great curiosity for sure
Manish Giri
@Manish-Giri
Nov 14 2015 01:12
Hey there, fellow coders
need some help with a bonfire
CamperBot
@camperbot
Nov 14 2015 01:12
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Sylva
@sylvalynn
Nov 14 2015 01:12
Hi @Manish-Giri
I'm not there yet, but good luck!
Hong Keun Kim
@HenryKim23
Nov 14 2015 01:14
@jonathantimm THANKS for the help but still this
CamperBot
@camperbot
Nov 14 2015 01:14
henrykim23 sends brownie points to @jonathantimm :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for jonathantimm
Hong Keun Kim
@HenryKim23
Nov 14 2015 01:15
Be sure to delete all trailing comment tags, i.e. -->. is NOT PASSED
Manish Giri
@Manish-Giri
Nov 14 2015 01:15
@sylvalynn Thanks! Good luck to you too!
CamperBot
@camperbot
Nov 14 2015 01:15
manish-giri sends brownie points to @sylvalynn :sparkles: :thumbsup: :sparkles:
:star: 89 | @sylvalynn | http://www.freecodecamp.com/sylvalynn
Christine Cole
@netwerk19
Nov 14 2015 01:32
Okay, noob hint of the day: read the instructions CAREFULLY. I spent hours trying to apply a class to the wrong buttons on my app. It said RADIO buttons, stupid....bangs head on table
DJ
@qualitymanifest
Nov 14 2015 01:33
@netwerk19 i've seen a ton of people make that mistake on that waypoint
Christine Cole
@netwerk19
Nov 14 2015 01:33
AAAAAAAAAHHHHHH...........!!!!!!!
DJ
@qualitymanifest
Nov 14 2015 01:35
real noob hint: if you get that stuck on a waypoint just come onto the chat and post your code. you'll probably be pointed in the right direction within a couple minutes. :wink2:
Christine Cole
@netwerk19
Nov 14 2015 01:36
Yes, but I decided I was going to figure this one out by myself. Silly me.
@qualitymanifest thanks
CamperBot
@camperbot
Nov 14 2015 01:36
netwerk19 sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 375 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Zai Xeno
@removed~zaixeno
Nov 14 2015 01:42
Even after so many tutorials, what is the best way to get started? I still feel like as if I don't even know where to start or what to do once i don't have tutorials telling me what to do
Brian van Vlymen
@arduino731
Nov 14 2015 01:50
waypoint-filter arrays with filter
mariocatch
@mariocatch
Nov 14 2015 01:50
@zaixeno did you try starting at the beginning of free code camp?
Brian van Vlymen
@arduino731
Nov 14 2015 01:51
var newArray = oldArray.filter(function(f){
  for(f = 0; f < 5; f++){
   return f += f;  
  }
});
The output is []
why its empty array? it seems not working that way.
Herman Fassett
@HermanFassett
Nov 14 2015 01:51
filter should return true or false
Are you thinking map?
Brian van Vlymen
@arduino731
Nov 14 2015 01:52
f.map.filter()?
will it work that way?
Herman Fassett
@HermanFassett
Nov 14 2015 01:53
oldArray.map()?
Brian van Vlymen
@arduino731
Nov 14 2015 01:53
yes .map().filter()?
or .map(fitler())? its an async
Herman Fassett
@HermanFassett
Nov 14 2015 01:55
Oh you're on a waypoint my bad you shouldn't use map, but should relook how to use filter
Brian van Vlymen
@arduino731
Nov 14 2015 01:55
yes lol its on a waypoint array with filter
Herman Fassett
@HermanFassett
Nov 14 2015 01:56
Yeah your return should be a boolean
Brian van Vlymen
@arduino731
Nov 14 2015 01:57
how it work make it true that are grater than 5?
Herman Fassett
@HermanFassett
Nov 14 2015 01:57
If it's true, the value is left in the array so you want it false for greater than 5
Brian van Vlymen
@arduino731
Nov 14 2015 01:59
correct it keep which is true however could be like this
```
return boolean
return  true
Herman Fassett
@HermanFassett
Nov 14 2015 01:59
If you simply have return true all values will be left

If you say had

var newArray = oldArray.filter(function(val) {
    return val > 5;
});

That would keep all values in the array that are greater than 5

Brian van Vlymen
@arduino731
Nov 14 2015 02:01
cant be other way using for loop statement?
Herman Fassett
@HermanFassett
Nov 14 2015 02:01
No because that returns a value not a boolean
Brian van Vlymen
@arduino731
Nov 14 2015 02:02
return for(f = 0; f > 5; f++){
return true;
okay thats strange
Herman Fassett
@HermanFassett
Nov 14 2015 02:02
There's no need for a for loop
Copy my :point_up: example to instead return if it's less than 6
Brian van Vlymen
@arduino731
Nov 14 2015 02:04
I am not use to return with out the parameter like that
Herman Fassett
@HermanFassett
Nov 14 2015 02:04
Ok
Let me show a different way
var newArray = oldArray.filter(function(val) {
  if (val > 5) {
    return true;
  }
});
Will filter out any values less than or equal to 5
Brian van Vlymen
@arduino731
Nov 14 2015 02:07
oh thats better!! it makes much sense now i like to see the if I did not think
"If"
Herman Fassett
@HermanFassett
Nov 14 2015 02:07
Yeah, so you can replace the val > 5 with an expression that checks if val is less than 6
Brian van Vlymen
@arduino731
Nov 14 2015 02:07
duh me lol
Manish Giri
@Manish-Giri
Nov 14 2015 02:08
can someone tell me how to debug JS code directly in Chrome Dev Tools without a "source file"
Brian van Vlymen
@arduino731
Nov 14 2015 02:08
@HermanFassett indeed thanks for the tips!
CamperBot
@camperbot
Nov 14 2015 02:08
ironheartbj18 sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 598 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Manish Giri
@Manish-Giri
Nov 14 2015 02:08
I know I've to go under the "sources" tab, but can't figure out how to reach the JS I wrote in the "console" tab earlier from here
Herman Fassett
@HermanFassett
Nov 14 2015 02:09
Sources has sources for the page you're on @Manish-Giri
Manish Giri
@Manish-Giri
Nov 14 2015 02:10
@HermanFassett I'm just in a blank "new tab"
where I entered the JS in the "console"
Herman Fassett
@HermanFassett
Nov 14 2015 02:11
New tab has its own code though
Manish Giri
@Manish-Giri
Nov 14 2015 02:11
is there any way to debug this code without having to put in a JS file
Herman Fassett
@HermanFassett
Nov 14 2015 02:12
@Manish-Giri you can do a snippet
eg
Right click in snippets tab to create new snippet
Manish Giri
@Manish-Giri
Nov 14 2015 02:13
got it! Thanks a ton!
now to debug this thing
guess I just need to click on the left gutter
Herman Fassett
@HermanFassett
Nov 14 2015 02:13
;)
Manish Giri
@Manish-Giri
Nov 14 2015 02:17
damn it I've got to learn Reg Ex
life it just too complicated without it
Jessica Davis
@jessieinsidecode
Nov 14 2015 02:18
hello, everyone! Have not been on here in a few weeks!
Brian van Vlymen
@arduino731
Nov 14 2015 02:24
hint sort array
CamperBot
@camperbot
Nov 14 2015 02:24
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
mariocatch
@mariocatch
Nov 14 2015 02:24
@jessieinsidecode hello
Jessica Davis
@jessieinsidecode
Nov 14 2015 02:25
``
var ourArray = [1,2,3];
ourArray[1] = 3;
// ourArray[1] now equals [1,3,3].
var myArray = [1,2,3];
// Only change code below this line.
var myArray = [3,2,3];
 myArray[3] =3;




// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
// You'll learn about functions soon.
if(typeof(myArray) !== "undefined"){(function(){return myArray;})();}
```
Need help with this one
mariocatch
@mariocatch
Nov 14 2015 02:27
@jessieinsidecode what type of help?
Jessica Davis
@jessieinsidecode
Nov 14 2015 02:27
It says: "You should be using correct index to modify the value in myArray.
That's all I need to figure out then I can go to the next one!
mariocatch
@mariocatch
Nov 14 2015 02:28
what do you need to do specifically?
Brian van Vlymen
@arduino731
Nov 14 2015 02:29
which one assign to index array
Manish Giri
@Manish-Giri
Nov 14 2015 02:29
@jessieinsidecode array indexes are 0 based.
Jessica Davis
@jessieinsidecode
Nov 14 2015 02:30
If you look under the second comment that part is correct but I still have a red X next to this : "You should be using correct index to modify the value in myArray."
Manish Giri
@Manish-Giri
Nov 14 2015 02:30
myArray has three integers, at positions 0,1,2. You're trying to access myArray[3] - something which doesn't exist
Jessica Davis
@jessieinsidecode
Nov 14 2015 02:30
so I don't know what I need to put in next
mariocatch
@mariocatch
Nov 14 2015 02:30
@jessieinsidecode yes but we can't see the entire question.
@jessieinsidecode that question/remaining task isn't enough to help you on
Brian van Vlymen
@arduino731
Nov 14 2015 02:31
which one waypoint are you working on @jessieinsidecode
Jessica Davis
@jessieinsidecode
Nov 14 2015 02:31
Waypoint: Modify Array Data With Indexes @ironheartbj18
mariocatch
@mariocatch
Nov 14 2015 02:32
@jessieinsidecode look at the code in the waypoint, and look at what you pasted.
@jessieinsidecode you broke one of the rules, you added code where you shouldhn't have
@jessieinsidecode you re-wrote the array they already gave you
Jessica Davis
@jessieinsidecode
Nov 14 2015 02:33
hmmm i will go back and figure it out thanks
Brian van Vlymen
@arduino731
Nov 14 2015 02:34
var myArray = [3,2,3];
 myArray[3] =3;
you will want change your index . the first one index is number 0 , the next index is number 1 so on.
array = array.sort(function(a, b){
  return a.length < b.length;
});
the output is var array = ['beta', 'alpha', 'charlie'];
what is the question really want?
Manish Giri
@Manish-Giri
Nov 14 2015 02:37
@ironheartbj18 You've to sort the array from largest -> smallest
mariocatch
@mariocatch
Nov 14 2015 02:37
@ironheartbj18 length is used to get the number of elements in an array
@ironheartbj18 you won't need length for this exercise.
Manish Giri
@Manish-Giri
Nov 14 2015 02:37
they've already provided the way to do it for small -> large
just reverse it for large -> small
Jessica Davis
@jessieinsidecode
Nov 14 2015 02:39
var ourArray = [1,2,3]; ourArray[1] = 3; // ourArray[1] now equals [1,3,3]. var myArray = [1,2,3]; // Only change code below this line. var myArray = [3, 2, 3]; myArray[0] =3;
i did it lol I swear but reading the directions and trial and error
moving on! Thanks yall
Brian van Vlymen
@arduino731
Nov 14 2015 02:39
can you tell me what means largest to smallest ? longest word to smallest word ?
Manish Giri
@Manish-Giri
Nov 14 2015 02:45
in the original question, the ordering means largest number -> smallest number
the compare function they've used works for numbers. Since you've modified the array to hold strings, you've got to provide your own sorting logic for sorting largest -> smallest
Brian van Vlymen
@arduino731
Nov 14 2015 02:47
using the unicode-table.com number ?
Tiffany L.
@tlanderstx
Nov 14 2015 02:48
Thank you. @Takumar !
CamperBot
@camperbot
Nov 14 2015 02:48
tlanderstx sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 739 | @takumar | http://www.freecodecamp.com/takumar
Brian van Vlymen
@arduino731
Nov 14 2015 02:50
var array = ['beta', 'alpha', 'charlie'];

array = array.sort(function(a , b){
  return a < b;
});
the output is [ 'charlie','beta', 'alpha',]
thats making largest to smallest of unicode-table
mariocatch
@mariocatch
Nov 14 2015 02:52
@ironheartbj18 a < b returns either true or false. sort's function parameter supports return values of less than 0, greater than 0, or 0 itself.
Tara Thierry
@TaraT1
Nov 14 2015 02:55
@Mamacom Thanks so much! It worked.
Brian van Vlymen
@arduino731
Nov 14 2015 02:56
i see, what is the output expected?
Manish Giri
@Manish-Giri
Nov 14 2015 02:56
how to remove punctuation from strings, anyone?
Brian van Vlymen
@arduino731
Nov 14 2015 02:57
opps
mariocatch
@mariocatch
Nov 14 2015 02:57
@Manish-Giri regex :)
Manish Giri
@Manish-Giri
Nov 14 2015 02:57
crap
Brian van Vlymen
@arduino731
Nov 14 2015 02:57
I just reset to clear up my code and the code had changed!
Manish Giri
@Manish-Giri
Nov 14 2015 02:57
good place to learn regex?
mdn?
Sylva
@sylvalynn
Nov 14 2015 02:58

I'm getting a 504 Gateway Time-out

nginx/1.4.6 (Ubuntu)

CamperBot
@camperbot
Nov 14 2015 02:58
tarat1 sends brownie points to @mamacom :sparkles: :thumbsup: :sparkles:
:star: 172 | @mamacom | http://www.freecodecamp.com/mamacom
Brian van Vlymen
@arduino731
Nov 14 2015 02:58
/.+/gi yes MDN @Manish-Giri
Sylva
@sylvalynn
Nov 14 2015 02:59
Seems to have resolved. Hmmm
Manish Giri
@Manish-Giri
Nov 14 2015 03:00
is there an inbuilt JS debugger in Safari?
mariocatch
@mariocatch
Nov 14 2015 03:01
@Manish-Giri stackoverflow is good, if you can type specific questions
Manish Giri
@Manish-Giri
Nov 14 2015 03:04
sadly, I'll get beat down for asking this question in SO
mariocatch
@mariocatch
Nov 14 2015 03:04
@Manish-Giri you don't have to ask the question - it's probably already been asked
Brian van Vlymen
@arduino731
Nov 14 2015 03:11
I have stupid question when using the method reverse() why there is not need to put the "reverse(function(a){}" inside the function of the method not same the other like the arrays sort and filter ?
reverse(function(a){return}
reverse();
```
reverse();
reverse();
what difference?
same?
Manish Giri
@Manish-Giri
Nov 14 2015 03:13
@mariocatch has there been a lesson on Reg Exps that I've missed? Before the bonfires algorithm scripting, I mean.
mariocatch
@mariocatch
Nov 14 2015 03:15
@Manish-Giri i haven't done any fcc. just here because i'm a web developer who enjoys helping others learn.
bobmarley210
@bobmarley210
Nov 14 2015 03:16
hey guys
DJ
@qualitymanifest
Nov 14 2015 03:16
This message was deleted
Brian van Vlymen
@arduino731
Nov 14 2015 03:16
@qualitymanifest AFAIK?
Matt Yamamoto
@MattYamamoto
Nov 14 2015 03:16
@ironheartbj18 If I understand you correctly, you're asking why you don't need to put a function inside the call to the reverse method? That's because the reverse method does not take a callback function. Just how the method is defined.
DJ
@qualitymanifest
Nov 14 2015 03:16
@ironheartbj18 as far as i know
bobmarley210
@bobmarley210
Nov 14 2015 03:16
would anyone like to skype call and help me learn to code
mariocatch
@mariocatch
Nov 14 2015 03:18
@bobmarley210 ask specific questions that you have here instead
bobmarley210
@bobmarley210
Nov 14 2015 03:19
whats a red text class
mariocatch
@mariocatch
Nov 14 2015 03:19
it's a class called red
the fcc explains what classes are and why they're used. and google searches go into great detail about what a class is, such as in stackoverflow or MDN
bobmarley210
@bobmarley210
Nov 14 2015 03:19
Well im confused on this part
Your h2 element should have the class red-text.
Your stylesheet should declare a red-text class and have its color set to red.
Brian van Vlymen
@arduino731
Nov 14 2015 03:20

@MattYamamoto ahh, Does we still call the method if its inside the function? for example

filter(function(a){});

what we called for filter ? a method?

Manish Giri
@Manish-Giri
Nov 14 2015 03:20
@mariocatch Okay mate, sorry for bugging ya!
Brian van Vlymen
@arduino731
Nov 14 2015 03:21
filter does have callback
Matt Yamamoto
@MattYamamoto
Nov 14 2015 03:22
@ironheartbj18 go check out the MDN page for each of those methods, and near the top the page it will tell you what parameters that particular method takes.
Brian van Vlymen
@arduino731
Nov 14 2015 03:24
awesome, we still call those methods as long check MDN page
Manish Giri
@Manish-Giri
Nov 14 2015 03:26

@bobmarley210 : <h2 class="red-text">...</h2>

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

Brian van Vlymen
@arduino731
Nov 14 2015 03:28
@Manish-Giri forget add <style>
opps @bobmarley210
bobmarley210
@bobmarley210
Nov 14 2015 03:52
I need help with this code
Hans van Riet
@hansinla
Nov 14 2015 03:59
@bobmarley210 What do you have so far?
Tiffany White
@twhite96
Nov 14 2015 04:01
Need some help with the Filter Waypoint
Here is my code

```var oldArray = [1,2,3,4,5,6,7,8,9,10];

// Only change code below this line.

var newArray = oldArray.filter(function(array) {
return array > 5;
});

// Only change code above this line.

(function() { return newArray; })();```

echames
@echames
Nov 14 2015 04:02
What is an i element? i feel like i missed something... i thought it was an inline element so i wrote a <span class="...> etc but that didn't work
Hans van Riet
@hansinla
Nov 14 2015 04:02
@twhite96 Are you sure you want to keep all value >5? Or all values <6
Tiffany White
@twhite96
Nov 14 2015 04:03
That might work better. Thanks @hansinla
CamperBot
@camperbot
Nov 14 2015 04:03
twhite96 sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 578 | @hansinla | http://www.freecodecamp.com/hansinla
echames
@echames
Nov 14 2015 04:04
Ive gotten the thumbs up showing, but i can't advance
<button class="btn btn-block btn-primary">Like <span class="fa fa-thumbs-up"></span></button>
Hans van Riet
@hansinla
Nov 14 2015 04:05
@twhite96 No problem. You should consider using a different name than array in your callback function, because each element is passed one at a time, so it’s not an array. x would suffice.
Brian van Vlymen
@arduino731
Nov 14 2015 04:14
what is using for regex to remove punctuation?
Alem
@alemneh
Nov 14 2015 04:15

I am trying to access the openweather api and its not working I get a error Uncaught ReferenceError: $getJSON is not defined
`
<!DOCTYPE>

<html ln="en">

<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
</head>

<body>

<div id="data">

    <button id="btn">Get location</button>

</div>

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

$('#btn').on("click", function() {
    $getJSON("http://api.openweathermap.org/data/2.5/forecast/city?id=524901&APPID=4863a1dc9f6152edf32a500e946de69d", function(json) { 
        $('#data').html(JSON.stringify(json)); 
    });
});

});

</script>
</body>
</html>
`

Brian van Vlymen
@arduino731
Nov 14 2015 04:15
replace([\.] /g, "");
how to remove punctuation?
Hans van Riet
@hansinla
Nov 14 2015 04:27
@alemneh $.getJSON
Alem
@alemneh
Nov 14 2015 04:30
@hansinla thanks it worked
CamperBot
@camperbot
Nov 14 2015 04:30
alemneh sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 579 | @hansinla | http://www.freecodecamp.com/hansinla
Hans van Riet
@hansinla
Nov 14 2015 04:32

@ironheartbj18

str = str.replace(/[^\w\s]|_/g, “").replace(/\s+/g, “ ");

Removes everything except alphanumeric characters and whitespace, then collapses multiple adjacent characters to single spaces. if you want to get rid of whitespace as well as punctuation (for example for palindrome challenge), then this would do:

replace(/[^a-z^0-9]/g, "”);
@alemneh no prob
Ian Barker
@IanBarkerDev
Nov 14 2015 04:35
Gotta checkbox that refuses to be on the same line as my label ...
Hans van Riet
@hansinla
Nov 14 2015 04:43
@Malical Can you show your code?
Brian van Vlymen
@arduino731
Nov 14 2015 04:58
thanks @hansinla
CamperBot
@camperbot
Nov 14 2015 04:58
ironheartbj18 sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 580 | @hansinla | http://www.freecodecamp.com/hansinla
Manish Giri
@Manish-Giri
Nov 14 2015 05:11
my gitter desktop(windows) app isn't working
Jazmine
@medusanxs
Nov 14 2015 05:11
I'm sorry to hear that.
Manish Giri
@Manish-Giri
Nov 14 2015 05:11
it opens in the tray thing, but doesn't open full-screen. Notifications do come.
any suggestions?
Jazmine
@medusanxs
Nov 14 2015 05:12
Perhaps you should try reinstalling? Or check the gitter support.
Manish Giri
@Manish-Giri
Nov 14 2015 05:12
:worried:
guess it's just Windows sucking again
Joel M. Swensen
@JoelMSwensen
Nov 14 2015 05:16
Woops, posted in the wrong channel
was seeing if anyone might know why these colors won’t toggle
$( document ).ready(function() {
$("input").click(function(){



   $(this).css("background-color","lime");
   setTimeout(function(){
     // toggle back after 1 second
     $(this).css("background-color","blue");
   },1000);



 });
});
arunsraj91
@arunsraj91
Nov 14 2015 05:19
In boolean values section! What to put in the console screen to excecute the function

Here: function welcomeToBooleans() {

// Only change code below this line.

return false;

// Only change code above this line.
}

Could anyone help me please!
Jazmine
@medusanxs
Nov 14 2015 05:22
What have you tried, @arunsraj91 ?
Joel M. Swensen
@JoelMSwensen
Nov 14 2015 05:28
@arunsraj91 the question is asking you to make it return true
right now it’s returning false
Hans van Riet
@hansinla
Nov 14 2015 05:29
@JoelMSwensen My guess is that this in your timeout function is not what you think it is because of scope.
Joel M. Swensen
@JoelMSwensen
Nov 14 2015 05:29
@hansinla well the first part of it works, it does change to lime, just not back again
xenderx
@vignesh6497
Nov 14 2015 05:30
Can someone tell me how to allign text in the center of the page
Hans van Riet
@hansinla
Nov 14 2015 05:31
@JoelMSwensen Exactly because this in your callback is not the same this as in your click function. The scope changed
Manish Giri
@Manish-Giri
Nov 14 2015 05:31
@vignesh6497 : text-align:center
for fixed-width elements, try margin: 0 auto instead
Joel M. Swensen
@JoelMSwensen
Nov 14 2015 05:33
@hansinla DOH! Thank you :)
CamperBot
@camperbot
Nov 14 2015 05:33
joelmswensen sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 581 | @hansinla | http://www.freecodecamp.com/hansinla
JND14
@JND14
Nov 14 2015 05:33

Hello, could someone help me size my images? I have substituted "smaller-image and 100 px for the original text <style>

.larger-image {

width: 500px;

}

</style> in my code editor but nothing has changed

xenderx
@vignesh6497
Nov 14 2015 05:33
@Manish-Giri thx bro
CamperBot
@camperbot
Nov 14 2015 05:33
vignesh6497 sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star: 203 | @manish-giri | http://www.freecodecamp.com/manish-giri
Joel M. Swensen
@JoelMSwensen
Nov 14 2015 05:34
@hansinla good lord I was stuck on that for way too long
Hans van Riet
@hansinla
Nov 14 2015 05:35
@JND14 did you change the class name in your <img> tag
@JoelMSwensen no problem
Jazmine
@medusanxs
Nov 14 2015 05:35
@JoelMSwensen ^
Oops. lol
@JND14 ^
Joel M. Swensen
@JoelMSwensen
Nov 14 2015 05:35
haha
Linda Souvannarith
@Lindasixonetwo
Nov 14 2015 05:36
Can someone help me I am stuck
Hans van Riet
@hansinla
Nov 14 2015 05:36
@Lindasixonetwo Sure
Linda Souvannarith
@Lindasixonetwo
Nov 14 2015 05:36
<div class="container-fluid">
<h3 class="text-primary text-center">jQuery Playground</h3>
<div class="col-xs-6">
<div class="row">
<div class="well"></div>
</div>
<div class="col-xs-6">
<div class="well"></div>
</div>
</div>
<div class="row">
<div class="col-xs-6">
</div>
<div class="col-xs-6">
</div>
</div>
</div>
that is my code
Add a div element with the class well inside each of your div elements with the class "col-xs-6"
and that is where im stuck
Manish Giri
@Manish-Giri
Nov 14 2015 05:37
can anyone help me understand the concept of "Prototype"
For instance, the syntax: String.prototype.split()
Hans van Riet
@hansinla
Nov 14 2015 05:37
This message was deleted
Manish Giri
@Manish-Giri
Nov 14 2015 05:37
or Array.prototype.reverse()
Brian van Vlymen
@arduino731
Nov 14 2015 05:39
Specifies the function that creates an object's prototype.
The prototype property allows you to add properties and methods to an object.
Hans van Riet
@hansinla
Nov 14 2015 05:40

@Lindasixonetwo

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

Remember to nest the <div> s

JND14
@JND14
Nov 14 2015 05:41

@hansinla I did. Is this the correct format? <img class=.smaller-image src="https://bit.ly/fcc-relaxing-cat"/>

<style>

.smaller-image {

width: 100px;

}

</style>

Hans van Riet
@hansinla
Nov 14 2015 05:42
@JND14 You forgot quotation marks. See my example above for Linda.
Bill
@kirah1314
Nov 14 2015 05:43
@JND14 the class should have quotes and no period
xenderx
@vignesh6497
Nov 14 2015 05:44
@JND14 the period are used while defining class in the style block
Linda Souvannarith
@Lindasixonetwo
Nov 14 2015 05:45
@hansinla it is not working for me
Hans van Riet
@hansinla
Nov 14 2015 05:45
@Lindasixonetwo You need to do it twice, because there are two divs that have the “col-xs-6” class. Post your new code and remember to nest the divs
CamperBot
@camperbot
Nov 14 2015 05:50
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Manish Giri
@Manish-Giri
Nov 14 2015 05:50
what's a Zipline in FCC
Brian van Vlymen
@arduino731
Nov 14 2015 05:51
function findLongestWord(str) {

  str = str.split(" ");
  str = str.length;
  return str;
}

findLongestWord.filter(function(a){
  if(a <= 2){
    return true;
  }
});
Bill
@kirah1314
Nov 14 2015 05:51
help zipline
CamperBot
@camperbot
Nov 14 2015 05:51

:point_right: zipline use the twitchtv json api [wiki]

If you're trying to tackle this challenge with jQuery's $.getJSON() method, chances are you'll get an error message concerning Cross-Origin Resource Sharing (CORS).

The easiest way to resolve this is to use jQuery's JSONP capabilities. From the Twitch API's readme page:

All API methods support JSON-P by providing a callback parameter with the request.

Also the jQuery documentation states:

If the URL includes the string "callback=?" (or similar, as defined by the server-side API), the request is treated as JSONP instead.

Here's an example call to fetch Free Code Camp's Twitch channel data:

$.getJSON('https://api.twitch.tv/kraken/streams/freecodecamp?callback=?', function(data) {
  console.log(data);
});

JSONP is considered insecure according to Wikipedia, but should be sufficient for our purposes. For a detailed discussion on Twitch's CORS restriction, please read justintv/Twitch-API#133 on the Twitch-API repository.
:pencil: read more about zipline use the twitchtv json api on the FCC Wiki

Hans van Riet
@hansinla
Nov 14 2015 05:52

@ironheartbj18 You need to keep track of the longest word, so if you hard-code

 if(a <= 2)

that’s not going to work. Work this problem out on paper first and see why it fails with your code. Furthermore; .filter can not be used on a function like that. .filter is a method that can be used on arrays, so you could apply it to the argument of your function.

JND14
@JND14
Nov 14 2015 05:53
@hansinla @vignesh6497 @kirah1314 thank you!
CamperBot
@camperbot
Nov 14 2015 05:53
jnd14 sends brownie points to @hansinla and @vignesh6497 and @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 107 | @vignesh6497 | http://www.freecodecamp.com/vignesh6497
:star: 582 | @hansinla | http://www.freecodecamp.com/hansinla
:star: 329 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Linda Souvannarith
@Lindasixonetwo
Nov 14 2015 05:59
@hansinla thanks!
CamperBot
@camperbot
Nov 14 2015 05:59
lindasixonetwo sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 583 | @hansinla | http://www.freecodecamp.com/hansinla
Brian van Vlymen
@arduino731
Nov 14 2015 06:02
filter can read the array and if its true and it will keep it. How could to after the split method and then length method into array?
Manish Giri
@Manish-Giri
Nov 14 2015 06:02
is there a for..in structure in JS (similar to Python) that can be used on things other than objects?
like arrays.
Nathan
@terakilobyte
Nov 14 2015 06:03
why would for...in not work on arrays?
Hans van Riet
@hansinla
Nov 14 2015 06:04
@Manish-Giri Yes, it’s called .forEach
Manish Giri
@Manish-Giri
Nov 14 2015 06:05
how's it different from .map()
beastlymoo
@beastlymoo
Nov 14 2015 06:05
hey can anyone help me?
Nathan
@terakilobyte
Nov 14 2015 06:05
map returns a new array
Manish Giri
@Manish-Giri
Nov 14 2015 06:05
ah I see
Nathan
@terakilobyte
Nov 14 2015 06:05
.forEach just iterates the array
beastlymoo
@beastlymoo
Nov 14 2015 06:05
I'm trying to get the cat pic down to 100 px
Manish Giri
@Manish-Giri
Nov 14 2015 06:05
awesome
Nathan
@terakilobyte
Nov 14 2015 06:05
you can use for..in on arrays too
Hans van Riet
@hansinla
Nov 14 2015 06:05
@Manish-Giri map returns a changed array, foreach iterates over the array with a callback function.
Nathan
@terakilobyte
Nov 14 2015 06:05
it will iterate as expected
map does not change the array @hansinla
it returns a new array
Hans van Riet
@hansinla
Nov 14 2015 06:06
@terakilobyte corrected
Brian van Vlymen
@arduino731
Nov 14 2015 06:07
ok when doing the array for filter does it required to be array from the split and map both methods?
Manish Giri
@Manish-Giri
Nov 14 2015 06:07
@terakilobyte : what am I doing wrong here?
function largestOfFour(arr) {
  // You can do this!
  var firstArr = [];
  firstArr.push(arr.forEach(findLargestNum(arr)));
  return arr;
}

function findLargestNum(myArr) {
  var largest = 0;
  for(var i = 0; i < myArr.length; i++) {
    if(myArr[i] > largest) {
      largest = myArr[i];
    }
  }
  return largest;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Nathan
@terakilobyte
Nov 14 2015 06:08
@ironheartbj18 I'm not following the question
Hans van Riet
@hansinla
Nov 14 2015 06:08
@ironheartbj18 show your code because that was not in the code you posted before.
Manish Giri
@Manish-Giri
Nov 14 2015 06:09
oh crap, forgot to fix the return
but I guess there's other problems too
Nathan
@terakilobyte
Nov 14 2015 06:09
@Manish-Giri what if I told you that you could solve this with reduce?
Manish Giri
@Manish-Giri
Nov 14 2015 06:09
oh yeah
that's true
Brian van Vlymen
@arduino731
Nov 14 2015 06:09
function findLongestWord(str) {

  str = str.split(" ");
  str = str.length;
  return str;
}

 findLongestWord.filter(str){
  if(str <= 2){
    return true;
  }
 }
findLongestWord("The quick brown fox jumped over the lazy dog");
beastlymoo
@beastlymoo
Nov 14 2015 06:09
how can i apply a class type to a image?
Brian van Vlymen
@arduino731
Nov 14 2015 06:10
the problem is the length is not showing the array
Hans van Riet
@hansinla
Nov 14 2015 06:10
@ironheartbj18 Your function returns str, not the value of the length of the longest word.
Nathan
@terakilobyte
Nov 14 2015 06:11
@Manish-Giri .forEach returns nothing
@Manish-Giri it just iterates
beastlymoo
@beastlymoo
Nov 14 2015 06:12
<style>
.smaller-image {width: 100px}
img {.smaller-image
}
</style>
Brian van Vlymen
@arduino731
Nov 14 2015 06:12
is better to remove length method of function?
Manish Giri
@Manish-Giri
Nov 14 2015 06:12
@terakilobyte: right, but I thought iterating through array with forEach and calling a function on each of the element will returna value
Nathan
@terakilobyte
Nov 14 2015 06:13
@ironheartbj18 you've completely exited the function
@ironheartbj18 you are overwriting str multiple times
Hans van Riet
@hansinla
Nov 14 2015 06:13
@ironheartbj18 what you’re doing right now is making an array of the words in str, count the amount of words and return that value. That’s not what you want.
Nathan
@terakilobyte
Nov 14 2015 06:15
@Manish-Giri when you have firstArr.push(arr.forEach(...))
let's think about what that does
let's look inside
arr.forEach returns nothing, so undefined
so it turns into firstArr.push(undefined)
Manish Giri
@Manish-Giri
Nov 14 2015 06:17
I see.
But why does map() also not work?
Nathan
@terakilobyte
Nov 14 2015 06:17
so forEach isn't the method you want
map will work
so will reduce
also, take a look at Math.max
and what calling it with apply might do ;)
if you'd like some pointed help let me know
Manish Giri
@Manish-Giri
Nov 14 2015 06:18
I got Program Execution Failure with .map() instead of forEach on the same code
wonder why
got the same thing with forEach as well
oh yeah, .max - wonder why I forgot that
Nathan
@terakilobyte
Nov 14 2015 06:19
alright, let's start fresh
go ahead and reset the editor
I assert that this can be done in 2 lines
and be completely readable
Manish Giri
@Manish-Giri
Nov 14 2015 06:21
let me give it a try first!
with max
Nathan
@terakilobyte
Nov 14 2015 06:21
ok
also, hint
using map or reduce you can return the computation
Joel M. Swensen
@JoelMSwensen
Nov 14 2015 06:21

@hansinla if you get a sec would you mind hgelping me understand why the app is so small on my phone?

http://joelswensen.com/my-portfolio-2/calculator/index.html

Nathan
@terakilobyte
Nov 14 2015 06:21
no storage variable necessary
Manish Giri
@Manish-Giri
Nov 14 2015 06:21
as in?
Joel M. Swensen
@JoelMSwensen
Nov 14 2015 06:22
or anyone really :)
Nathan
@terakilobyte
Nov 14 2015 06:22
i.e. return arr.map or return arr.reduce
Manish Giri
@Manish-Giri
Nov 14 2015 06:22
Ah I see
Nathan
@terakilobyte
Nov 14 2015 06:22
with the correct function supplied, of course ;)
shout out if you get stuck
Manish Giri
@Manish-Giri
Nov 14 2015 06:23
I will! Thanks a ton
Hans van Riet
@hansinla
Nov 14 2015 06:24
@JoelMSwensen Works well when I simulate an iPhone, and I see you got the colors working!
Joel M. Swensen
@JoelMSwensen
Nov 14 2015 06:25
@hansinla YA! I like how it’s looking, but it’s so small on my phone. let me upload a screen shot
Alfonso Giron
@alfonsogiron10
Nov 14 2015 06:26
document.write("myArray[2] = " + myArray[0] + "</br>");
How are the quotes paired here?
the first 2 and the last 2 are pairs?
or is myArray in quotes
and the entire code in a pair
Hans van Riet
@hansinla
Nov 14 2015 06:27
@JoelMSwensen You probably want to make it a responsive app for different screen sizes. I always use Bootstrap because that handles all of that. But again, when I simulate an iPhone screen on Safari, it still looks good.
Brian van Vlymen
@arduino731
Nov 14 2015 06:28
still stuck on findLongestWord ...
Joel M. Swensen
@JoelMSwensen
Nov 14 2015 06:29
@hansinla I did use dif screen sizes, no mater what I do it looks that small on my phone. yet in browser it looks fine(ish)
@ironheartbj18 need help?
Hans van Riet
@hansinla
Nov 14 2015 06:31

@ironheartbj18 The only code that executes in your posted code is this

function findLongestWord(str) {

  str = str.split(" ");
  str = str.length;
  return str;
}

The rest will not execute. But what you have so far is halfway there. You have split str into an array of words. Next you have to figure out which word is the longest. For this you need to iterate over the array. You can do that witha for..loop. Look into Math.max and see if that will help you find a solution. And delete all the other code, you cannot call that on the function findLongestWord

Brian van Vlymen
@arduino731
Nov 14 2015 06:32
How would do after split method and find the array length ? because i will plan to put the filter method. but i am stuck
when doing method length it will remove all the array
Hans van Riet
@hansinla
Nov 14 2015 06:33
@ironheartbj18 Yes that part is incorrect. as well as return str;
function findLongestWord(str) {

  var myWords  = str.split(" ");
 // do something with myWords to find the longest word
}
Brian van Vlymen
@arduino731
Nov 14 2015 06:35
I am thinking like this way
 str = str.split(" ");
  str = str.length;
  for(i = 0; i < str.length; i++){
    if(str.length){
      return true;
    }
  }
it seem not working anyway
Hans van Riet
@hansinla
Nov 14 2015 06:35
@ironheartbj18 No that will just return true
Brian van Vlymen
@arduino731
Nov 14 2015 06:46
if(i == "3"){
      return "three words length";
    }
its bad practice
I am thinking
opps no need quotes for 3
Manish Giri
@Manish-Giri
Nov 14 2015 07:03
@terakilobyte: Looks like I did it! And in just one line :smile:
Jeremy Barbe
@eemebarbe
Nov 14 2015 07:04
any intermediate type folks in the house?
Manish Giri
@Manish-Giri
Nov 14 2015 07:04
function largestOfFour(arr) {
  // You can do this!
  return arr.map(function(x) { return Math.max(...x);});
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Nathan
@terakilobyte
Nov 14 2015 07:04
@Manish-Giri very nice
but...
Manish Giri
@Manish-Giri
Nov 14 2015 07:04
lol
Nathan
@terakilobyte
Nov 14 2015 07:05
why use the spread without the arrow function?
Aleksander Gębicki
@Takumar
Nov 14 2015 07:05
@ironheartbj18 don't put length of the string into string itself:
str = str.length; because you loose the string.
Later you check the length of the length:
str.length
Maybe use something like:
lengthOfString = str.length and then if (lengthOfString ).
Herman Fassett
@HermanFassett
Nov 14 2015 07:05
Good job @Manish-Giri
Nathan
@terakilobyte
Nov 14 2015 07:05
return arr.map((x) => Math.max(...x));
Manish Giri
@Manish-Giri
Nov 14 2015 07:05
umm..coz I didn’t see anything about an arrow in the docs, or so I think
Herman Fassett
@HermanFassett
Nov 14 2015 07:05
es6 takes a bit to get used to ;P
Manish Giri
@Manish-Giri
Nov 14 2015 07:06
is it like Lambdas in Java 8
Nathan
@terakilobyte
Nov 14 2015 07:06
java 8 is like lambdas in js ;)
Manish Giri
@Manish-Giri
Nov 14 2015 07:06
oh LOL..no wonder
Herman Fassett
@HermanFassett
Nov 14 2015 07:06
Haha yes
Zakariya AbdulHameed
@Zaks0n
Nov 14 2015 07:06
Hey guys I'm stuck here Waypoint: Iterate Odd Numbers With a For Loop I need help
Herman Fassett
@HermanFassett
Nov 14 2015 07:06
What are you stuck with in it @Zaks0n
Zakariya AbdulHameed
@Zaks0n
Nov 14 2015 07:07
Here is my code 11
for (var z= 1; z<10; z+=2){
12
myArray.push(z);
13
}
11
for (var z= 1; z<10; z+=2){
12
myArray.push(z);
13
}
Herman Fassett
@HermanFassett
Nov 14 2015 07:08
It looks fine without those line numbers (I'm assuming) what's the matter
Zakariya AbdulHameed
@Zaks0n
Nov 14 2015 07:09
11,12,13 are line numbers ignore them
Herman Fassett
@HermanFassett
Nov 14 2015 07:09
Yes, so your code doesn't pass?
It looks fine
Manish Giri
@Manish-Giri
Nov 14 2015 07:09
what does Prototype do?
I understand it’s used primarily for inheritance, but things are very murky at the moment
Herman Fassett
@HermanFassett
Nov 14 2015 07:10
It's just code reuse I guess you could say
Zakariya AbdulHameed
@Zaks0n
Nov 14 2015 07:10
Yes it doesn't pass
Manish Giri
@Manish-Giri
Nov 14 2015 07:10
like Array.prototype.reverse()
any instance of Array will inherit reverse(), but it will not be stored in the new instance, using hasOwnProperty(“reverse”) will return false
Herman Fassett
@HermanFassett
Nov 14 2015 07:11
@Zaks0n maybe try resetting your code and reentering that... I think it wants the other non necessary code too to test
reverse is a function or method of array not a property
Manish Giri
@Manish-Giri
Nov 14 2015 07:11
Yes I meant that.
any property/method
basically, what’s prototype and then what’s proto
I guess you reach an object’s parent (class?) with proto?
why Gitter removes the two underscores from around proto I’ll never know
Herman Fassett
@HermanFassett
Nov 14 2015 07:14
Because thats markdown
Basically hasOwnProperty reverse returns false because it isn't its own property but only inherited
I'm not good at explaining this all am I
Alfonso Giron
@alfonsogiron10
Nov 14 2015 07:23
document.write{"Age : " + personnel[1][1] + "</br>"};
Just a basic question
How are the quotes paired here?
first 2 together ?
and last 2 together?
or first and last are paired
Herman Fassett
@HermanFassett
Nov 14 2015 07:24
?
Context?
personnel[1][1] is a 2d array like that
Alfonso Giron
@alfonsogiron10
Nov 14 2015 07:25
Yes
Herman Fassett
@HermanFassett
Nov 14 2015 07:25
It accesses the second element in the second element sort of thing...
Alfonso Giron
@alfonsogiron10
Nov 14 2015 07:26
Like I'm just not sure in general how this would be understood, like is "Age : " one part
then you're concat personell1
Herman Fassett
@HermanFassett
Nov 14 2015 07:26
Oh you're wondering about string concatenation?
Alfonso Giron
@alfonsogiron10
Nov 14 2015 07:26
yeah like how are the quotes
seperating them
what quotes are pairing together
Herman Fassett
@HermanFassett
Nov 14 2015 07:27
Yes, so result would be "Age: whatever</br>"
Alfonso Giron
@alfonsogiron10
Nov 14 2015 07:27
Ok so then the whole thing is in quotes
and then + personnel1 + is in quotes
Herman Fassett
@HermanFassett
Nov 14 2015 07:28
The whole thing is concatenated into a string, though not literal personel[1][1] but what's stored there
Alfonso Giron
@alfonsogiron10
Nov 14 2015 07:31
ok so in my basic understanding it's read like this - > "Name : " PLUS personnel1 PLUS "</br>"
idk why personnel shows up with a 1 like that
Herman Fassett
@HermanFassett
Nov 14 2015 07:31
It's markdown links I think
Anyway I'm off to bed I think you're understanding
Alfonso Giron
@alfonsogiron10
Nov 14 2015 07:32
Yeah thank you @HermanFassett
CamperBot
@camperbot
Nov 14 2015 07:32
alfonsogiron10 sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 601 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
vamus7
@vamus7
Nov 14 2015 07:33
hi, can someone help me with this please? Create a variable called myData and set it to equal the first value of myArray

var ourArray = [1,2,3];

var ourData = ourArray[0]; // equals 1

var myArray = [1,2,3];

Aleksander Gębicki
@Takumar
Nov 14 2015 07:34
@vamus7 arrays are indexed from 0 number, you have exact example up which is made on 'ourData' variable', just do the same on 'myData', create such variable and assign it a value from 'myArray' array.
David Krapka
@Phunkhouse
Nov 14 2015 07:35
Hi, can somebody help me with checking the length property? What am I doing wrong? http://imgur.com/FLwADsf
Aleksander Gębicki
@Takumar
Nov 14 2015 07:36
@Phunkhouse you mispelled: "length" word when calculating length of "lastName" variable.
vamus7
@vamus7
Nov 14 2015 07:37

@Takumar like this? var ourArray = [1,2,3];

var ourData = ourArray[0]; // equals 1

var myArray = [1,2,3];

var myData = [1,2,3];

David Krapka
@Phunkhouse
Nov 14 2015 07:37
@Takumar Thanks! I should be more focused.
CamperBot
@camperbot
Nov 14 2015 07:37
phunkhouse sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:warning: phunkhouse already gave takumar points
Aleksander Gębicki
@Takumar
Nov 14 2015 07:38
@vamus7 not exactly, you've created 'myData' variable but assigned it array. You should put there one (first) element of array 'myData' because it already contains array [1,2,3].
In this moment you have two identical arrays: 'myArray' and 'myData'.
Alfonso Giron
@alfonsogiron10
Nov 14 2015 07:39
document.write("\" " + myString + "\" when converted to a floating point number equals " + myFloat);
David Krapka
@Phunkhouse
Nov 14 2015 07:39
One last thing. How can you embed imae straight to this chat? I saw it there few times before and it looks much better than sending you urls of imageshack. Thanks much.
Alfonso Giron
@alfonsogiron10
Nov 14 2015 07:39
Kind of a silly question but ok so I know the first and last quotes are for the entire string
then the backslash quote is to print the variable value with quotes around it
what are the two innermost quotes for
Aleksander Gębicki
@Takumar
Nov 14 2015 07:40
@Phunkhouse you can just drag image (not too big) to Gitter chat window, but its better to paste code here (it's easier to check and quote). Remember to format it correct (using backticks, one ` or three ``` at beginning and end of code)
David Krapka
@Phunkhouse
Nov 14 2015 07:41
@Takumar Ok, thanks again.
CamperBot
@camperbot
Nov 14 2015 07:41
phunkhouse sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:warning: phunkhouse already gave takumar points
vamus7
@vamus7
Nov 14 2015 07:41
@Takumar thanks a lot, but 1 because "myArray" is strarting with it or Because its second array and we are starting to count from 0?
CamperBot
@camperbot
Nov 14 2015 07:41
vamus7 sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 743 | @takumar | http://www.freecodecamp.com/takumar
Aleksander Gębicki
@Takumar
Nov 14 2015 07:42

@vamus7 sorry I don't understand your question. First element of myArray is number 1, its located on position 0 myArray[0].
You can declare variable and assign it value 1:

var myData = 1;

but that's not point, you have to assign it first element of your array.

beastlymoo
@beastlymoo
Nov 14 2015 07:45
Yo what's up taking a break, how's everyone?
Chethan Bhat
@chethanbhat
Nov 14 2015 07:47
hi guys
require your feedback for zipline random quote project
Aleksander Gębicki
@Takumar
Nov 14 2015 07:48
@alfonsogiron10 you concatenate strings, you don't pass one long string: "when converted to " but string which is concatenated "when" + " converted " + myFloat so there is need for more quotation marks.
shubheksha
@shubheksha
Nov 14 2015 07:48
Hey, I cannot figure out how to go about this: http://www.freecodecamp.com/challenges/bonfire-seek-and-destroy
Can someone help?
beastlymoo
@beastlymoo
Nov 14 2015 07:48
@chethanbhat Good luck wish I could help! Just started learning though :(
vamus7
@vamus7
Nov 14 2015 07:48
@Takumar ok thanks, i will try to solve this later
CamperBot
@camperbot
Nov 14 2015 07:48
vamus7 sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:warning: vamus7 already gave takumar points
Aleksander Gębicki
@Takumar
Nov 14 2015 07:49
@vamus7 but your solutions is on your feet :-)
Chethan Bhat
@chethanbhat
Nov 14 2015 07:49
@beastlymoo thank you !
CamperBot
@camperbot
Nov 14 2015 07:49
chethanbhat sends brownie points to @beastlymoo :sparkles: :thumbsup: :sparkles:
:star: 30 | @beastlymoo | http://www.freecodecamp.com/beastlymoo
Chethan Bhat
@chethanbhat
Nov 14 2015 07:50
@shubhekshajalan read about 'arguments' in javacript
arguments[0] is the array which they gave for example [1,2,3,3,2,1]
argument1 is 2 and argumenteslint/eslint#4266 is 3
``` argument1 is 2 and argument 2 is 3
argument[1] is 2 and argument [2] is 3
Aleksander Gębicki
@Takumar
Nov 14 2015 07:51
@chethanbhat good job, nice looking, responsive, I cannot find any bugs at this moment.
One thing (I don't know if it can be made better), when you press button for new quote, a quote appears and widow with quote change his size twice (bigger and a little later smaller).
Alfonso Giron
@alfonsogiron10
Nov 14 2015 07:56
So hm how would I print out the value of myInt with quotes around it, just like myString is
Brian van Vlymen
@arduino731
Nov 14 2015 07:56

when I am doing on console.log i assigned

var a = [3].length;

the output is 1 why?

Alfonso Giron
@alfonsogiron10
Nov 14 2015 07:57
("\"" + myString + "\" when converted to an integer equals " + myInt + "<br/>");
been trying to do it, can't get it right
My confusion revolves around utilizing the backslash escape, understanding how the quotes are working/pairing together etc
So I know how to insert the backslash haha
Aleksander Gębicki
@Takumar
Nov 14 2015 07:59
@ironheartbj18 [3] is an array of length 1 element so a gets value of 1 and its totally correct.
Chethan Bhat
@chethanbhat
Nov 14 2015 08:01
@Takumar yes its kind of a bug. i will work on that. thank you
CamperBot
@camperbot
Nov 14 2015 08:01
chethanbhat sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 744 | @takumar | http://www.freecodecamp.com/takumar
Brian van Vlymen
@arduino731
Nov 14 2015 08:01
var abcd = [3].length;
output is 1 . can you please explain how get 1 ?
@Takumar
Aleksander Gębicki
@Takumar
Nov 14 2015 08:02
@ironheartbj18 but you say you get 1 :-(
[3, 2].length === 2
Brian van Vlymen
@arduino731
Nov 14 2015 08:03
why could not output "d"?
Aleksander Gębicki
@Takumar
Nov 14 2015 08:05
var myStr = "abcd";
var letterD = myStr[3];
// here variable 'letterD' has value of "d"
method ".length" gives you length of string or number of elements of an array.
Brian van Vlymen
@arduino731
Nov 14 2015 08:06
yes
Aleksander Gębicki
@Takumar
Nov 14 2015 08:07
If you create an array:
var myArr = [4, 2, 9];
// you can access its elements using brackets
var secondElement = myArr[1];
var thirdElement = myArr[2];
Brian van Vlymen
@arduino731
Nov 14 2015 08:08
correct i understand that part when I open up the element inspect and type "var abcd = [3].length;" and tell abcd it was output 1 . it got me suspect
Aleksander Gębicki
@Takumar
Nov 14 2015 08:08
and its correct, because you calculated length of array.
Brian van Vlymen
@arduino731
Nov 14 2015 08:09
oh?
got it
var abcd = [31, 1].length;
output is 2 oh ok i got it now
interesting
I m working on findLongestWord trying to find the length with the array
@Takumar thanks man !
CamperBot
@camperbot
Nov 14 2015 08:13
ironheartbj18 sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 745 | @takumar | http://www.freecodecamp.com/takumar
Manish Giri
@Manish-Giri
Nov 14 2015 08:19
In JS, is a character also considered a string?
Aleksander Gębicki
@Takumar
Nov 14 2015 08:25
@Manish-Giri I think so, there's no char type here.
azaleas
@azaleas
Nov 14 2015 08:32
Hey fellow campers. I just finished all the waypoints on full stack development. Now, I'll be starting my basejumps. But, to be honest, I don't know where to start and how to start them. I just watched the video for first basejump and now I'm stuck, as if what now? Did any1 had this kind of feeling with basejumps? On ziplines, every1 was kinda self explanatory, given that we used only html and css and js. But know, i'm confused:D So, any1 can give me some ideas on how to get over this feeling and how to start the basejumps would be much appreciated..
EmotionlessRock
@EmotionlessRock
Nov 14 2015 08:34
Oh man now I'm getting scared for basejumps!
Ademola Adegbuyi
@ooade
Nov 14 2015 09:07
@azaleas they believe you are good enough, so you just have to figure out things yourself
Bryan Hatton
@bryan-hatton
Nov 14 2015 09:29
@h4r1m4u I actually managed to get that library you linked me to work. I don't know why or how, but it works! Thanks!
h4r1m4u
@h4r1m4u
Nov 14 2015 09:30
@bryan-hatton fantastic! i'm glad it helped
Bryan Hatton
@bryan-hatton
Nov 14 2015 09:31
@h4r1m4u Thanks again (for proper brownie points). I think my next step will be figuring out why it works.
CamperBot
@camperbot
Nov 14 2015 09:31
bryan-hatton sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 665 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 14 2015 09:32
@bryan-hatton thanks for the cookie :) check out the source code of the library, see if you can understand how it works (i didn't examine it in detail myself)
Pranav Doshi
@pranavdoshi
Nov 14 2015 09:45
Hello guys i am stuck on bonfire since week plzz help me
Bonfire: Check for Palindromes just not passing the challenge as one test case is not passed
CamperBot
@camperbot
Nov 14 2015 09:46
Sorry, can't find a bonfire called check for palindromes just not passing the challenge as one test case is not passed. [ Check the map? ]
andrey
@kaflan
Nov 14 2015 09:46
@/all
Pranav Doshi
@pranavdoshi
Nov 14 2015 09:46
will post the code
andrey
@kaflan
Nov 14 2015 09:47
Hello
please can help me in recursion function?
Pranav Doshi
@pranavdoshi
Nov 14 2015 09:47
function palindrome(str) {
  // Good luck!
     var lowerstr = str.toLowerCase();  
      lowerstr= lowerstr.replace(/[^\w]+/gi,"");
      var reg = lowerstr.split("").reverse().join("");
       if(reg ===lowerstr)    
        {
            return true;
        }
        else
        {
            return false;    
        }
}
palindrome("race car");
cannot pass the testcase when there is a underscore
cannot understand what regex to use this was the simplest one i wud think of.
Bryan Hatton
@bryan-hatton
Nov 14 2015 09:48
@pranavdoshi Your regex doesn't match underscore b/c \w does
Pranav Doshi
@pranavdoshi
Nov 14 2015 09:49
@bryan-hatton yes cant figure out how to include _
@bryan-hatton cant figure out how to include _ in regex
Bryan Hatton
@bryan-hatton
Nov 14 2015 09:50
@pranavdoshi Probably the easiest way is to replace \w with the character set you want. \w matches [a-zA-Z0-9_] You only need to match [a-z] (because you lowercased the string).
Pranav Doshi
@pranavdoshi
Nov 14 2015 09:51
@bryan-hatton i did not get u
it shud strip all punctuation so as to get palindrome
right?
@bryan-hatton
Bryan Hatton
@bryan-hatton
Nov 14 2015 09:52
@pranavdoshi Right, but you are matching punctuation by specifying everything that you are not matching, this is what the ^ means.
@pranavdoshi So [a-z] means match every lowercase letter, but [^a-z] means match everything that isn't a lowercase letter.
@pranavdoshi \w is just shorthand for [a-zA-Z0-9_] which means match every alphanumeric character and underscore. Coincidentally \W is short for [^a-zA-Z0-9_] or match anything that isn't a alphanumeric character.
See here for documentation, and here for a really good site to play and test your regex.
Pranav Doshi
@pranavdoshi
Nov 14 2015 09:57
@bryan-hatton i used only \W in regex it doesnt include underscore
Bryan Hatton
@bryan-hatton
Nov 14 2015 09:59
This message was deleted
Jazmine
@medusanxs
Nov 14 2015 09:59
Anyone able to explain Waypoint: Split Strings with split - so I used the split('s') - and I attempted to push() to an array. Am I thinking incorrectly here? Is there a better way - because it is not working for me.
Maybe I used push incorrectly?
Bryan Hatton
@bryan-hatton
Nov 14 2015 10:00
@pranavdoshi Yes, \W won't match underscore, but it's probably not what you want to use b/c it will match . or ? or .
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:03
@bryan-hatton i am not getting i am confused wat tshud i do
Bryan Hatton
@bryan-hatton
Nov 14 2015 10:03
@medusanxs For that waypoint you want to split on spaces to make an array of words. Spliting on 's' gives ["Split me into an array"] because 's' isn't in that string.
Jazmine
@medusanxs
Nov 14 2015 10:03
Ah, maybe that is what I misunderstood.
ty. totally is apparently.
Moar sleep needed. But can't. /coffee
Bryan Hatton
@bryan-hatton
Nov 14 2015 10:05
@medusanxs lol, juice of life
Jazmine
@medusanxs
Nov 14 2015 10:05
Wordskis
@bryan-hatton thanks
CamperBot
@camperbot
Nov 14 2015 10:05
medusanxs sends brownie points to @bryan-hatton :sparkles: :thumbsup: :sparkles:
:star: 221 | @bryan-hatton | http://www.freecodecamp.com/bryan-hatton
Bryan Hatton
@bryan-hatton
Nov 14 2015 10:06
@pranavdoshi Try playing with regex on this site, seeing the matching in action might help you get a feel for it.
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:06
but with what shud i try?
@bryan-hatton
Mauricio
@maudevelop
Nov 14 2015 10:08
hey quick question
Bryan Hatton
@bryan-hatton
Nov 14 2015 10:09
@pranavdoshi in the big square type in abcdefghijklmnopqrstuvwxyz1234567890 _.?! then type \w+ into the small box at the top and see what is highlighted in blue. What about \w or \W+ ?
Mauricio
@maudevelop
Nov 14 2015 10:09
on waypoint "Target a Specific child of an element using jQuery"
the function target:nth-child(n) is targetting what exactky?
Jazmine
@medusanxs
Nov 14 2015 10:10
Each instance of target that matches n
So, there are two groups - it asks for the '2'nd one, so each second one.
Bryan Hatton
@bryan-hatton
Nov 14 2015 10:10
This message was deleted
Mauricio
@maudevelop
Nov 14 2015 10:11
I kinda understood it's targetting the second child of the class "target"
but since there are 6 instances of that
how does it decide there are 2 groups and it selects the 2nd one each time
Jazmine
@medusanxs
Nov 14 2015 10:11
There are six instances. But its broken up into two groups by 'div'
So there are technically two sets of three
Mauricio
@maudevelop
Nov 14 2015 10:11
Ohh so it knows the groups by each div
Alright alright now i get it :D
Jazmine
@medusanxs
Nov 14 2015 10:12
I feel like they should explain that better. Not the first time someone has asked in my week being here. lol.
Bryan Hatton
@bryan-hatton
Nov 14 2015 10:12
@maudevelop For example:
:nth-child(n) \\ targets every child
:nth-child(3n) \\ targets every third child
:nth-child(3n+1) \\ targets every thirld child starting from the first (rather than the zeroth)
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:13
@bryan-hatton \W selects spaces ie non alpanumeric char den \w will select single alphanumeric char and \w+ will select one or more alphanumeric character .
@bryan-hatton \W selects spaces ie non alpanumeric char den \w will select single alphanumeric char and \w+ will select one or more alphanumeric character .
Mauricio
@maudevelop
Nov 14 2015 10:13
Thanks to both btw
Jazmine
@medusanxs
Nov 14 2015 10:13
np
Bryan Hatton
@bryan-hatton
Nov 14 2015 10:13
@pranavdoshi Great! Now try \W+
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:14
k wait @bryan-hatton
@bryan-hatton plz chk dis link
Bryan Hatton
@bryan-hatton
Nov 14 2015 10:18
@pranavdoshi Ah, sorry. \W+ isn't matching the trailing punctuation because they are separated by an underscore. Add a g to the small box to the right of where you entered \W+. This is a flag that tells \W+ to match all occurrences, rather than just the first it sees.
@pranavdoshi btw, these flags are the same ones you'd add after the regex eg /\W+/g
jpjenkins
@jpjenkins
Nov 14 2015 10:20
W+ doesn't match underscores
/\W+_/g is the droid you're looking for
/[\W+_]/g
please correct me if I'm wrong :P
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:25
@jpjenkins u r right
Bryan Hatton
@bryan-hatton
Nov 14 2015 10:26
@pranavdoshi Yes he is, but the important thing is that you understand why he's right. Otherwise you'll be paralyzed when it comes time to generate other regex.
jpjenkins
@jpjenkins
Nov 14 2015 10:27
@pranavdoshi just use regex101.com, play with some string and expressions
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:27
@bryan-hatton wat u meant i understood but now i am getting empty string on my new regex.
function palindrome(str) {
  // Good luck!
     var lowerstr = str.toLowerCase();  
    alert(lowerstr);
      lowerstr= lowerstr.replace(/\w+/gi,"");
    alert(lowerstr);
      var reg = lowerstr.split("").reverse().join("");
    alert(reg);
       if(reg === lowerstr)    
        {
            return true;
        }
        else
        {
            return false;    
        }
}
palindrome("not a palindrome");
jpjenkins
@jpjenkins
Nov 14 2015 10:28
you don't need 'gi', it's already all lower case
just g will be fine for 'global'
and remember, it's a capital W
@pranavdoshi go to regex101.com and enter your text
play with it to get a grasp of what it's keeping and removing
Bryan Hatton
@bryan-hatton
Nov 14 2015 10:29
@pranavdoshi \w will match alphanumeric characters, removing not, a, and palindrome
jpjenkins
@jpjenkins
Nov 14 2015 10:29
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:30
ohh yes it will be replaced with "" understood
jpjenkins
@jpjenkins
Nov 14 2015 10:30
and a quick browse through this http://www.w3schools.com/jsref/jsref_obj_regexp.asp
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:32
@jpjenkins and @bryan-hatton still again this all comes back to last test case not working
jpjenkins
@jpjenkins
Nov 14 2015 10:32
again @pranavdoshi put the text in regex101.com
get a feel for what it's keeping and removing
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:33
@jpjenkins trying
jpjenkins
@jpjenkins
Nov 14 2015 10:33
copy the last test case into it, you'll quickly see...
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:33
thanks for staying online and guiding me
jpjenkins
@jpjenkins
Nov 14 2015 10:33
regex is a tricky affair
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:33
yeah u wud hav known after asking so many things i am very weak at it.
jpjenkins
@jpjenkins
Nov 14 2015 10:33
more than happy, but it really is a hands on thing.
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:33
:(
jpjenkins
@jpjenkins
Nov 14 2015 10:34
everyone is at first, nobody likes regex
but to see instant feedback with the link I sent you is really useful
watch some of that video too, demystify it :P
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:35
@jpjenkins hey i checked the last testcase in regex101
the \W+ matches every punctuation which i need to remove except _
Bryan Hatton
@bryan-hatton
Nov 14 2015 10:35
@pranavdoshi It's annoying because the syntax is so terse.
jpjenkins
@jpjenkins
Nov 14 2015 10:36
@pranavdoshi and there you have it ;)
what were we saying earlier about the underscore?
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:37
look at this link
Jazmine
@medusanxs
Nov 14 2015 10:37
Derping hard on my second bonfire. lol.
jpjenkins
@jpjenkins
Nov 14 2015 10:37
@pranavdoshi if you click
Bryan Hatton
@bryan-hatton
Nov 14 2015 10:37
@pranavdoshi Does it make sense why \W doesn't match underscore?
jpjenkins
@jpjenkins
Nov 14 2015 10:37
save regex at the top left
you can send me the link to your regex directly
Bryan Hatton
@bryan-hatton
Nov 14 2015 10:38
@medusanxs Post the codes, @jpjenkins seems like he has it covered
Jazmine
@medusanxs
Nov 14 2015 10:39
Nah, just wanted to vent. lol. I'll rough it out a bit more.
I'm sure its just brain dead.
I'll fix it soon.
Bryan Hatton
@bryan-hatton
Nov 14 2015 10:40
@medusanxs がんばれ!
Jazmine
@medusanxs
Nov 14 2015 10:41
que?
Fighting? lol
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:46
@jpjenkins and @bryan-hatton understood \W+ will match non alphanumeric char so now i need to target _ so i can get my palindrome right
jpjenkins
@jpjenkins
Nov 14 2015 10:47
exactly
Bryan Hatton
@bryan-hatton
Nov 14 2015 10:47
@pranavdoshi You can group together characters with [] so try @jpjenkins earlier example
jpjenkins
@jpjenkins
Nov 14 2015 10:47
if you watch ~10 minutes of the video I sent, you'll get a better understanding of how to do that
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:48
ok let me try
wanted to ask u why without square bracket underscore did not match?
@jpjenkins and @bryan-hatton
jpjenkins
@jpjenkins
Nov 14 2015 10:49
it boxes groups of characters together
it lets the javascript engine know that there is more than one expression to look for
Bryan Hatton
@bryan-hatton
Nov 14 2015 10:49
@pranavdoshi because \W+_ means one or more alphanumeric chars and a mandatory trailing underscore
jpjenkins
@jpjenkins
Nov 14 2015 10:49
and that
:)
Jeremy Barbe
@eemebarbe
Nov 14 2015 10:50
anybody available to help?
mansellb55
@mansellb55
Nov 14 2015 10:50
with? @jrbarbe87
Jeremy Barbe
@eemebarbe
Nov 14 2015 10:50
js
mansellb55
@mansellb55
Nov 14 2015 10:50
depends on wich one it is
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:50
so without a bracket it wud check only one _ ? @jpjenkins
jpjenkins
@jpjenkins
Nov 14 2015 10:50
no no
Jeremy Barbe
@eemebarbe
Nov 14 2015 10:50
which one?
mansellb55
@mansellb55
Nov 14 2015 10:50
i might be able to help
jpjenkins
@jpjenkins
Nov 14 2015 10:50
it would check something that has an underscore attached to it
mansellb55
@mansellb55
Nov 14 2015 10:51
which waypoint
Jeremy Barbe
@eemebarbe
Nov 14 2015 10:51
im trying to get divs to hide when they're empty
jpjenkins
@jpjenkins
Nov 14 2015 10:51
with the square brackets, it let's it know that they are two seperate things to look for
Bryan Hatton
@bryan-hatton
Nov 14 2015 10:51
@pranavdoshi eg. it would match ???_ but not !!!
jpjenkins
@jpjenkins
Nov 14 2015 10:51
again, try in regex101.com
type in some random string and throw in a few underscores then experiment with the regex
mansellb55
@mansellb55
Nov 14 2015 10:51
oh ok... nevermind.
sorry
Jeremy Barbe
@eemebarbe
Nov 14 2015 10:51
ok
Bryan Hatton
@bryan-hatton
Nov 14 2015 10:52
@jpjenkins knows what's up, there's really no replacing playing around with things
jpjenkins
@jpjenkins
Nov 14 2015 10:52
especially with regex
damn thing's possessed
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:52
ohh @bryan-hatton understood if we include brackets then specific char which are der in brackets are matched
Bryan Hatton
@bryan-hatton
Nov 14 2015 10:53
@jpjenkins It's just a poor finite state machine, it doesn't understand why everybody hates it :D
jpjenkins
@jpjenkins
Nov 14 2015 10:53
it's like any system with too many rules and regulations
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:53
now am i correct @jpjenkins and @bryan-hatton
jpjenkins
@jpjenkins
Nov 14 2015 10:53
eventually there will be a revolution :)
Bryan Hatton
@bryan-hatton
Nov 14 2015 10:53
@pranavdoshi YAY!
jpjenkins
@jpjenkins
Nov 14 2015 10:53
congrats @pranavdoshi
now watch that video! :)
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:54
thank u guys
jpjenkins
@jpjenkins
Nov 14 2015 10:54
really helps
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:54
thanks @jpjenkins
CamperBot
@camperbot
Nov 14 2015 10:54
pranavdoshi sends brownie points to @jpjenkins :sparkles: :thumbsup: :sparkles:
:star: 220 | @jpjenkins | http://www.freecodecamp.com/jpjenkins
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:54
thanks @jpjenkins
CamperBot
@camperbot
Nov 14 2015 10:54
pranavdoshi sends brownie points to @jpjenkins :sparkles: :thumbsup: :sparkles:
:warning: pranavdoshi already gave jpjenkins points
jpjenkins
@jpjenkins
Nov 14 2015 10:54
yo welcome monsieur
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:54
thanks @bryan-hatton
CamperBot
@camperbot
Nov 14 2015 10:54
pranavdoshi sends brownie points to @bryan-hatton :sparkles: :thumbsup: :sparkles:
:star: 222 | @bryan-hatton | http://www.freecodecamp.com/bryan-hatton
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:54
by the way u guys learned js from were
Bryan Hatton
@bryan-hatton
Nov 14 2015 10:54
@pranavdoshi Best luck in the future!
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:54
can u share ur story
jpjenkins
@jpjenkins
Nov 14 2015 10:54
here and books
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:54
@jpjenkins and @bryan-hatton
Bryan Hatton
@bryan-hatton
Nov 14 2015 10:55
@pranavdoshi Python and web tutorials and CS lectures
jpjenkins
@jpjenkins
Nov 14 2015 10:55
Books: Eloquent Javascript and the principles of object-oriented javascript
and lots of videos...
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:55
bcoz i am struggling to do js from two books one video tutorial and fcc
jpjenkins
@jpjenkins
Nov 14 2015 10:55
and asking questions :)
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:55
so confused
@jpjenkins can u suggest me how shud i proceed
jpjenkins
@jpjenkins
Nov 14 2015 10:55
it is confusing at first, but the confusion is actually a really valuable part of it @pranavdoshi
Jazmine
@medusanxs
Nov 14 2015 10:55
@bryan-hatton maybe you can guide me. I'm looking at the documents/articles provided, and my first attempts were this exact line that is in the article. str = dfsfsf, take str and then .split...etc but it gives me 'str.split is not a function'
jpjenkins
@jpjenkins
Nov 14 2015 10:56
once you finish your bonfires, you'll have a lot of confusion
then go through them again make them better
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:56
confusion as in?
jpjenkins
@jpjenkins
Nov 14 2015 10:56
you'll still have confusion
lots of things really
Bryan Hatton
@bryan-hatton
Nov 14 2015 10:56
@pranavdoshi a lot of computer programming is dealing reliably with things you don't know
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:56
same bonfires again and again?
jpjenkins
@jpjenkins
Nov 14 2015 10:56
why returns sometimes come back undefined for instance
I did them 4 times
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:57
so as per u both with what things i should stick to
jpjenkins
@jpjenkins
Nov 14 2015 10:57
just keep programming just now
keep trying
keep being confused
Every time you are confused and find something you didn't know...
Bryan Hatton
@bryan-hatton
Nov 14 2015 10:57
@medusanxs Hmm, why don't you post your code. I'll try to help
jpjenkins
@jpjenkins
Nov 14 2015 10:57
That's what learning means! :P
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:57
in books referring to 1)javascript by jon duckett 2)eloquent js and 3)beginning js by wrox
videos lynda js essential training
Majd900
@Majd900
Nov 14 2015 10:57
Guys can someone help me at waypoint: 91
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:57
and lastly fcc
Majd900
@Majd900
Nov 14 2015 10:57
Waypoint: Create Bootstrap Wells
i'm stuck here since 15 minutes.
jpjenkins
@jpjenkins
Nov 14 2015 10:58
@pranavdoshi 1. finish bonfires. 2. repeat bonfires. 3. repeat bonfires. 4. read "the principles of object oriented javascript"
that will give you a solid foundation
Pranav Doshi
@pranavdoshi
Nov 14 2015 10:58
a new book?
jpjenkins
@jpjenkins
Nov 14 2015 10:59
yeah, it will cover a lot of the confusion that will have been generated workign through the bonfires
and devour the mozilla developer network pages
Jazmine
@medusanxs
Nov 14 2015 11:00
var str = reverseString;

var reverseStr = str.split(' ').reverse().join(' ');
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:00
jpjenkins
@jpjenkins
Nov 14 2015 11:00
I'm still a beginner myself but I've managed to get over a few hurdles so far, that's what's helped me
Jazmine
@medusanxs
Nov 14 2015 11:00
It's stopping at str.split
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:00
@medusanxs What are the contents of reverseString?
jpjenkins
@jpjenkins
Nov 14 2015 11:00
are there any spaces in your string?
Pranav Doshi
@pranavdoshi
Nov 14 2015 11:01
@medusanxs post ur complete code
Jazmine
@medusanxs
Nov 14 2015 11:01
reverseString("hello");
I don't want someone else to completely do it for me - just guide me on this part.
jpjenkins
@jpjenkins
Nov 14 2015 11:01
you're splitting at a space
Jazmine
@medusanxs
Nov 14 2015 11:01
Correct.
jpjenkins
@jpjenkins
Nov 14 2015 11:01
you've done it correct, don't worry :)
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:01
This message was deleted
jpjenkins
@jpjenkins
Nov 14 2015 11:02
ah
how about you post all your code @medusanxs
Pranav Doshi
@pranavdoshi
Nov 14 2015 11:03
dats wat i asked @medusanxs
jpjenkins
@jpjenkins
Nov 14 2015 11:04
@medusanxs firstly, remember that the code works from the top down
Majd900
@Majd900
Nov 14 2015 11:04
Guys here's my code
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:04
@medusanxs I get the feeling that reverseString is actually the name of the function, so str = reverseString sets str to be a function.
Majd900
@Majd900
Nov 14 2015 11:04
<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">
    <div class="col-xs-6 well>


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

    </div>
  </div>
</div>
</div>
They are saying " Add a div element with the class well inside each of your div elements with the class "col-xs-6"
Nest both of your div elements with the class "col-xs-6" within your div element with the class "row".
jpjenkins
@jpjenkins
Nov 14 2015 11:04
@bryan-hatton could be right there
Jazmine
@medusanxs
Nov 14 2015 11:04
function reverseString(str) {
  return str;
}

reverseString("hello");

var str = reverseString;

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

console.log(reverseStr);
Majd900
@Majd900
Nov 14 2015 11:04
That's two tasks there.
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:04
@Majd900 missing double quotes
jpjenkins
@jpjenkins
Nov 14 2015 11:04
:D
Pranav Doshi
@pranavdoshi
Nov 14 2015 11:05
@medusanxs why dont u include everything in one function
jpjenkins
@jpjenkins
Nov 14 2015 11:05
@medusanxs so, where is code supposed to go?
Majd900
@Majd900
Nov 14 2015 11:05
@bryan-hatton Nope didnt work.
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:05
@medusanxs Bingo! Put your function code inside the function brackets
Jazmine
@medusanxs
Nov 14 2015 11:05
@Majd900 you still aren't using the colors/syntax to help you :P
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:05
This message was deleted
jpjenkins
@jpjenkins
Nov 14 2015 11:06
@medusanxs let us know how you get on, interested to hear the outcome of this space in the split ...
Majd900
@Majd900
Nov 14 2015 11:06
This is my original code
<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">
    <div class="col-xs-6">

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

    </div>
  </div>
</div>
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:06

@Majd900 Your html (the first post) is malformed, it should be like:

<div class='my classes'>

not

<div class="my classes have no closing quote so they just go on and on>
Jazmine
@medusanxs
Nov 14 2015 11:06
That still gives the same error regarding function
jpjenkins
@jpjenkins
Nov 14 2015 11:07
reverseString is the name of the constructor
the object = function
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:08
@medusanxs Right, that's because when you str = reverseString you're setting make str a object, not the function's arg
@bryan-hatton Since str in is the function declaration, it's automatically bound to any argument you pass the function
jpjenkins
@jpjenkins
Nov 14 2015 11:08
basically, the only variable you're interested in and the only one you have available... is str
Pranav Doshi
@pranavdoshi
Nov 14 2015 11:09
@medusanxs getting str.split is not a function
jpjenkins
@jpjenkins
Nov 14 2015 11:10
it's a built in method for the string object
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:10
Eg.
function showcase(whatever) {
    console.log(whatever); // logs showcase's argument; I don't have to initialize whatever
}
console.log(whatever); // but this whatever isn't the same as the one above
showcase(4); // here whatever is 4
showcase([1, 2, 3, 4]); // here it's an array
Pranav Doshi
@pranavdoshi
Nov 14 2015 11:11
@medusanxs as @jpjenkins said calling the function den u should of done like dis var str = reverseString("hello");
Jazmine
@medusanxs
Nov 14 2015 11:11
I fixed it..omfg.
Majd900
@Majd900
Nov 14 2015 11:11
<div class="row">

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

      <div class="well">

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

      <div class="well">
jpjenkins
@jpjenkins
Nov 14 2015 11:11
I don't think that's correct @pranavdoshi
Jazmine
@medusanxs
Nov 14 2015 11:11
I'm retarded
jpjenkins
@jpjenkins
Nov 14 2015 11:11
well, I can't say anything about that
Majd900
@Majd900
Nov 14 2015 11:11
I'm sure im doing it correct, idk why they're saying wrong i need to nest them
jpjenkins
@jpjenkins
Nov 14 2015 11:11
but you succeeded
and received your tick
Be proud :P
jpjenkins
@jpjenkins
Nov 14 2015 11:12
@pranavdoshi str IS "hello"
str is the argument to reference the value of reverseString
Jazmine
@medusanxs
Nov 14 2015 11:12
@Majd900 Your last one looks like you never closed the divs.
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:12
This message was deleted
Jazmine
@medusanxs
Nov 14 2015 11:13
@bryan-hatton I think this one is asking for div within a div
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:13
@medusanxs Hurr Durr, I guess I'm retarded too
Jazmine
@medusanxs
Nov 14 2015 11:14
Not at all, @bryan-hatton
Majd900
@Majd900
Nov 14 2015 11:14
@medusanxs I already closed them
jpjenkins
@jpjenkins
Nov 14 2015 11:14
@medusanxs congrats, later you'll understand the usefulness of a single return too
function reverseString(str) {

  return str.split('').reverse().join('');
}

reverseString("hello");
Jazmine
@medusanxs
Nov 14 2015 11:14
@Majd900 share the waypoint?
Majd900
@Majd900
Nov 14 2015 11:15
@medusanxs you mean the whole code?
jpjenkins
@jpjenkins
Nov 14 2015 11:15
returns can be powerful beasts
Jazmine
@medusanxs
Nov 14 2015 11:15
The URL to the page.
@jpjenkins yea, looking forward to knowing more.
wowoow wtf
Jazmine
@medusanxs
Nov 14 2015 11:16
So, I'm not sure you placed the </div> in the right spots?
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:16
@Majd900 You should have closing div tags
Pranav Doshi
@pranavdoshi
Nov 14 2015 11:16
@medusanxs i got ur code working
@jpjenkins i got the mistake
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:17
@Majd900 eg.
<div class='A'>
   <div class ='a'>
   </div>
</div>
Jazmine
@medusanxs
Nov 14 2015 11:17
I fixed it, but appreciate the looking at it, @pranavdoshi
jpjenkins
@jpjenkins
Nov 14 2015 11:17
;)
Majd900
@Majd900
Nov 14 2015 11:17
see
<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">

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

      <div class="well">

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

      <div class="well">

    </div>
  </div>
</div>
Pranav Doshi
@pranavdoshi
Nov 14 2015 11:17
the misatke was of spaces right
Jazmine
@medusanxs
Nov 14 2015 11:17
No, @pranavdoshi
Majd900
@Majd900
Nov 14 2015 11:17
The problem is not in the closing tags
jpjenkins
@jpjenkins
Nov 14 2015 11:17
@pranavdoshi you'll learn about arguments in the upcoming bonfires, very important things
Pranav Doshi
@pranavdoshi
Nov 14 2015 11:17
bcoz i removed the spaces then i got the answer
Majd900
@Majd900
Nov 14 2015 11:17
It's with the nesting
Pranav Doshi
@pranavdoshi
Nov 14 2015 11:18
@jpjenkins wic bonfire?
Jazmine
@medusanxs
Nov 14 2015 11:18
@Majd900 your /divs are supposed to come directly after the div, to close it.
currently, you have them all at the end
mientje
@mientje
Nov 14 2015 11:18
I've started the zipline Camper News. I notice that I can't upvote in the codepen. I hit 'discuss', I see a screen with the name of the article and an upvote button, I click it. Nothing happens. When I hit 'news' in Freecodecamp I go to the same list (but it's not a codepen) and there I can upvote without problems. Anyone else have this problem?
Pranav Doshi
@pranavdoshi
Nov 14 2015 11:19
@medusanxs can u tell me wat was wrong
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:19
@Majd900 You also don't have enough </div>s, there should be one for every <div>.
jpjenkins
@jpjenkins
Nov 14 2015 11:19
@pranavdoshi Bonfire: Seek and Destroy
Pranav Doshi
@pranavdoshi
Nov 14 2015 11:19
ok @medusanxs but how did u solve
plzz rep
Jazmine
@medusanxs
Nov 14 2015 11:20
@pranavdoshi - I had removed the spaces, but that wasn't what was broken - it was my structure. var str wasn't useful. Removing it helped.
I posted the gist.
Please scroll up.
Majd900
@Majd900
Nov 14 2015 11:20
Oh god im so lost
Pranav Doshi
@pranavdoshi
Nov 14 2015 11:20
see @medusanxs
the code wic i did
function reverseString(str) { return str; } 

var str = reverseString("hello"); 

var reverseStr = str.split('').reverse().join('');
this code will work
right @medusanxs
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:21
@pranavdoshi I'm astonished that actually works
jpjenkins
@jpjenkins
Nov 14 2015 11:21
that's the same, but you don't use a function
Jazmine
@medusanxs
Nov 14 2015 11:21
I appreciate you looking at it, but I don't want other people to do my work for me.
jpjenkins
@jpjenkins
Nov 14 2015 11:21
you replace the function with a string then reverse it then return a string
Pranav Doshi
@pranavdoshi
Nov 14 2015 11:22
@jpjenkins and @bryan-hatton this is right i guess
jpjenkins
@jpjenkins
Nov 14 2015 11:22
it works, but it's just lines of code that's been called, not instantiating a function
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:22
and set the initial function to your return value
jpjenkins
@jpjenkins
Nov 14 2015 11:22
indeed
@pranavdoshi I posted my code above
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:23
@pranavdoshi If it works, it works
Pranav Doshi
@pranavdoshi
Nov 14 2015 11:23
i previously did within one function @jpjenkins
jpjenkins
@jpjenkins
Nov 14 2015 11:23
if it works, it will only work once and then never again...
Pranav Doshi
@pranavdoshi
Nov 14 2015 11:23
so wat is my mistake plzz tell @jpjenkins
Jazmine
@medusanxs
Nov 14 2015 11:23
@Majd900 check your PM.
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:23
@jpjenkins And FCC waypoints only need to work once to get that delicious green check
jpjenkins
@jpjenkins
Nov 14 2015 11:23
your function is important, it allow you to call a block of code at any point within the global scope of your code
Jazmine
@medusanxs
Nov 14 2015 11:24
@bryan-hatton getting a green check doesn't make you a good dev in the end :P
Pranav Doshi
@pranavdoshi
Nov 14 2015 11:24
so wats wrong but
jpjenkins
@jpjenkins
Nov 14 2015 11:24
but so do the ziplines @bryan-hatton
Pranav Doshi
@pranavdoshi
Nov 14 2015 11:24
@jpjenkins
jpjenkins
@jpjenkins
Nov 14 2015 11:24
well, all your doing is assigning a variable
beyond that it's useless
as opposed to a function, which can be called with any given argument and have that 'method' do the work for you
Keep working through @pranavdoshi, I sense panic in your questions, like your missing some golden nugget
You're not :) some more experience and the jigsaw pieces will fall into place
Roger8
@Roger8
Nov 14 2015 11:26
hi, array.sort(function(a, b) { return a - b;}); how to know it sort the elements from smallest to largest , i am confused .
Pranav Doshi
@pranavdoshi
Nov 14 2015 11:26
no because i used to always do within that function
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:26
Hai Guyz, check out mai codz:
var arr = []
var fn = (function extra(x) {
   arr.push(x.split('').reverse.join(''));
})();

fn = arr[0];
reverseString = fn ? arr[0} : false;
jpjenkins
@jpjenkins
Nov 14 2015 11:27
@Roger8 what is your trouble young man?
Roger8
@Roger8
Nov 14 2015 11:27

var array = [1, 12, 21, 2];

array.sort(function(a, b) {

return a - b;

});

jpjenkins
@jpjenkins
Nov 14 2015 11:27
@bryan-hatton beautiful! Looks like the governments l33t code they have in their windows 2000 machines
You missed a bit though...
Roger8
@Roger8
Nov 14 2015 11:28
this function will sort the elements from smallest to largest number, it's difficult for me to understand
jpjenkins
@jpjenkins
Nov 14 2015 11:28
var x = "internet secured";
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:28
@jpjenkins lmao
jpjenkins
@jpjenkins
Nov 14 2015 11:28
yeah @Roger8, it does a lot of work in the background
Roger8
@Roger8
Nov 14 2015 11:28
i am confused about that @jpjenkins
jpjenkins
@jpjenkins
Nov 14 2015 11:28
if you want to know the details
check out 'bubble sort'
Pranav Doshi
@pranavdoshi
Nov 14 2015 11:29
@jpjenkins my mistake was the processing i did outside right?
Roger8
@Roger8
Nov 14 2015 11:29
its principle ?
jpjenkins
@jpjenkins
Nov 14 2015 11:29
@pranavdoshi ah yes! Sorry I didn't understand what you were confused about there
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:29
@pranavdoshi Pretty much, It's better practice to box up your code into functions and objects
jpjenkins
@jpjenkins
Nov 14 2015 11:29
bubble sort is an algorithm
Pranav Doshi
@pranavdoshi
Nov 14 2015 11:30
@jpjenkins

function reverseString(str) { return str; }

var str = reverseString("hello");

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

previous code
jpjenkins
@jpjenkins
Nov 14 2015 11:30
@Roger8 it's a quick understanding of what it's actually doing to that 'a' and 'b'
Pranav Doshi
@pranavdoshi
Nov 14 2015 11:30
so the processing shud come inside the function
@jpjenkins
Roger8
@Roger8
Nov 14 2015 11:30
ok,thanks @jpjenkins
CamperBot
@camperbot
Nov 14 2015 11:30
roger8 sends brownie points to @jpjenkins :sparkles: :thumbsup: :sparkles:
:star: 221 | @jpjenkins | http://www.freecodecamp.com/jpjenkins
jpjenkins
@jpjenkins
Nov 14 2015 11:30
exactly @pranavdoshi
Pranav Doshi
@pranavdoshi
Nov 14 2015 11:30
cool
actually in hurry i messed up
:)
thanks
jpjenkins
@jpjenkins
Nov 14 2015 11:31
otherwise, it's just a function returning something, when you could just return something :)
SpanishHero
@SpanishHero
Nov 14 2015 11:31
hello, could somebody help me with this waypoint
Create a class called smaller-image and use it to resize the image so that it's only 100 pixels wide.
Pranav Doshi
@pranavdoshi
Nov 14 2015 11:31
are u doing any projects or pure pro @jpjenkins
jpjenkins
@jpjenkins
Nov 14 2015 11:31
@SpanishHero drop the bomb
SpanishHero
@SpanishHero
Nov 14 2015 11:31
img {
width: 100px;
}
jpjenkins
@jpjenkins
Nov 14 2015 11:31
@pranavdoshi ? pure pro
Pranav Doshi
@pranavdoshi
Nov 14 2015 11:31
pure programming i meant
SpanishHero
@SpanishHero
Nov 14 2015 11:31
i did this, the image is shown correctly
Pranav Doshi
@pranavdoshi
Nov 14 2015 11:31
hehe
SpanishHero
@SpanishHero
Nov 14 2015 11:32
but if i add .smaller-image
the size change
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:32
@SpanishHero The waypoint is looking for you the select via class
jpjenkins
@jpjenkins
Nov 14 2015 11:32
@pranavdoshi ah, no no, just working through ziplines now
Pranav Doshi
@pranavdoshi
Nov 14 2015 11:32
projects in d sense js is much more into dom and events and all and fcc doesnt teach dom and events like dat
jpjenkins
@jpjenkins
Nov 14 2015 11:32
@pranavdoshi reading some books
Pranav Doshi
@pranavdoshi
Nov 14 2015 11:32
@jpjenkins
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:32
@SpanishHero Does the img have smaller-image as a class?
jpjenkins
@jpjenkins
Nov 14 2015 11:33
@pranavdoshi it will teach you those thigns later on
@bryan-hatton probably best to get the whole code here
style and html for context
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:34
@jpjenkins You're probably right, I was hoping for a jugular
@SpanishHero Could you post all your code formatted?
jpjenkins
@jpjenkins
Nov 14 2015 11:34
remember though, if they don't know the problem, a lot of the time questions won't make you know the problem :P
Pranav Doshi
@pranavdoshi
Nov 14 2015 11:34
can u be in touch @jpjenkins ??
wer shud i approach u?
Paul de Wouters
@pdewouters
Nov 14 2015 11:37
can someone help me with the Simon game?
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:43
@pdewouters I'll take a swing
Paul de Wouters
@pdewouters
Nov 14 2015 11:44
@bryan-hatton thanks, so basically, I'm not sure how to approach handling waiting for user to enter sequence before playing next sequence
CamperBot
@camperbot
Nov 14 2015 11:44
pdewouters sends brownie points to @bryan-hatton :sparkles: :thumbsup: :sparkles:
:star: 223 | @bryan-hatton | http://www.freecodecamp.com/bryan-hatton
Jazmine
@medusanxs
Nov 14 2015 11:44
the sleeeeps :P
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:45
@pdewouters why don't you trigger the next sequence from the function that verifies if the user's input is correct
Paul de Wouters
@pdewouters
Nov 14 2015 11:45
ah ok, I'll try that. thanks
DIO
@dhrubesh
Nov 14 2015 11:45
i m in "Waypoint: Nest an Anchor Element within a Paragraph" but is shows error saying "Your p element should have the text "View more " (with a space after it)."
can anyone help me with it?
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:46
@dhrubesh Post your code, do you know how?
DIO
@dhrubesh
Nov 14 2015 11:47

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

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

<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>
<p> view more <a href="http://www.freecatphotoapp.com"> </a> </p>

Bryan Hatton
@bryan-hatton
Nov 14 2015 11:47
explain formatting
CamperBot
@camperbot
Nov 14 2015 11:47
no wiki entry for: formatting
:pencil: click here to create one now!after creating your page type update to reload it here
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:47
explain format
CamperBot
@camperbot
Nov 14 2015 11:47

: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

Jazmine
@medusanxs
Nov 14 2015 11:48
I think your 'view more' should be inside of <a ...></a> @dhrubesh
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:48
@dhrubesh Use triple backticks to get the black background, it helps us find problems in the code
DIO
@dhrubesh
Nov 14 2015 11:49

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

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

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

<p> view more <a href="http://www.freecatphotoapp.com"> </a> </p>>
```

how to use triple backticks?
Jazmine
@medusanxs
Nov 14 2015 11:50
@dhrubesh On top and bottom '```' shift enter
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:50
@dhrubesh Your html is right, but the text is off, which is why the waypoint in blocking it. The <p> should look like View more *cat photos* where 'view more' is normal text and 'cat photos' is a link
jpjenkins
@jpjenkins
Nov 14 2015 11:50
explain format
CamperBot
@camperbot
Nov 14 2015 11:50

: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

Jazmine
@medusanxs
Nov 14 2015 11:51
@bryan-hatton smrt. I have the dumbz :P
DIO
@dhrubesh
Nov 14 2015 11:51
<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>

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

<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>
<p> view more  <a href="http://www.freecatphotoapp.com"> </a>   </p>
@bryan-hatton i did not get u?
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:52
@dhrubesh Yay! So you should capitalize 'view' and put 'cat photos' inside the '<a>' eg
<p>View more <a>cat photos</a></p>
DIO
@dhrubesh
Nov 14 2015 11:53
still the same !

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

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

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

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

Aleksander Gębicki
@Takumar
Nov 14 2015 11:55

@dhrubesh don't add new link at the end of code, but modify existing link earlier:

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

you have this link before your header: <h2>

DIO
@dhrubesh
Nov 14 2015 11:55
<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>

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

<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>
<p> View more  <a href="http://www.freecatphotoapp.com"> cat photos</a>  </p>
Bryan Hatton
@bryan-hatton
Nov 14 2015 11:56
@Takumar Nice catch!
Aleksander Gębicki
@Takumar
Nov 14 2015 11:57
@dhrubesh nice formatting. You can correct formatting or editing earlier post for several minutes, it is better that posting entire code once again especially when chat window is very busy. Longer codes may broke someone elses discussion.
DIO
@dhrubesh
Nov 14 2015 11:57
@Takumar wat shud i modify in that piece of code? can u be a bit clear?
Aleksander Gębicki
@Takumar
Nov 14 2015 11:58

@dhrubesh You have added new line:

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

at the end of code, but you should modify existing link, look upper in your code. Delete this last line and modify earlier link.
After "View more" you have two spaces instead of one.

Bryan Hatton
@bryan-hatton
Nov 14 2015 11:59
@dhrubesh Beside the timestamp of each message there is an ... when you hover your mouse over it. Click it
DIO
@dhrubesh
Nov 14 2015 12:00
@Takumar thnx :) worked :D m new in this so it will take sometime ;)
CamperBot
@camperbot
Nov 14 2015 12:00
dhrubesh sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 746 | @takumar | http://www.freecodecamp.com/takumar
Aleksander Gębicki
@Takumar
Nov 14 2015 12:01
No problem, that's why we try to help each other, we all are learning.
DIO
@dhrubesh
Nov 14 2015 12:02
wat is a "dead link"?
@Takumar ya sure :)
Majd900
@Majd900
Nov 14 2015 12:03
@dhrubesh A link that leads nowhere.
DIO
@dhrubesh
Nov 14 2015 12:04
@Majd900 ohk
how to dead link an " a" element with a "href" attribute?
Aleksander Gębicki
@Takumar
Nov 14 2015 12:06

@dhrubesh you create such link when you are creating template for your site, for example link will be guiding to "about.html" and you don't have such file in your project, so for now you create:

<a href="#">About me</a>

Now "About me" is styled as link, but when you click it nothing happens.

DIO
@dhrubesh
Nov 14 2015 12:07
@Takumar got it !
Kanchan Chawla
@kanchanchawla
Nov 14 2015 12:16
hey everyone,help me with a waypoint
sending u the link
I have completed this but can't understand the logic
how can an array be sorted by doing(a-b) an what are a&b.
m confused
Aleksander Gębicki
@Takumar
Nov 14 2015 12:21
@kanchanchawla 'a' and 'b' are parameters of helper function.
sort() gives two numbers from your array to this helper function as arguments, when your function returns positive value, the numbers reverses the order of elements when negative it saves the order.
Kanchan Chawla
@kanchanchawla
Nov 14 2015 12:22
ok...but how can an array be sorted by just doing (a-b)
Aleksander Gębicki
@Takumar
Nov 14 2015 12:24
@kanchanchawla (a-b) is not sorting it gives hint to "sort()" how to sort your elements. Better read documentation it will explain it better than me. http://www.w3schools.com/jsref/jsref_sort.asp
Kanchan Chawla
@kanchanchawla
Nov 14 2015 12:25
ok..thanks @Takumar
CamperBot
@camperbot
Nov 14 2015 12:25
kanchanchawla sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 747 | @takumar | http://www.freecodecamp.com/takumar
Aleksander Gębicki
@Takumar
Nov 14 2015 12:27

@kanchanchawla your function can make different things with arguments it can be even:

function(a, b) {
  return 1 + a/b - 11*b^2;
}

:-) By default sort() is sorting your elements alphabetically but it is not always suiting you.

GangstaCoder
@GangstaCoder
Nov 14 2015 12:31

var tails;
var heads;

if (flip === 0){
return heads;
}
else {
return tails;
}

Hi Guys...can someone help me with the code in this challenge? (171) It is coming back as undefined.
Rivaan
@rivaanbechan
Nov 14 2015 12:36
Hi guys
I need help :( I don't understand how to do this: Waypoint: Filter Arrays with filter
Vivek
@vivek28111992
Nov 14 2015 12:41
@Takumar
I need your help in Waypoint: Iterate Odd Numbers With a For Loop.ce
check my code
var ourArray = [];

for (var i = 0; i < 10; i += 2) {
  ourArray.push(i);
}

var myArray = [];

// Only change code below this line.
for(var j=1;1<10;i+=2){

  myArray.push(j);

}




// Only change code above this line.

if(typeof(myArray) !== "undefined"){(function(){return myArray;})();}
Rivaan
@rivaanbechan
Nov 14 2015 12:45
@vivek28111992 I think I see the mistake
Jason
@Jauble
Nov 14 2015 12:45
@vivek28111992 you need to fix your for loop: you have j = 1, then 1 < 10 (1 is always going to be less than 10 so you will have an infinite loop), and then you have i += 2.
Aleksander Gębicki
@Takumar
Nov 14 2015 12:45
@vivek28111992 check this line:
for(var j=1;1<10;i+=2){
Rivaan
@rivaanbechan
Nov 14 2015 12:46
@Takumar can you help me please?
Aleksander Gębicki
@Takumar
Nov 14 2015 12:46
@rivaanbechan what's your problem? You don't understand filter()?
Rivaan
@rivaanbechan
Nov 14 2015 12:46
I'm not sure how to complete this challenge... Waypoint: Filter Arrays with filter
Yeah I don't :(
@Takumar Cause they use %... I'm not sure how to get rid of all the numbers greater than 5

var newArray = oldArray;

array = newArray.filter(function(val) {

return val < 5;

});

GangstaCoder
@GangstaCoder
Nov 14 2015 12:47
@Takumar you look like the man of the moment. if you have time please take a squiz at my problem waypoint 171
Vivek
@vivek28111992
Nov 14 2015 12:48
sorry my bad, thanks for pointing out my mistake
Rivaan
@rivaanbechan
Nov 14 2015 12:48
@GangstaCoder How do you get to waypoint 171 in the navigation? Cause I'm not sure how to get there...
Aleksander Gębicki
@Takumar
Nov 14 2015 12:48
arr.filter() is iterating through every element of your array "arr" it passes every element one by one to callback function, then this function should check your condition (in your case if this element is smaller than 5) if it is true, your function returns true, so this element will remain untouched in array, else if you return false it will be removed from 'arr'
GangstaCoder
@GangstaCoder
Nov 14 2015 12:49

var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;

function myFunction() {

// Only change code below this line.

var tails;
var heads;

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

}

Rivaan
@rivaanbechan
Nov 14 2015 12:49
@GangstaCoder dont use var tails and heads
@GangstaCoder return "heads"
GangstaCoder
@GangstaCoder
Nov 14 2015 12:50
ah...thx
Rivaan
@rivaanbechan
Nov 14 2015 12:50
@GangstaCoder return "tails" as string values...
GangstaCoder
@GangstaCoder
Nov 14 2015 12:50
obvious in hindsight....thx
Rivaan
@rivaanbechan
Nov 14 2015 12:50
No worries :)
I still don't get what to do here on my challenge
@GangstaCoder Tell me when you get there... Lol
GangstaCoder
@GangstaCoder
Nov 14 2015 12:51
waypoint no?
Rivaan
@rivaanbechan
Nov 14 2015 12:52
178 Filter Arrays with filter
GangstaCoder
@GangstaCoder
Nov 14 2015 12:52
cool
Rivaan
@rivaanbechan
Nov 14 2015 12:52
I understand what the filter does... Although I don't understand how to complete the challenge :D
Aleksander Gębicki
@Takumar
Nov 14 2015 12:53
@rivaanbechan you should remove values "greater" than 5. Which values are you removing?
Do you remove 5? It is simpler than you thought.
Rivaan
@rivaanbechan
Nov 14 2015 12:54
@Takumar I don't know how to remove the values over 5
@Takumar I'm not sure what to return
@Takumar Should I be using an if statement?
Aleksander Gębicki
@Takumar
Nov 14 2015 12:55
Now you leave values which are smaller than 5, it is not the same as remove greater than 5 :-) Such small puzzle but think about it a little.
tigger
@tanya53
Nov 14 2015 12:56
I just started, first html where do hello world, but there is no on screen editor, there is something like a phone, but can't click on it. what am i supposed to do?
Aleksander Gębicki
@Takumar
Nov 14 2015 12:56
@rivaanbechan your condition is almost good.
3 is less than 5, so you will leave it in your array, but what about 5, should you remove it?
Rivaan
@rivaanbechan
Nov 14 2015 12:58
@Takumar it doesn't say greater than or equal to...
@Takumar So no, you don't remove it
@Takumar I think :D
Aleksander Gębicki
@Takumar
Nov 14 2015 12:59
so in your code: return 5 < 5; is false so filter() will remove it from array and that's wrong.
Always check this border values, if something is less or less than and equal to, or greater or greater than and equal to, it is source of many mistakes!

Once again, your instruction:

"Use filter to remove all elements from array that are greater than 5."

Rivaan
@rivaanbechan
Nov 14 2015 13:01

var newArray = oldArray;

array = newArray.filter(function(val) {
return val < 5;
});

But it doesn't work :(
Thats what I tried in the start
Aleksander Gębicki
@Takumar
Nov 14 2015 13:02
@rivaanbechan read again what I wrote upper. You check your array: [1,2,3,4,5,6]. 1 is less , 2,3,4 is less than 5, but 5 is not less than 5 so filter gets false and removes 5, 6, 7 and rest elements from your array!
// longer version
function(val) {
  if (val < 5) {
    return true; // 1, 2, 3, 4
  }
  else {
    return false; // 5, 6, 7, 8, 9, 10
  }
};
Rivaan
@rivaanbechan
Nov 14 2015 13:04
@Takumar Ok let me try that
Aleksander Gębicki
@Takumar
Nov 14 2015 13:05
@rivaanbechan think only about val < 5 is it good?
Your resulting newArray should be: [1, 2, 3, 4, 5]
Rivaan
@rivaanbechan
Nov 14 2015 13:06
@Takumar no cause it doesn't include 5
Aleksander Gębicki
@Takumar
Nov 14 2015 13:06
@rivaanbechan you are right, so what to do to include also 5?
Rivaan
@rivaanbechan
Nov 14 2015 13:06
@Takumar so maybe I should say val <= 5?
Aleksander Gębicki
@Takumar
Nov 14 2015 13:06
Heureka! :-)
Rivaan
@rivaanbechan
Nov 14 2015 13:06
I tried that too :D :D :D And it doesn't work lmao
I don't know what I'm doing wrong here
flip
:(

var oldArray = [1,2,3,4,5,6,7,8,9,10];

// Only change code below this line.

var newArray = oldArray;

array = newArray.filter(function(val) {
return val <= 5;
});

// Only change code above this line.

(function() { return newArray; })();

Can you see anything wrong?
Aleksander Gębicki
@Takumar
Nov 14 2015 13:08

@rivaanbechan they want you to create resulting values in newArray, whereas you put it in not declared variable "array". Look at test at the end of screen:
(function() { return newArray; })();
You should filter oldArray and assign it to newArray

var newArray = oldArray.filter( ...

Now you have 3 arrays in your code, oldArray, newArray and array, that's too many.

Rivaan
@rivaanbechan
Nov 14 2015 13:10
Oh my word!
@Takumar :clap:
@Takumar You're a genius :sunglasses:
Aleksander Gębicki
@Takumar
Nov 14 2015 13:11
@rivaanbechan nice to hear ;-)
Rivaan
@rivaanbechan
Nov 14 2015 13:11
@Takumar And I'm so blonde lmao
@Takumar Have you finished this course?
Aleksander Gębicki
@Takumar
Nov 14 2015 13:11
@rivaanbechan no, I stopped on chat helping here :-)
Rivaan
@rivaanbechan
Nov 14 2015 13:12
Lol, how far are you?
Aleksander Gębicki
@Takumar
Nov 14 2015 13:12
I haven't done ziplines yet, only basic bonfires and part of intermediate.
But I'm chasing brownie points so if you can say thank you it will be nice ;-)
Rivaan
@rivaanbechan
Nov 14 2015 13:17
@Takumar Thank you :P
Majd900
@Majd900
Nov 14 2015 13:17
Guys any way to pair with people?
I joined that pairing chat room , but it's so inactive.
So any other way?
ubian
@ubian
Nov 14 2015 13:25
How does free code camp work?
jpjenkins
@jpjenkins
Nov 14 2015 13:25
@Takumar why are you interested in brownie points?
I know there are a few pairing chat rooms
did you try them all?
well, maybe there's 2
:)
@ubian code camping without the tent
quite revolutionary really
it's an open source website were you can walk through guided steps to learning javascript, one little brain teaser at a time
Majd900
@Majd900
Nov 14 2015 13:28
@jpjenkins I tried one
jpjenkins
@jpjenkins
Nov 14 2015 13:28
The aim is to gradually increase the skill required until one day you're a full fledged javascript wizard that can code for good causes
@Majd900 what bonfire are you on?
sagar
@sagarbhaila
Nov 14 2015 13:29
me sagar
Aleksander Gębicki
@Takumar
Nov 14 2015 13:29
@jpjenkins I'm addicted to them :cookie: :-) It is easier to get some brownies than to solve big problems and ziplines. In the meantime I still learn by helping others.
Majd900
@Majd900
Nov 14 2015 13:29
@jpjenkins Didn't get into bonfires yet.. still on waypoint [96]
jpjenkins
@jpjenkins
Nov 14 2015 13:30
ah, waypoints are best tried to solve alone I reckon @Majd900
they're your fundamental building blocks
Majd900
@Majd900
Nov 14 2015 13:30
@jpjenkins No i don't need help for waypoints
Just for general coding
jpjenkins
@jpjenkins
Nov 14 2015 13:31
You asked about the pairing?
Majd900
@Majd900
Nov 14 2015 13:31
Like i can build a very simple website as a start with a pair friend
Yeah
jpjenkins
@jpjenkins
Nov 14 2015 13:31
ah, pairing is specific for the fcc interface
Majd900
@Majd900
Nov 14 2015 13:31
What do you mean?
jpjenkins
@jpjenkins
Nov 14 2015 13:31
if you look at the side of the code frame, you can 'pair' with someone to work through the problem together
above 'run test' :)
Aleksander Gębicki
@Takumar
Nov 14 2015 13:32
@rivaanbechan still no brownie :-( @camperbot is sleeping.
sagar
@sagarbhaila
Nov 14 2015 13:32
how to ?You should be displaying the result of the slot numbers in the corresponding slots
Majd900
@Majd900
Nov 14 2015 13:32
I mean like i can build a very simple project with a friend, as a simple start to test my skills with him.
Without getting into bonfires. Does that help?
jpjenkins
@jpjenkins
Nov 14 2015 13:33
I'm not sure if it would
Majd900
@Majd900
Nov 14 2015 13:33
Oh bonfires are essential?
jpjenkins
@jpjenkins
Nov 14 2015 13:33
bonfires introduce you to javascript
Majd900
@Majd900
Nov 14 2015 13:33
Ah then it is :D
jpjenkins
@jpjenkins
Nov 14 2015 13:33
well, the first is the basic algorithms
yeah, it's kind of where the meat of the course starts :)
don't worry though, after your algorithms, you'll be introduced to ziplines
Majd900
@Majd900
Nov 14 2015 13:34
Cause it's so fun to pair with someone
jpjenkins
@jpjenkins
Nov 14 2015 13:34
and your first zipline is to create a website!
Majd900
@Majd900
Nov 14 2015 13:34
:O!
sagar
@sagarbhaila
Nov 14 2015 13:34

<script>
function runSlots() {
var slotOne = $($(".slot")[0]).html(slotOne);
var slotTwo = $($(".slot")[0]).html(slotTwo);
var slotThree = $($(".slot")[0]).html(slotThree);

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

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;
var slotOne = $($(".slot")[0]).html(slotOne);
var slotTwo = $($(".slot")[0]).html(slotTwo);
var slotThree = $($(".slot")[0]).html(slotThree);


// Only change code below this line.



// Only change code above this line.

if (slotOne === slotTwo && slotTwo === slotThree) {
$(".logger").html(" It's A Win")
return null;
}

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

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


return [slotOne, slotTwo, slotThree];
}

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

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

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

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

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

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

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

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

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