These are chat archives for FreeCodeCamp/Help

1st
Nov 2015
Huy Nguyen
@gangstafat
Nov 01 2015 00:00
http://d.pr/i/1dHl7 - this is what I'm trying to say to you
@Jrv1 @MattYamamoto thank you :)
CamperBot
@camperbot
Nov 01 2015 00:00
gangstafat sends brownie points to @jrv1 and @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 59 | @jrv1 | http://www.freecodecamp.com/jrv1
:star: 412 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Juan Valdes
@Jrv1
Nov 01 2015 00:08
@gangstafat thanks again gangsta
CamperBot
@camperbot
Nov 01 2015 00:08
jrv1 sends brownie points to @gangstafat :sparkles: :thumbsup: :sparkles:
:warning: jrv1 already gave gangstafat points
Mateja Trifunovski
@Matko95
Nov 01 2015 00:12
Hey guys, anyone here finished the how-to-npm guide?
I'm stuck on the dist-tag
Huy Nguyen
@gangstafat
Nov 01 2015 00:12
@Matko95 may you be more specific at the problem?
I didn't do that guide from FCC but I did npm once
Mateja Trifunovski
@Matko95
Nov 01 2015 00:13
@gangstafat so the task is to add a dist-tag, i ran this npm dist-tag add @linclark/pkg@1.0.2 matko
Rafal Rudzinski
@rrudzinski
Nov 01 2015 00:13
function palindrome(str) { 

  var array = str.toLowerCase().split('');

  var reverseArray = str.toLowerCase().split('').reverse();

  for (i=0; i<str.length; i++) {
    if (array[i] === reverseArray[i]) {
      return true;
    } else {
      return false;
    }
  }
}

palindrome("eye");
my code for palindorme bonfire, works for everything except
palindrome("almostomla”)
palindrome("My age is 0, 0 si ega ym.”)
maybe I am misunderstanding the function of split()
Mateja Trifunovski
@Matko95
Nov 01 2015 00:13
@gangstafat and it always says i failed Uh oh, looks like you still only have a single dist-tag.
Use npm help dist-tag to learn how to add another one.
Huy Nguyen
@gangstafat
Nov 01 2015 00:14
did you try that command?
Mateja Trifunovski
@Matko95
Nov 01 2015 00:14
@rrudzinski everything is cool, but you need to remove special characters like [,.!?]
@gangstafat well it only explains the use of npm dist-tag
Rafal Rudzinski
@rrudzinski
Nov 01 2015 00:15
@Matko95 oh shoot, ok i can figure that out. Thanks!
CamperBot
@camperbot
Nov 01 2015 00:15
rrudzinski sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 436 | @matko95 | http://www.freecodecamp.com/matko95
Rafal Rudzinski
@rrudzinski
Nov 01 2015 00:16
i thought split() removed all special characters for some reason, must have misread that
Matt Yamamoto
@MattYamamoto
Nov 01 2015 00:16
@rrudzinski also, you are using return inside your loop, so the first time you hit that, the loop stops
Anders Bengtsson
@anders462
Nov 01 2015 00:17
Why doesn't this work to show raw weather data. when I replace variable with real cord in url it works fine
 $(document).ready(function(){


   $("#getWeather").on("click", function(){

    if (navigator.geolocation) {
        navigator.geolocation.getCurrentPosition(showPosition);
    } else { 
        $('error').html("Geolocation is not supported by this browser.");
    }


function showPosition(position) {
    var lonPos = position.coords.longitude;
    var latPos = position.coords.latitude;
    var url = "http://api.openweathermap.org/data/2.5/weather?lat=latPos&lon=lonPos&APPID=0b767d3c0a1185c4177b205914aef4c2";

    $.getJSON(url,function(json) {

         $("#data").html(JSON.stringify(json));

    });
}

   });
Rafal Rudzinski
@rrudzinski
Nov 01 2015 00:17
hmm ok now that’s a bigger problem
Mateja Trifunovski
@Matko95
Nov 01 2015 00:18
@anders462 could you post your pen?
Rafal Rudzinski
@rrudzinski
Nov 01 2015 00:18
is there a way in javascript to compare a sring to another string without splitting it up into array of characters?
Nikhil Deorkar
@nikhilnd
Nov 01 2015 00:19
I am stuck on the palindrome bonfire can anyone help me?
Mateja Trifunovski
@Matko95
Nov 01 2015 00:19
@rrudzinski it isn't a problem, just save the true or false value in a variable when you are running through the loop
Huy Nguyen
@gangstafat
Nov 01 2015 00:19
@Matko95 Sorry, I don't think I can help you on that problem. Can you send me the link to that guide?
Mateja Trifunovski
@Matko95
Nov 01 2015 00:20
@gangstafat hmm, not sure if there's a link, gonna try to find it somewhere
Anders Bengtsson
@anders462
Nov 01 2015 00:20
well its basically it, a raw test of output, but here it is
weather
Rafal Rudzinski
@rrudzinski
Nov 01 2015 00:20
@Matko95 gotcha!
Nic Galluzzo
@ngalluzzo
Nov 01 2015 00:21
@anders462 you need to break up the string to us variables
Mateja Trifunovski
@Matko95
Nov 01 2015 00:21
@gangstafat https://github.com/npm/how-to-npm .. here, it's a module teaching about modules, so you need to run it with npm :)
Anders Bengtsson
@anders462
Nov 01 2015 00:21
@Matko95 sorry, here you go http://codepen.io/andben462/full/RWJePJ/
Nic Galluzzo
@ngalluzzo
Nov 01 2015 00:22
"http://api.openweathermap.org/data/2.5/weather?lat="+ latPos + "&lon=" + lonPos + "&APPID=0b767d3c0a1185c4177b205914aef4c2"
Mateja Trifunovski
@Matko95
Nov 01 2015 00:22
@anders462 pen.js:23 getCurrentPosition() and watchPosition() are deprecated on insecure origins, and support will be removed in the future. You should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.
this is the error the browser sends
Anders Bengtsson
@anders462
Nov 01 2015 00:26
@Matko95 ok, but that shouldnt have anything to do with the problem i have, I get the coordinates, but doesn't work when assigned to latPos and lonPos
Mateja Trifunovski
@Matko95
Nov 01 2015 00:26
@anders462 it works after you correct the URL for openweather, as @ngalluzzo posted
Matt Yamamoto
@MattYamamoto
Nov 01 2015 00:27
@anders462 yeah, you're not passing in the variables to the url, you have it as one long string
Juan Valdes
@Jrv1
Nov 01 2015 00:28
Question: I could design an entire modern, flashy website with just html/css?
Mateja Trifunovski
@Matko95
Nov 01 2015 00:29
@Jrv1 Yes you could, but with basic functionality
Juan Valdes
@Jrv1
Nov 01 2015 00:30
@Matko95 sounds good, thank you
CamperBot
@camperbot
Nov 01 2015 00:30
jrv1 sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 437 | @matko95 | http://www.freecodecamp.com/matko95
Matt Yamamoto
@MattYamamoto
Nov 01 2015 00:30
@Jrv1 I think that depends on what you mean by modern.... and by website. If the page is to do something I'd say no (as in interact with data/database)
Anders Bengtsson
@anders462
Nov 01 2015 00:31
@ngalluzzo @Matko95 ahhhhh, thanks guys
CamperBot
@camperbot
Nov 01 2015 00:31
anders462 sends brownie points to @ngalluzzo and @matko95 :sparkles: :thumbsup: :sparkles:
:star: 107 | @ngalluzzo | http://www.freecodecamp.com/ngalluzzo
:star: 438 | @matko95 | http://www.freecodecamp.com/matko95
Huy Nguyen
@gangstafat
Nov 01 2015 00:32
@Matko95 now I have this problem after installing how-to-npm
Mateja Trifunovski
@Matko95
Nov 01 2015 00:33
@gangstafat maybe you didn't install it correctly
Huy Nguyen
@gangstafat
Nov 01 2015 00:33
I can use npm before
it's weird hmm
Juan Valdes
@Jrv1
Nov 01 2015 00:34
@MattYamamoto no just simple graphics and photos
Matt Yamamoto
@MattYamamoto
Nov 01 2015 00:35
@Jrv1 oh, then I agree. yes.
Tom Seymour
@Seytom
Nov 01 2015 00:36
I'm planning on reporting a bug for Waypoint: Converting JSON data to HTML. Procedure says I should inquire here first. The Waypoint is supposed to generate cat photos from the internet, but only produces the dread " [object Object]" 3 times. Interestingly, if I submit the code, it says I pass, but still generates no cat pictures. The bug has been reported before, and is marked as resolved, but issues clearly remain. Does anyone know about this? Is it possible that it is generated locally for only certain configurations, and for most people the bug really is resolved?
Matt Anderson
@MDAWebDev
Nov 01 2015 00:46
I thought the new JSON waypoints were kind of lame since they give you all the code and you just have it copy and paste it to pass.
Matt Yamamoto
@MattYamamoto
Nov 01 2015 00:46
@Seytom yeah, the returned JSON is an object with an imageLink property. That link needs to be added to an img tag. Then it works.
@MDAWebDev I haven't actually gone through them since they've been added, but I think the point is to show poeple how to do it since there were lots of questions when people got to the ziplines.
Matt Anderson
@MDAWebDev
Nov 01 2015 00:48
Another minor bug is that the code for the "Get Geolocation Data" waypoint isn't properly concatenated.

the code they give is is this: ```

if (navigator.geolocation) {

  navigator.geolocation.getCurrentPosition(function(position) {

    $("#data").html("latitiude" + position.coords.latitude + "longitude" + position.coords.longitude);

  });

}

```

if (navigator.geolocation) {

  navigator.geolocation.getCurrentPosition(function(position) {

    $("#data").html("latitiude" + position.coords.latitude + "longitude" + position.coords.longitude);

  });

}
Should be
if (navigator.geolocation) {

  navigator.geolocation.getCurrentPosition(function(position) {

    $("#data").html("latitiude " + position.coords.latitude + "longitude " + position.coords.longitude);

  });

}
Tom Seymour
@Seytom
Nov 01 2015 01:00
This message was deleted
CamperBot
@camperbot
Nov 01 2015 01:00
:bulb: to format code use backticks! ``` more info
Tom Seymour
@Seytom
Nov 01 2015 01:01
@MDAWebDev I sort of thought so too, but there's definitely value in demonstration I guess. @MattYamamoto I tried substituting an image link, which got rid of the [object Object]s, and put 3 generic image icons, but still no cats. I did it like this: "<img src="+val+ " >" Am I missing something?
Matt Yamamoto
@MattYamamoto
Nov 01 2015 01:04
@Seytom you're missing the quotes around the src val: `"<img src='"+val+ "' >"
@Seytom although I think this is by design as the next waypoint does this. I think they should just be more explicit about what is expected on the screen at this point
@Seytom oh, and it's val.imageLink
that is missing on those waypoints
Tom Seymour
@Seytom
Nov 01 2015 01:09
@MattYamamoto thanks, I was definitely missing them, but still doesn't get me cats! http://tse2.mm.bing.net/th?id=OIP.M0aad3eaf54dfbe5e0c6e8499aab69ef5o0&pid=15.1
CamperBot
@camperbot
Nov 01 2015 01:09
seytom sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 416 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Matt Yamamoto
@MattYamamoto
Nov 01 2015 01:10
@Seytom
var html = "";
  json.map(function(val) {

    html = html + "<div class = 'cat'>";

    html = html + '<div><img src="' + val.imageLink + '"></div>';

    html = html + "</div><br/>";

  });
Tom Seymour
@Seytom
Nov 01 2015 01:10
thanks, hadn't seen your comment about val.imageLink when I posted
CamperBot
@camperbot
Nov 01 2015 01:10
if you want to thank someone, put an @ before their name!
Tom Seymour
@Seytom
Nov 01 2015 01:12
@MattYamamoto Got cats!! Thanks again!
"imageLink" is just an arbitrary name of the property of the object, yes? Not some magical function that finds image urls in objects that we can use in the future?
Matt Yamamoto
@MattYamamoto
Nov 01 2015 01:16
@Seytom right, it's whatever that data source decided to use for the JSON property name
basically I just threw a console.log(val) in there and ran it and took a look at what was being used.
Molbee
@Molbee
Nov 01 2015 01:24
@MattYamamoto thanks, got it sorted
CamperBot
@camperbot
Nov 01 2015 01:24
molbee sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 417 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Yelso
@YelsoYanez
Nov 01 2015 01:53
Hello, can any one help me, I do not understand where to add the 10px.
blob
any help will be really appreciated
Seth Calkins
@SethCalkins
Nov 01 2015 01:54
This message was deleted
@YelsoYanez <img class="smaller-image thick-green-border" scr="https://bit.ly/fcc-relaxing-cat" border="10px">
Matt Yamamoto
@MattYamamoto
Nov 01 2015 01:59
@YelsoYanez it should be added in your style (which it is), I believe there is a bug on that page. Send me a link please
Seth Calkins
@SethCalkins
Nov 01 2015 02:01
have you tried border-image-width?
Matt Yamamoto
@MattYamamoto
Nov 01 2015 02:01

@YelsoYanez passes for me. Try highlighting all this in your code

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

and hitting tab

then submit... or try refreshing the page... actually, I should have suggested that first
@YelsoYanez
Yelso
@YelsoYanez
Nov 01 2015 02:02
Ok, ill try. Does the browser makes any difference?
Matt Yamamoto
@MattYamamoto
Nov 01 2015 02:02
@SethCalkins I believe that is used for when you have an image as the border, but I could be mistaken
@YelsoYanez shouldn't but you could try a different one. I only offer the tab trick because I just helped somebody with this earlier and that was the issue/bug
Seth Calkins
@SethCalkins
Nov 01 2015 02:04
@MattYamamoto you are correct I just looked up the reference guide.
Yelso
@YelsoYanez
Nov 01 2015 02:05
Ok, thanks I think i dealing with a bug. I understand there are problems with browsers. I had some issues with code academy before using firefox, now I use opera and there are very little mistakes when i'm coding. thanks for the help guys.
CamperBot
@camperbot
Nov 01 2015 02:05
if you want to thank someone, put an @ before their name!
Yelso
@YelsoYanez
Nov 01 2015 02:06
@MattYamamoto thanks
CamperBot
@camperbot
Nov 01 2015 02:06
yelsoyanez sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 418 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Matt Yamamoto
@MattYamamoto
Nov 01 2015 02:06
@YelsoYanez yeah, I think this is a bug on that particular page... but as long as you get it working, that's all that matters for now!
Yelso
@YelsoYanez
Nov 01 2015 02:06
and thanks @SethCalkins
CamperBot
@camperbot
Nov 01 2015 02:06
yelsoyanez sends brownie points to @sethcalkins :sparkles: :thumbsup: :sparkles:
:star: 9 | @sethcalkins | http://www.freecodecamp.com/sethcalkins
Yelso
@YelsoYanez
Nov 01 2015 02:13
I found the solution, it turns out that if you write 11px instead of 10px it will work.
blob
Matt Yamamoto
@MattYamamoto
Nov 01 2015 02:14
@YelsoYanez well that certainly shouldn't work (and doesn't for me)... very strange bug
@YelsoYanez would you try submitting that one more time that way and telling me if it works?
Yelso
@YelsoYanez
Nov 01 2015 02:15
I found it reading through this post FreeCodeCamp/FreeCodeCamp#3673
intersting
i guess all comes to the browser type.
Matt Yamamoto
@MattYamamoto
Nov 01 2015 02:17
oh, well there is already an issue on github. . . then nvm, I was going to report it, but not necessary
Yelso
@YelsoYanez
Nov 01 2015 02:19
you should still do it, it will help everyone else who may run through the same issue in the future
Matt Yamamoto
@MattYamamoto
Nov 01 2015 02:20
@YelsoYanez is your screen zoom level at 100%?
Yelso
@YelsoYanez
Nov 01 2015 02:21
why?
Matt Yamamoto
@MattYamamoto
Nov 01 2015 02:22
it needs to be at 100%. try setting it to 100% and using 10px again
Yelso
@YelsoYanez
Nov 01 2015 02:22
Ok, i'll try.
same error.
Matt Yamamoto
@MattYamamoto
Nov 01 2015 02:24
@YelsoYanez okay, thanks for checking.
CamperBot
@camperbot
Nov 01 2015 02:24
mattyamamoto sends brownie points to @yelsoyanez :sparkles: :thumbsup: :sparkles:
:star: 26 | @yelsoyanez | http://www.freecodecamp.com/yelsoyanez
Yelso
@YelsoYanez
Nov 01 2015 02:25
thanks to you for all the help @MattYamamoto
CamperBot
@camperbot
Nov 01 2015 02:25
yelsoyanez sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:warning: yelsoyanez already gave mattyamamoto points
Bruhman503
@Bruhman503
Nov 01 2015 02:33

can anyone help me with the "make object properties private" waypoint? The last step is to make the method getSpeed of myBike to be accessible outside the object. here is the code:

// Only change code below this line.

function addUnit(value) {
this.speed = 100;
return value + "KM/H";

}

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

};

// Only change code above this line.

Matt Yamamoto
@MattYamamoto
Nov 01 2015 02:38
@Bruhman503 it all has to do with the keyword this
Juan Valdes
@Jrv1
Nov 01 2015 02:38
Question: Everything that i'll learn on freecodecamp is the proper way of coding correct?
Bruhman503
@Bruhman503
Nov 01 2015 02:39
@MattYamamoto I feel like I should understand what you are talking about....except I have no idea.
Matt Yamamoto
@MattYamamoto
Nov 01 2015 02:40
@Bruhman503 sorry, I'm still explaining, but I got distracted
so var speed = .... will be private, but this.speed = ... will be public. Same is true for methods (functions)
The this keyword inside of the constructor function means that any objects made with that constructor (that is anytime you do new to create a new object) will have the property accessible yourObject.yourProperty
does that make sense?
Bruhman503
@Bruhman503
Nov 01 2015 02:43
@MattYamamoto somewhat. Unfortunately I have ALOT of difficulty reading javascript....so I'm positive it isn't you. haha
Matt Yamamoto
@MattYamamoto
Nov 01 2015 02:43
@Jrv1 well yes and no. Yes in that I think everything you see tries to show best practice, but since you're being shown the pieces or tools it can depend on how you put those pieces together (or how you use the tools together)
@Bruhman503 well I will say that the this keyword and objects is pretty tricky and is something that a lot of people don't understand (I still struggle with it from time to time)
let me see if I can break it down a little bit more for you
Bruhman503
@Bruhman503
Nov 01 2015 02:44
@MattYamamoto I appreciate that. Thanks.
CamperBot
@camperbot
Nov 01 2015 02:44
bruhman503 sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 419 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Matt Yamamoto
@MattYamamoto
Nov 01 2015 02:46
You have a function constructor in that example: it's the var Bike = function() { .... part. All that means is that it's a function, hence then function() { .. after the equal sign, that when called with the new keyword (as in new Bike()) creates an object.
so, that means the line that reads var MyBike = new Bike() creates an object using the Bike constructor function and stores it in the var myBike
@Bruhman503 follow so far?
Bruhman503
@Bruhman503
Nov 01 2015 02:47
@MattYamamoto fully.
Matt Yamamoto
@MattYamamoto
Nov 01 2015 02:48
inside the constructor function you can define properties and methods for the object. If you want those to be accessible publicly for objects created with that contstructor function you use the this keyword. this refers to the object created by the construcor function.
Bruhman503
@Bruhman503
Nov 01 2015 02:48
@MattYamamoto still following
Matt Yamamoto
@MattYamamoto
Nov 01 2015 02:49
so this.speed = 100 inside of the constructor function means that when you creat the myBike object var myBike = new Bike(), that object now has the property speed, so myBike.speed is 100. So the keyword is referencing the object... so for myBike, this is myBike
but if you omit the this keyword inside the constructor function by say simply doing var speed = 100; then that value is available inside the constructor function (to be used in method functions or whatever) but will not be a publicly accessible property on objects that are created by the constructor. so if you made that change then myBike.speed would be undefined
same goes for methods
Bruhman503
@Bruhman503
Nov 01 2015 02:51
@MattYamamoto I just solved it.
@MattYamamoto how the hell did you do that? haha.
Matt Yamamoto
@MattYamamoto
Nov 01 2015 02:52
@Bruhman503 very well done.
@Bruhman503 do what?
Bruhman503
@Bruhman503
Nov 01 2015 02:52
@MattYamamoto Let me explain
@MattYamamoto Originally I attended school for programming and barely managed to get a 2 year degree...I thought I just couldn't grasp it. 4 years later I realized I just had really bad professors. the way you explained it SHOULD have been the way they explain. Somehow you managed to give me the A-ha moment without telling me the answer.
@MattYamamoto So I'm impressed at the way you managed to get the gears going in my own head.
Matt Yamamoto
@MattYamamoto
Nov 01 2015 02:56
@Bruhman503 haha, well glad I could help. I did/watched the "Javascript: Understanding the Weird Parts" on Udemy (the instructor is Anthony Alicea) which was super clear and concise... it really helped me get a better handle on stuff. The course isn't free, but there are usually deals you can find for those courses. Also, I think there is a selection from that course on YouTube.
so I'm just lucky to have had good instruction myself!
Bruhman503
@Bruhman503
Nov 01 2015 02:57
@MattYamamoto I actually have that course myself. I haven't started it yet though. Good to know it helps
Sue
@Sueswebdesign
Nov 01 2015 02:57
I have been stuck on assigning a gray background to my div element. I got the first part...creating a class called gray-background... but I just cannot seem to figure out how to actually get the background gray.
Matt Yamamoto
@MattYamamoto
Nov 01 2015 02:57
@Bruhman503 yeah, it's super good, I highly recommend it.
@Sueswebdesign did you give that class to your div element? <div class="">
Sue
@Sueswebdesign
Nov 01 2015 02:59
Yes I did. <div class="gray-background"> The first challenge worked (green check mark).
Matt Yamamoto
@MattYamamoto
Nov 01 2015 03:00
and you have that style in the style tags?
Sue
@Sueswebdesign
Nov 01 2015 03:00
Uh...no....
Matt Yamamoto
@MattYamamoto
Nov 01 2015 03:00
.gray-background {
       //style stuff in here
}
oh well try that... know how?
Sue
@Sueswebdesign
Nov 01 2015 03:02
I tried that <div .gray-background { background-color: gray; }> and it is not working...
Matt Yamamoto
@MattYamamoto
Nov 01 2015 03:02
which waypoint is this?
Sue
@Sueswebdesign
Nov 01 2015 03:03
Waypoint: Give a Background Color to a Div Element
Matt Yamamoto
@MattYamamoto
Nov 01 2015 03:03
And okay, you had your div right the first way: <div class="gray-background"> so put that back
Sue
@Sueswebdesign
Nov 01 2015 03:03
It's for the cat photoapp.
It's there.
I never took the div class out.
Matt Yamamoto
@MattYamamoto
Nov 01 2015 03:05
@Sueswebdesign okay, that assigns the class to the div, but we still need to create the style
so up in the style section ( btween the <style> </style> tags) create a new class similar to say the thick-green-border
except this one will obviously be named gray-background and have different stuff inside
Sue
@Sueswebdesign
Nov 01 2015 03:06
Okay. So I have to go back up to the style section....
I was starting to think along those lines but got stuck with staying down in the div element.
Matt Yamamoto
@MattYamamoto
Nov 01 2015 03:07
yes, that's where we define the styles. that way when the browser gets to your div and sees the gray-background class it knows where to go look to find the style (in the style tags)
Sue
@Sueswebdesign
Nov 01 2015 03:07
@MattYamamoto Thank you very much. Okay. that is starting to make sense. :)
CamperBot
@camperbot
Nov 01 2015 03:07
sueswebdesign sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 420 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Matt Yamamoto
@MattYamamoto
Nov 01 2015 03:08
@Sueswebdesign yup, you're working in two different places. Eventually you'll be working on stuff where you put the style stuff in a whole seperate file. . but that's for later.
Sue
@Sueswebdesign
Nov 01 2015 03:08
I will see if I can figure it out! Yes, baby steps right now!
@MattYamamoto Again, thank you.
CamperBot
@camperbot
Nov 01 2015 03:08
sueswebdesign sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:warning: sueswebdesign already gave mattyamamoto points
Matt Yamamoto
@MattYamamoto
Nov 01 2015 03:09
very welcome
Sue
@Sueswebdesign
Nov 01 2015 03:11
@MattYamamoto Woo-Hoo! It worked!!
Matt Yamamoto
@MattYamamoto
Nov 01 2015 03:13
@Sueswebdesign nice!
Bruhman503
@Bruhman503
Nov 01 2015 03:26

last one for me. After googling a few different things for the "make instances of objects with a constructor function" waypoint I came up with this code:

var Car = function() {
this.wheels = 4;
};

// Only change code below this line.
var myCar = new Car();

function Car(){
this.wheels = 4;
this.engine = 1;
}

// Only change code above this line.
(function() {return JSON.stringify(myCar);})();

My error message says that the property of engines should be a number....yet it is already. Is there some reason why this would not work?

Leeia Isabelle
@Leeiaisabelle
Nov 01 2015 03:27
hey guys! Would anyone mind explaining the reason behind the solution for the Palindromes Bonfire? Thanks!
CamperBot
@camperbot
Nov 01 2015 03:27
if you want to thank someone, put an @ before their name!
joeneuman
@joeneuman
Nov 01 2015 03:32

http://freecodecamp.com/challenges/waypoint-use-conditional-logic-with-if-and-else-statements

Having a hard time thinking through the logic of (1 - 0 + 1)) + 0; instead of 2;

Matt Yamamoto
@MattYamamoto
Nov 01 2015 03:36
@joeneuman it's simply a formula, that's all
that way you could get a random number in any range... normally I assume one would reduce it though.
@Bruhman503 I just sat down again, if you're still having issues, one sec.. let me look
Bruhman503
@Bruhman503
Nov 01 2015 03:38
@MattYamamoto unfortunately I am. I'm just confused why something like this wouldn't work.
Namrata Kayastha
@namkay
Nov 01 2015 03:39
Hey guys! I need help with "Waypoint: Give your JavaScript Slot Machine some Stylish Images"
Matt Yamamoto
@MattYamamoto
Nov 01 2015 03:40
@Bruhman503 okay, that's because the function constructor is already defind at the top, so you don't need (and in fact shouldn't) write another function named Car. Once you create an object, as you did with var myCar = new Car() you can add properties to that specific object with dot notation myCar.newprop = whatever
Namrata Kayastha
@namkay
Nov 01 2015 03:40
I think there is a bug in this Waypoint 45 from JavaScript. Please help if anyone knows the solution to this problem.
Bruhman503
@Bruhman503
Nov 01 2015 03:41
@MattYamamoto ah..I see. So "this" isn't needed.
Matt Yamamoto
@MattYamamoto
Nov 01 2015 03:42
@Bruhman503 right, that's only used in the constructor, and if it is that property will be applied to every object created from that constructor. useing the dot notation adds the new property to only one particular object
also, you don't need any of :
function Car(){
this.wheels = 4;
this.engine = 1;
}
@namkay what's the problem?
Namrata Kayastha
@namkay
Nov 01 2015 03:46
@MattYamamoto I have written this code $($('.slot')[0]).html('<img src = "' + images[slotOne-1] + '">');
for each slot but still it says "Use the provided code three times. One for each slot."
@MattYamamoto My code looks like: $($(".slot")[0]).html("<img src = '" + images[slotOne-1] + "'>");
$($(".slot")1).html("<img src = '" + images[slotTwo-1] + "'>");
$($(".slot")[2]).html("<img src = '" + images[slotThree-1] + "'>");
Matt Yamamoto
@MattYamamoto
Nov 01 2015 03:49
@namkay your second line is missing brackets [ ] around the 1
Namrata Kayastha
@namkay
Nov 01 2015 03:51
@MattYamamoto Brackets are there,i checked each of them. I don't know why it appears like that. I just copied and pasted as it is.
Matt Yamamoto
@MattYamamoto
Nov 01 2015 03:52
@namkay paste in the link
Matt Yamamoto
@MattYamamoto
Nov 01 2015 03:53
@namkay no, sorry, I meant with your code in there too, just copy your url for me and I can see all your code
Namrata Kayastha
@namkay
Nov 01 2015 03:55
@MattYamamoto Sorry. Do you mean like this? http://freecodecamp.com/challenges/waypoint-give-your-javascript-slot-machine-some-stylish-images#?solution=fccss%0A%20%20function%20runSlots()%7B%0A%20%20%20%20var%20slotOne%3B%0A%20%20%20%20var%20slotTwo%3B%0A%20%20%20%20var%20slotThree%3B%0A%20%20%20%20%0A%20%20%20%20var%20images%20%3D%20%5B%22http%3A%2F%2Fi.imgur.com%2F9H17QFk.png%22%2C%20%22http%3A%2F%2Fi.imgur.com%2F9RmpXTy.png%22%2C%20%22http%3A%2F%2Fi.imgur.com%2FVJnmtt5.png%22%5D%3B%0A%20%20%20%20%0A%20%20%20%20slotOne%20%3D%20Math.floor(Math.random()%20*%20(3%20-%201%20%2B%201))%20%2B%201%3B%0A%20%20%20%20slotTwo%20%3D%20Math.floor(Math.random()%20*%20(3%20-%201%20%2B%201))%20%2B%201%3B%0A%20%20%20%20slotThree%20%3D%20Math.floor(Math.random()%20*%20(3%20-%201%20%2B%201))%20%2B%201%3B%0A%20%20%20%20%0A%20%20%20%20%24('.logger').html('')%3B%0A%20%20%20%20%24('.logger').html('Not%20A%20Win')%3B%0A%20%20%20%20%0A%20%20%20%20%2F%2F%20Only%20change%20code%20below%20this%20line.%0A%20%20%20%20%24(%24(%22.slot%22)%5B0%5D).html(%22%3Cimg%20src%20%3D%20'%22%20%2B%20images%5BslotOne-1%5D%20%2B%20%22'%3E%22)%3B%0A%20%20%20%20%24(%24(%22.slot%22)%5B1%5D).html(%22%3Cimg%20src%20%3D%20'%22%20%2B%20images%5BslotTwo-1%5D%20%2B%20%22'%3E%22)%3B%0A%20%20%20%20%24(%24(%22.slot%22)%5B2%5D).html(%22%3Cimg%20src%20%3D%20'%22%20%2B%20images%5BslotThree-1%5D%20%2B%20%22'%3E%22)%3B%0A%20%20%20%0A%20%20%20%20%2F%2F%20Only%20change%20code%20above%20this%20line.%0A%20%20%20%20%0A%20%20%20%20if%20(slotOne%20%3D%3D%3D%20slotTwo%20%26%26%20slotTwo%20%3D%3D%3D%20slotThree)%20%7B%0A%20%20%20%20%20%20return%20slotOne%3B%0A%20%20%20%20%7D%0A%20%20%20%20%0A%20%20%20%20if(slotOne%20!%3D%3D%20undefined%20%26%26%20slotTwo%20!%3D%3D%20undefined%20%26%26%20slotThree%20!%3D%3D%20undefined)%7B%0A%20%20%20%20%20%20%24('.logger').html(slotOne)%3B%0A%20%20%20%20%20%20%24('.logger').append('%20'%20%2B%20slotTwo)%3B%0A%20%20%20%20%20%20%24('.logger').append('%20'%20%2B%20slotThree)%3B%0A%20%20%20%20%7D%0A%20%20%20%20%0A%20%20%20%20return%20%5BslotOne%2C%20slotTwo%2C%20slotThree%5D%3B%0A%20%20%7D%0A%0A%20%20%24(document).ready(function()%7B%0A%20%20%20%20%20%24('.go').click(function()%7B%0A%20%20%20%20%20%20%20runSlots()%3B%0A%20%20%20%20%20%7D)%3B%0A%20%20%20%7D)%3B%0Afcces%0A%20%0A%3Cdiv%3E%0A%20%3Cdiv%20class%20%3D%20'container%20inset'%3E%0A%20%20%20%3Cdiv%20class%20%3D%20'header%20inset'%3E%0A%20%20%20%20%20%3Cimg%20src%3D'https%3A%2F%2Fs3.amazonaws.com%2Ffreecodecamp%2Ffreecodecamp_logo.svg.gz'%20alt%3D'learn%20to%20code%20javascript%20at%20Free%20Code%20Camp%20logo'%20class%3D'img-responsive%20nav-logo'%3E%0A%20%20%20%20%20%3Ch2%3EFCC%20Slot%20Machine%3C%2Fh2%3E%0A%20%20%20%3C%2Fdiv%3E%0A%20%20%20%3Cdiv%20class%20%3D%20'slots%20inset'%3E%0A%20%20%20%20%20%3Cdiv%20class%20%3D%20'slot%20inset'%3E%0A%20%20%20%20%20%20%20%0A%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%20%3Cdiv%20class%20%3D%20'slot%20inset'%3E%0A%20%20%20%20%20%20%20%0A%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%20%3Cdiv%20class%20%3D%20'slot%20inset'%3E%0A%20%20%20%20%20%20%20%0A%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%3C%2Fdiv%3E%0A%20%20%20%3Cbr%2F%3E%0A%20%20%20%3Cdiv%20class%20%3D%20'outset'%3E%0A%20%20%20%20%20%3Cbutton%20class%20%3D%20'go%20inset'%3E%0A%20%20%20%20%20%20%20Go%0A%20%20%20%20%20%3C%2Fbutton%3E%0A%20%20%20%3C%2Fdiv%3E%0A%20%20%20%3Cbr%2F%3E%0A%20%20%20%3Cdiv%20class%20%3D%20'foot%20inset'%3E%0A%20%20%20%20%20%3Cspan%20class%20%3D%20'logger'%3E%3C%2Fspan%3E%0A%20%20%20%3C%2Fdiv%3E%0A%20%3C%2Fdiv%3E%0A%3C%2Fdiv%3E%0A%0A%3Cstyle%3E%0A%20.slot%20%3E%20img%20%7B%0A%20%20margin%3A%200!important%3B%0A%20%20height%3A%2071px%3B%0A%20%20width%3A%2050px%3B%0A%20%7D%0A%20.container%20%7B%0A%20%20%20background-color%3A%20%234a2b0f%3B%0A%20%20%20height%3A%20400px%3B%0A%20%20%20width%3A%20260px%3B%0A%20%20%20margin%3A%2050px%20auto%3B%0A%20%20%20border-radius%3A%204px%3B%0A%20%7D%0A%20.header%20%7B%0A%20%20%20border%3A%202px%20solid%20%23fff%3B%0A%20%20%20border-radius%3A%204px%3B%0A%20%20%20height%3A%2055px%3B%0A%20%20%20margin%3A%2014px%20auto%3B%0A%20%20%20background-color%3A%20%23457f86%0A%2
Matt Yamamoto
@MattYamamoto
Nov 01 2015 03:56
yeah, but for some reason that's not working for me
Namrata Kayastha
@namkay
Nov 01 2015 03:57
@MattYamamoto Sorry I have no idea what I'm doing. How do I show you my code?
Matt Yamamoto
@MattYamamoto
Nov 01 2015 03:57
if you just copy the url from the actual page you're working on... which is what I assume what you did, but it's not working for me
@namkay nevermind, I found the issue I think
Namrata Kayastha
@namkay
Nov 01 2015 03:58
@MattYamamoto I did copied from the same page but the url is too long and unusual.
Matt Yamamoto
@MattYamamoto
Nov 01 2015 03:59
you need to use single quotes and double quotes exactly as the example uses (you have them switched)
@namkay yeah, the url actual encodes your work from the window... that way you can share your code with somebody else.
anyway, I have to run. . sorry... but I think my suggestion should help you.
Namrata Kayastha
@namkay
Nov 01 2015 04:00
@MattYamamoto I tried that too by copying exactly the same for slotOne and just changing the index and name for slotTwo and slotThree, but it didn't work either.
@MattYamamoto That's fine. Thank you for your help.
CamperBot
@camperbot
Nov 01 2015 04:01
namkay sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 423 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Kevin Diem
@kgdiem
Nov 01 2015 04:14
Can I get a little help w my simon game? For some reason the moves array isn't resetting
http://codepen.io/kgdiem/pen/qOoGWo
I've put moves = []; in a few places to no avail, but here is one such instance
function newRound(){
  moves = [];
  sequence.push(Math.floor((Math.random() * 4)));
  console.log(sequence);
  lightUp();
  return playerRound();
}
Z.G.Hao
@akidox
Nov 01 2015 04:25
Why can't I enter freecodecamp's sites anymore,'502 Bad Gateway'
I use Safari
Kevin Diem
@kgdiem
Nov 01 2015 04:30
idk, @akidox its working for me. Have you tried clearing your cache?
Laura Stephenson
@lauralstephenson
Nov 01 2015 04:39
Waypoint 78, Waypoint: Make Instances of Objects with a Constructor Function. The directions say I haven't The property engines of myCar should be a number. Here's my code:

var Car = function() {
this.wheels = 4;
};

// Only change code below this line.
var myCar = new Car(); {

this.engines = 4;

this.wheels = 4;

}

// Only change code above this line.
(function() {return JSON.stringify(myCar);})();```

Anyone know what I'm missing, or added incorrectly?
Herman Fassett
@HermanFassett
Nov 01 2015 04:43
You have to use the instance
myCar not this
since you aren't in the object but applying to its instance
Z.G.Hao
@akidox
Nov 01 2015 04:44
It didn't work @lauralstephenson
Laura Stephenson
@lauralstephenson
Nov 01 2015 04:55
Herman, I don't understand...akidox, no, it didn't work.
The property wheels should still be 4 in the object constructor. Y
There should not be a property engines in the object constructor. Y
The property wheels of myCar should equal 4. Y
The property engines of myCar should be a number. N
Herman Fassett
@HermanFassett
Nov 01 2015 04:58
myCar.engines = 4?
Laura Stephenson
@lauralstephenson
Nov 01 2015 05:02
It says that engines should be a number, but since I am supposedly applying properties, I would assume that it should be 4 as well.
Laura Stephenson
@lauralstephenson
Nov 01 2015 05:13
Herman, is myCar.engines = 4? a valid programming line?
Herman Fassett
@HermanFassett
Nov 01 2015 05:16
Well without the question mark
if you have an instance called myCar then myCar.engines = 4; is valid
Laura Stephenson
@lauralstephenson
Nov 01 2015 05:18
Still doesn't work. Let me put in the code again. Here's what the directions say:

Waypoint: Make Instances of Objects with a Constructor Function
Sometimes you'll want to be able to easily create many copies of an objects that all share the same methods.

Objects have their own attributes, called properties, and their own functions, called methods.

You can create instances of an object using a constructor.

A constructor is a function that creates instances of an object that share the same methods and properties

Each new instance of this object inherits all the properties and methods of your original object.

Once an instance has been created you can add properties to that instance individually.

Add an engines property with a number value to the myCar instance.

```

var Car = function() {
this.wheels = 4;
};

// Only change code below this line.

var myCar = new Car(); {

engines = 4;

this.wheels = 4;

}

// Only change code above this line.
(function() {return JSON.stringify(myCar);})(); ```

Herman Fassett
@HermanFassett
Nov 01 2015 05:21
You don't need to set wheels outside of the Car function, and it should be myCar.engines
Laura Stephenson
@lauralstephenson
Nov 01 2015 05:23
thanks. @HermanFassett !
CamperBot
@camperbot
Nov 01 2015 05:23
lauralstephenson sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 499 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Laura Stephenson
@lauralstephenson
Nov 01 2015 05:30

New issue: Waypoint 79 Waypoint: Iterate over Arrays with map
The map method is a convenient way to iterate through arrays. Here's an example usage:

var timesFour = array.map(function(val){

  return val*4;

});
Use the map function to add 3 to every value in the variable array.

You should add three to each value in the array. X
You should be making use of the map method. Y
You should only modify the array with map. Y
Here's my code: ```

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

// Only change code below this line.

var newArray = oldArray;

var plusThree = newArray.map(function(val){

  return val+3;

});

// Only change code above this line.

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

Daniel Cramer
@cr4m3r
Nov 01 2015 05:36
I would reduce the number of arrays you're creating. You're starting off with oldArray, then copying that to newArray, then copying and adding three into another array called plusThree
you could get a solution without creating any new arrays
Thomson Muriyadan
@thedigitalmonk
Nov 01 2015 05:37
Why don't you just do .map() on oldArray? No need to create a new array. Besides look at the code below. It is returning newArray
But your newArray = oldArray and that's why you are not passing this challenge.
Herman Fassett
@HermanFassett
Nov 01 2015 05:38
My old solution for that waypoint isn't passing
Thomson Muriyadan
@thedigitalmonk
Nov 01 2015 05:40
What was your old solution?
Laura Stephenson
@lauralstephenson
Nov 01 2015 05:41
Got it! Thanks @cr4m3r !
CamperBot
@camperbot
Nov 01 2015 05:41
lauralstephenson sends brownie points to @cr4m3r :sparkles: :thumbsup: :sparkles:
:star: 204 | @cr4m3r | http://www.freecodecamp.com/cr4m3r
Daniel Cramer
@cr4m3r
Nov 01 2015 05:41
weird, neither is mine
and i did it two or three days ago
but it's sending the right stuff to the console
Laura Stephenson
@lauralstephenson
Nov 01 2015 05:46
Waypoint 81 Use filter to remove all elements from array that are greater than 5. I am screwing up how I do this...

array = array.filter(function(val) {

  return val <6 === 1;

});

Hans van Riet
@hansinla
Nov 01 2015 05:49
@lauralstephenson You problem is in this line:
return val <6 === 1;
Laura Stephenson
@lauralstephenson
Nov 01 2015 05:52

I figured that out, hasinla. How do I specify that the return vals are all greater than five? He'res the sample code we're given for that waypoint: array = array.filter(function(val) {

  return val % 2 === 0;

});

The <6 is incorrect in coding.
Hans van Riet
@hansinla
Nov 01 2015 05:54
@lauralstephenson (val < 6) returns true if the val is smaller than six and that’s what you want.
Laura Stephenson
@lauralstephenson
Nov 01 2015 05:58

hansinla, it still doesn't run: array = array.filter(function(val) {

  return(val < 6);

});

This also doesn't work: ```

array = array.filter(function(val) {

  return val(val < 6);

});

Steve Traynor
@Effriam
Nov 01 2015 06:01
Hey all. Working on a bonfire. It doesn't pass the arguments to check, and I'm unsure how to pull them. Can I buy a clue?
Daniel Cramer
@cr4m3r
Nov 01 2015 06:02
I think something is up with those waypoints...I did them a few days ago, but now my solution aren't working, even though they're spitting out the right answers in console
@lauralstephenson try making it a new array ... var newArray = array.filter......
Daniel Cramer
@cr4m3r
Nov 01 2015 06:08
@lauralstephenson it should work the way you had it, but i think something is buggy
Laura Stephenson
@lauralstephenson
Nov 01 2015 06:09

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

// Only change code below this line.

var newArray = oldArray;

var newArray = array.filter(function(val) {

  return val (>6 === 0);

});

// Only change code above this line.

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

Daniel Cramer
@cr4m3r
Nov 01 2015 06:11
```
oops
Vishwanath Seshagiri
@thebrahminator
Nov 01 2015 06:12
How to make a picture 100px wide?
<style>
.red-text {
color: red;
}

h2 {
font-family: Lobster, Monospace;
}

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

smaller-image{
width: 100px;
height: 100px;
}
</style>
This is the code.
Daniel Cramer
@cr4m3r
Nov 01 2015 06:12

var array = [1,2,3,4,5,6,7,8,9,10];
// Only change code below this line.

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

// Only change code above this line.
(function() {return newArray;})();

@lauralstephenson what i just posted worked for me.
@thebrahminator I think you're missing a "." in front of your reference to smaller-image.
Laura Stephenson
@lauralstephenson
Nov 01 2015 06:28
Thanks, @cr4m3r !
CamperBot
@camperbot
Nov 01 2015 06:28
lauralstephenson sends brownie points to @cr4m3r :sparkles: :thumbsup: :sparkles:
:warning: lauralstephenson already gave cr4m3r points
Daniel Cramer
@cr4m3r
Nov 01 2015 06:28
@lauralstephenson no problemo!
Laura Stephenson
@lauralstephenson
Nov 01 2015 06:38
Waypoint using Reverse...I'm using the method wrong. Here's my code:

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

// Only change code below this line.

array.reverse(function(a, b) {

  return a - b;

});

// Only change code above this line.

(function() {return array;})();

h4r1m4u
@h4r1m4u
Nov 01 2015 06:42
@lauralstephenson the reverse() function takes no parameters
Laura Stephenson
@lauralstephenson
Nov 01 2015 06:46
Thanks @h4r1m4u !
CamperBot
@camperbot
Nov 01 2015 06:46
lauralstephenson sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 456 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Nikita
@Natasha
Nov 01 2015 06:46
I'm stuck with <style> tag
h4r1m4u
@h4r1m4u
Nov 01 2015 06:48
what's the issue @Natasha
Nikita
@Natasha
Nov 01 2015 06:48
@h4r1m4u I've added <style>  h2 {color: blue;} </style> but h2 doesn't change color, can't see what's wrong
h4r1m4u
@h4r1m4u
Nov 01 2015 06:49
@Natasha that looks correct. could you post everything you have in the code pane?
Nikita
@Natasha
Nov 01 2015 06:49
@h4r1m4u yes
@h4r1m4u validation error: Your h2 element should be blue.
James
@jjowen
Nov 01 2015 06:52
I think it's the way you open and close it
Or maybe I'm wrong and it can be on ONE line
h4r1m4u
@h4r1m4u
Nov 01 2015 06:53
@Natasha i've seen this error before, it's quite bizarre and hard to find. there's a sort of 'invisible' character that looks like a space just in front of your 'h2' in the <style>. it's not space though. just delete it and you'll pass, the code itself is fine
Nikita
@Natasha
Nov 01 2015 06:53
I think I've found error but it's not obvious
@h4r1m4u yes, it was that, that was copied from left pane
h4r1m4u
@h4r1m4u
Nov 01 2015 06:54
cool
Nikita
@Natasha
Nov 01 2015 06:59
h4r1m4u
@h4r1m4u
Nov 01 2015 07:01
it's strange. &#60; is just a code for <. i'm not sure what it is that's being copied from the sidebar
Nikita
@Natasha
Nov 01 2015 07:02
@h4r1m4u sorry, wrong place
@h4r1m4u there is    before h2
"  "
I can't type it
h4r1m4u
@h4r1m4u
Nov 01 2015 07:04
ah, nice find. it's a thin space: https://en.wikipedia.org/wiki/Thin_space. no idea why FCC would put it there.
Nikita
@Natasha
Nov 01 2015 07:05
@h4r1m4u it's something complicated about space...
Daniel Cramer
@cr4m3r
Nov 01 2015 07:06
weird, never heard of thin space before...other than a space where i can't fit
h4r1m4u
@h4r1m4u
Nov 01 2015 07:06
@Natasha it's not complicated. but they should not be using the thin spaces to indent the line. they should use normal space instead
as it's causing the issue that you just ran into
i've seen it on another waypoint as well
would suggest that you report it as a bug and ask them to change it
Nikita
@Natasha
Nov 01 2015 07:07
@h4r1m4u but there are other space types and I don't know which is correct
Rex Schrader
@SaintPeter
Nov 01 2015 07:08
@h4r1m4u @cr4m3r This specific topic is being discussed right now - they're using a thin space and are talking about replacing them all with normal spaces.
h4r1m4u
@h4r1m4u
Nov 01 2015 07:08
@SaintPeter great! i was about to report it. glad to know there's no need. thanks
CamperBot
@camperbot
Nov 01 2015 07:08
h4r1m4u sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1309 | @saintpeter | http://www.freecodecamp.com/saintpeter
Nikita
@Natasha
Nov 01 2015 07:12
@h4r1m4u how can I save my progress or does it save automatically?
h4r1m4u
@h4r1m4u
Nov 01 2015 07:13
@Natasha yeah, it saves it automatically
Nikita
@Natasha
Nov 01 2015 07:13
thank you
CamperBot
@camperbot
Nov 01 2015 07:13
if you want to thank someone, put an @ before their name!
Nikita
@Natasha
Nov 01 2015 07:15
@h4r1m4u there is also bug when rendered html page is doubled, e.g. it's alike I have same code written twice but I don't
Spiralistic
@Spiralistic
Nov 01 2015 07:15
it didn't save for me, I accidentaly leave the page and my code is gone. Can someone copy-paste it here ?
h4r1m4u
@h4r1m4u
Nov 01 2015 07:16
@Natasha i haven't seen that before. if that's indeed the case, you could take a screenshot of it and report it, so that they can investigate
Spiralistic
@Spiralistic
Nov 01 2015 07:17
well, can you help me ?
Rex Schrader
@SaintPeter
Nov 01 2015 07:17
@Natasha I've heard that report and I believe it was attributable to a plugin
@Natasha I think it was a TOR plugin? Some sort of secure browsing thing, maybe?
Nikita
@Natasha
Nov 01 2015 07:17
VNC
Rex Schrader
@SaintPeter
Nov 01 2015 07:18
@Natasha Try connecting in incogneto mode and see if it still happnes.
h4r1m4u
@h4r1m4u
Nov 01 2015 07:18
@Spiralistic well, can you maybe post what waypoint it was?
if you want help, be specific
Spiralistic
@Spiralistic
Nov 01 2015 07:19
Sorry When i saw this is waypoint help, I thought you could see which waypoint I'm at
it's 21
Nikita
@Natasha
Nov 01 2015 07:19
@SaintPeter I don't know how incogneto mode works, duplication dissapears when I start editing code - I think I can deal with it
h4r1m4u
@h4r1m4u
Nov 01 2015 07:19
@Spiralistic that's trivial. you only need to change one line of code
there's no progress to save to speak of. if you're missing the default code provided by FCC, just reset the exercise and write in your solution again
Rex Schrader
@SaintPeter
Nov 01 2015 07:21
@Natasha It may be called "private browsing mode" or maybe safe mode?
Nikita
@Natasha
Nov 01 2015 07:21
not related question - <style> should be inside <html> or not?
inside <head> tag?
Spiralistic
@Spiralistic
Nov 01 2015 07:22
Well I dont want return 20 levels and copy-paste what each level includes. If you have 21 saved you can help me by copy pasting here ..
Nikita
@Natasha
Nov 01 2015 07:22
@SaintPeter I mean I don't know how private browsing mode works, not how to turn it on
h4r1m4u
@h4r1m4u
Nov 01 2015 07:23
@Spiralistic click on the Reset button button when in 21. it'll reset the code pane to the default code
Spiralistic
@Spiralistic
Nov 01 2015 07:23
ups... just seen it
Rex Schrader
@SaintPeter
Nov 01 2015 07:23
@Natasha My point here is that the code doubling is probably caused by a plugin. Using one of those modes (depending on your browser) may disable plugins so you can test it. Or you could disable your plugins one at a time until you find the one that is causing it.
Spiralistic
@Spiralistic
Nov 01 2015 07:23
thanks
CamperBot
@camperbot
Nov 01 2015 07:23
if you want to thank someone, put an @ before their name!
Spiralistic
@Spiralistic
Nov 01 2015 07:24
@h4r1m4u
h4r1m4u
@h4r1m4u
Nov 01 2015 07:24
you're welcome
Christine Cole
@netwerk19
Nov 01 2015 07:25
Could someone give me some help with waypoint 23? I'm sure I followed the directions exactly to make a dead link.
<p>Click here for <a #="http://www.freecatphotoapp.com">cat photos</a>.</p>
Rex Schrader
@SaintPeter
Nov 01 2015 07:25
@netwerk19 No period
h4r1m4u
@h4r1m4u
Nov 01 2015 07:25
@Natasha as to your question, yes, <style> goes inside the <head> tag in normal projects. though for any real project you'll be separating your CSS from your HTML and bringing it into your page as an external file: http://www.w3schools.com/tags/tag_link.asp
Rex Schrader
@SaintPeter
Nov 01 2015 07:26
@netwerk19 Also, the <p> must be the first one after the <h2>
h4r1m4u
@h4r1m4u
Nov 01 2015 07:26
@netwerk19 most importantly, the # should replace the value of the href attribute, not the attribute itself
<a href="#">I'm a zombie link</a>
Christine Cole
@netwerk19
Nov 01 2015 07:27
Okay, let me try
@h4r1m4u that worked. I don't know if it's me, or if the instructions aren't always clear.
@h4r1m4u thank you
CamperBot
@camperbot
Nov 01 2015 07:29
netwerk19 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 457 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Zai Xeno
@removed~zaixeno
Nov 01 2015 07:51
Time for another 12 hours of coding! woo!
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 08:04
I feel that the Simon game is way harder than the other ziplines.
I won't be able to do it without looking at...and pretty much copying...someone else's code
I've started over several times so far and I'm just not getting anywhere.
h4r1m4u
@h4r1m4u
Nov 01 2015 08:07
@TheHighPriestess i thought it was only slightly more difficult than, say, the pomodoro. i think the tic-tac-toe is going to be tougher, given the need for AI
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 08:08
Well...I used a plugin for the pomodoro
I'm just not to the point where I can code all this stuff myself
I need to steal ideas, snippets etc...from other people.
Rex Schrader
@SaintPeter
Nov 01 2015 08:09
@TheHighPriestess The biggest challenge, as I've been thinking about it, is the asynchrnous nature. There are several things that need to happen "in the background"
1) When the computer is "playing", the lights and sound need to happen asynchrnously. You need to find a way to "wait" for both to finish.
2) When the player is playing, there needs to be a timeout that is reset by the user clicking a (correct) button. If the timeout succeeds in firing, the user has lost.
@TheHighPriestess These things can generally be done using some sort of setTimeout
@TheHighPriestess The challenge is that, because they're asnychrnous, you need to maintain the current state of the system.
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 08:10
It's very tricky. I'm going to borrow heavily from some code I found online
h4r1m4u
@h4r1m4u
Nov 01 2015 08:10
from our past discussions it seemed to me that what you were mostly struggling with was the game logic and how to check the human sequence against the computer sequence. perhaps that's something that you can look at others' code for inspiration, but code the rest yourself
Rex Schrader
@SaintPeter
Nov 01 2015 08:11
@TheHighPriestess So you need to know: Is the computer playing? If so, how does it know what the "next" number is? Is the human playing? did they get their click right or wrong?
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 08:11
Yeah....I don't really see any way around looking at someone else's code.
Rex Schrader
@SaintPeter
Nov 01 2015 08:11
@TheHighPriestess It might help to plot it out on paper
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 08:12
I have written out a kind of logic...but implementing it is another matter.
Rex Schrader
@SaintPeter
Nov 01 2015 08:12
@TheHighPriestess What are the states that the system can be in? How do you flow from one state to another?
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 08:12
I have this:

Start button:
set round to 0
empty arrays

Generate random number
Push proper color to array
"Play" the random array

Get human response
Compare human response to computer array

etc.

That seems to be it.
It SOUNDS fairly simple
Zai Xeno
@removed~zaixeno
Nov 01 2015 08:15
Use the jQuery addClass() function to give the classes animated and shake to all your elements with the class well.
  $(document).ready(function() {
    $(".text-primary").addClass("animated shake");
      });
</script>
Use the jQuery addClass() function to give the classes animated and shake to all your elements with the class well.
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 08:16
I hate to say it...but I'm starting to lose interest in it.
Zai Xeno
@removed~zaixeno
Nov 01 2015 08:16
what am I doing wrong?
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 08:16
because I feel that it's too difficult for me at this stage
Rex Schrader
@SaintPeter
Nov 01 2015 08:16
@TheHighPriestess Maybe break it into "states":
  • Game not started
  • Game Starts
  • Computer Chooses next sequence
  • Computer playing sequence
  • Human Turn
  • Human plays correct thing
  • Human plays wrong thing
  • Human times out
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 08:16
@SaintPeter yeah...something like that
and how to work with each state?
Rex Schrader
@SaintPeter
Nov 01 2015 08:17
@TheHighPriestess If you'll recall, the other day I complimented you on where you were at and how you had progressed. I firmly believe that you are capable of doing this. It IS challenging, and it will tax you, but it is defintely within your capabilities to do this.
CamperBot
@camperbot
Nov 01 2015 08:17
saintpeter sends brownie points to @thehighpriestess :sparkles: :thumbsup: :sparkles:
:star: 307 | @thehighpriestess | http://www.freecodecamp.com/thehighpriestess
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 08:17
@SaintPeter thanks haha
Rex Schrader
@SaintPeter
Nov 01 2015 08:17
@TheHighPriestess See? Even @camperbot agrees.
Stefan Stamenkovic
@stxdcode
Nov 01 2015 08:17
@zaixeno you said to shake well, but there you typed ".text-primary"
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 08:18
My problem, I think, is knowing how to approach a problem like this.
Rex Schrader
@SaintPeter
Nov 01 2015 08:18
@TheHighPriestess As with everything in coding: Break it down. Think about what defines these states. Think about state transitions.
@TheHighPriestess Of COURSE you don't know. Don't be silly. That's the point of the exercise.
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 08:19
I did read quite a bit of Head First Javascript...about objects etc...and it was helpful. I want to do it using objects
and I thought about using three different objects: Init, display, and controller. However, I don't know if this is the right approach
CamperBot
@camperbot
Nov 01 2015 08:20
:trollface: troll problems? notify admins here
Rex Schrader
@SaintPeter
Nov 01 2015 08:20
@TheHighPriestess Imagine for a moment that it's a year from now and you have a job doing this for reals. If you are given a new task, do you believe that there will be a clear path to the types of problems you'll be given? Or that you would be able to google the answers? Learning how to break these problems down into their elements and solve them is the name of the game.
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 08:20
@SaintPeter You're right
Rex Schrader
@SaintPeter
Nov 01 2015 08:20
@TheHighPriestess Step 1: Believe that you can solve this problem.
@TheHighPriestess I've been thinking about solving this one (because I never did - it came after I did the Ziplines) and I'm thinking that a "sequence" object may be helpful in some way. Something that knows how to play itself and can compare itself against a number sequence, or maybe answer a question like "Is the Nth note in the sequence THIS NOTE, Yes or No"
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 08:23
yes, that's a good idea @SaintPeter
Rex Schrader
@SaintPeter
Nov 01 2015 08:23
@TheHighPriestess And thinking about the higher level states:
1) Pre-game
2) Computer Playing
3) Human Playing
4) Game Over
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 08:23
just making that object would be a good start
Rex Schrader
@SaintPeter
Nov 01 2015 08:24
@TheHighPriestess Anyway, that's all I've got for the moment. I'm still kinda letting it percolate.
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 08:24
@SaintPeter I like the idea of a sequence object
SaintPeter @SaintPeter puts down his cheerleading pom-poms and heads off to bed
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 08:24
sleep well...thank you for your help...i have jotted your suggestions down
CamperBot
@camperbot
Nov 01 2015 08:24
if you want to thank someone, put an @ before their name!
Rex Schrader
@SaintPeter
Nov 01 2015 08:24
@TheHighPriestess Best of luck!
Sofian Mourabit
@SofianMourabit
Nov 01 2015 08:45
Hi
How do you make an object in javascript private inside a constructor?
got it thx
CamperBot
@camperbot
Nov 01 2015 08:48
if you want to thank someone, put an @ before their name!
h4r1m4u
@h4r1m4u
Nov 01 2015 08:48
@SofianMourabit if you mean 'how do i make an object property or method private inside a constructor function', you'd do it by not using the word 'this' when defining those properties or methods, e.g:
var Dog = function() {
  this.legs = 4; // public property
  var color = grey;  // private property
}
Stefan Stamenkovic
@stxdcode
Nov 01 2015 08:49
Hey, i found fcc yesterday, now i'm at zipeline portfolio...
I don't get it, you need to make website like one given in rules, or what?
h4r1m4u
@h4r1m4u
Nov 01 2015 08:51
@stxdcode yes. a similar portfolio website to the example, customized with your own style and information, while adhering to all the user stories set out in the zipline
Stefan Stamenkovic
@stxdcode
Nov 01 2015 08:52
@h4r1m4u thanks. :D
CamperBot
@camperbot
Nov 01 2015 08:52
stxdcode sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 458 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Vikas Gupta
@vikasgupta23
Nov 01 2015 08:58

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

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

how to make h2 element blue
Stefan Stamenkovic
@stxdcode
Nov 01 2015 08:58
@vikasgupta23 <h2 style="color: blue">CatPhotoApp</h2>
Vikas Gupta
@vikasgupta23
Nov 01 2015 09:02
@stxdcode thanx
CamperBot
@camperbot
Nov 01 2015 09:02
vikasgupta23 sends brownie points to @stxdcode :sparkles: :thumbsup: :sparkles:
:star: 208 | @stxdcode | http://www.freecodecamp.com/stxdcode
Dardan Kadrija
@DardanKadrija
Nov 01 2015 09:04
hello
I am stuck in waypoint
Make Instances of Objects with a Constructor Function
Stefan Stamenkovic
@stxdcode
Nov 01 2015 09:06
@DKadrija myCar.engines = 1;
Dardan Kadrija
@DardanKadrija
Nov 01 2015 09:06
thank you @stxdcode
CamperBot
@camperbot
Nov 01 2015 09:06
dkadrija sends brownie points to @stxdcode :sparkles: :thumbsup: :sparkles:
:star: 209 | @stxdcode | http://www.freecodecamp.com/stxdcode
h4r1m4u
@h4r1m4u
Nov 01 2015 09:08
@stxdcode while it's good that you're trying to help other people, by giving them the solution outright you rob them of the opportunity to figure it out for themselves which provides a much better learning experience and ensures they absorb and retain the material they learn. if you really want to help someone, try pointing them towards the solution by providing similar examples or suggestions instead
Stefan Stamenkovic
@stxdcode
Nov 01 2015 09:11
@h4r1m4u sorry, i'm new here, just wanted to help, i'll try my best from now on :D
And btw, sorry if i misspell something, my english is not very good
h4r1m4u
@h4r1m4u
Nov 01 2015 09:12
@stxdcode no problem! as i said, it's great and appreciated you're trying to help. i just personally prefer the 'teach someone to fish instead of giving them the fish' approach
your english is good enough, no worries
Stefan Stamenkovic
@stxdcode
Nov 01 2015 09:16
@h4r1m4u I appreciate your advice, and yeah, It is the best to learn that way..
K Sudharshan Reddy
@SudharshanReddyK
Nov 01 2015 09:17
hello guys,
h4r1m4u
@h4r1m4u
Nov 01 2015 09:18
@SudharshanReddyK hi!
K Sudharshan Reddy
@SudharshanReddyK
Nov 01 2015 09:18
i am newbie here....just started to learn boot strap. I got struck here.can any one tell me what this means?? create two div elements within your row both with the class col-xs-6
@h4r1m4u hiii..
h4r1m4u
@h4r1m4u
Nov 01 2015 09:20

@SudharshanReddyK

<div class="outer">
  <div class="inner"></div>
  <div class="inner"></div>
</div>

this is a <div> with class 'outer' and within it are two <div>s with class 'inner'. based on this, can you figure out solution to your waypoint?

K Sudharshan Reddy
@SudharshanReddyK
Nov 01 2015 09:22
@h4r1m4u thnks...I got that now.....:)
CamperBot
@camperbot
Nov 01 2015 09:22
sudharshanreddyk sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 460 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 01 2015 09:22
nice work :clap:
Dardan Kadrija
@DardanKadrija
Nov 01 2015 09:29
var oldArray = [1,2,3,4,5,6,7,8,9,10];

// Only change code below this line.

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

// Only change code above this line.

(function() { return newArray; })();
You should have removed all the values from the array that are greater than 5.
I am finding it hard to focus in solution
h4r1m4u
@h4r1m4u
Nov 01 2015 09:32
@DKadrija You should have REMOVED all the values from the array that are GREATER than 5.re-check your code and see what values you're returning from the filter function
Dardan Kadrija
@DardanKadrija
Nov 01 2015 09:33
got it
thank you @h4r1m4u
CamperBot
@camperbot
Nov 01 2015 09:33
dkadrija sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 461 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Dardan Kadrija
@DardanKadrija
Nov 01 2015 09:33
it was val <=5
h4r1m4u
@h4r1m4u
Nov 01 2015 09:33
;) nice
Ankur Singh
@Ankurlvv
Nov 01 2015 09:46
function chunk(arr, size) {
var newArray = [];
for (var i = 0; i < arr.length; i += size) {
var tempArray = arr.slice(i, i + size);
newArray.push(tempArray);
}
return newArray;
} what's the point of i+size in it??
h4r1m4u
@h4r1m4u
Nov 01 2015 09:48
@Ankurlvv 'increase the value of i by size, in other words same as doing i = i + size;'
Ankur Singh
@Ankurlvv
Nov 01 2015 09:49
how this gonna benefit in it?? @h4r1m4u
h4r1m4u
@h4r1m4u
Nov 01 2015 09:52
it will help slicing the original array into the chunks of size, i'm assuming? try logging the value of i and tempArray (e.g. console.log(i) ) in the for loop to see how the values of those variables change
the key would be in this line var tempArray = arr.slice(i, i + size);. it slices the array from element of index i to element of index i + size.
Ankur Singh
@Ankurlvv
Nov 01 2015 10:01
@h4r1m4u could u explain it little more from for loop??
h4r1m4u
@h4r1m4u
Nov 01 2015 10:07

@Ankurlvv sure, let's assume that arr = ['a', 'b', 'c', 'd', 'e', 'f', 'g'] and size = 2
first pass:
i = 0;
var tempArray = ['a', 'b', 'c', 'd', 'e', 'f', 'g'].slice(i, i + 2); => var tempArray = ['a', 'b', 'c', 'd', 'e', 'f', 'g'].slice(0, 0 + 2);=> var tempArray = ['a', 'b']
newArray.push(tempArray); => newArray.push(['a', 'b']); => newArray is now [['a', 'b']]

second pass:
i = 0 + size;=> i = 2
var tempArray = ['a', 'b', 'c', 'd', 'e', 'f', 'g'].slice(i, i + 2); => var tempArray = ['a', 'b', 'c', 'd', 'e', 'f', 'g'].slice(2, 2 + 2);=> var tempArray = ['c', 'd']
newArray.push(tempArray); => newArray.push(['c', 'd']); => newArray is now [['a', 'b'], ['c', 'd']]

etc.
does that help?
Zai Xeno
@removed~zaixeno
Nov 01 2015 10:09
whoa. lol.
Ankur Singh
@Ankurlvv
Nov 01 2015 10:10

@h4r1m4u thanks a lot buddy..

that was hell of a explanation..

CamperBot
@camperbot
Nov 01 2015 10:10
ankurlvv sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 462 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 01 2015 10:10
my pleasure
Zai Xeno
@removed~zaixeno
Nov 01 2015 10:10
that was awesome
Ankur Singh
@Ankurlvv
Nov 01 2015 10:11
@h4r1m4u looks like u r a good teacher..
lol
h4r1m4u
@h4r1m4u
Nov 01 2015 10:11
@Ankurlvv aww, thank you. i just enjoy helping others
CamperBot
@camperbot
Nov 01 2015 10:11
h4r1m4u sends brownie points to @ankurlvv :sparkles: :thumbsup: :sparkles:
:star: 198 | @ankurlvv | http://www.freecodecamp.com/ankurlvv
Ankur Singh
@Ankurlvv
Nov 01 2015 10:12
@h4r1m4u keep it up :)
Zai Xeno
@removed~zaixeno
Nov 01 2015 10:13
var ourArray = [1,2,3];

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

var myArray = [1,2,3];

// Only change code below this line.

var myData = myArray[0];

// Only change code above this line.

if(typeof(myArray) !== "undefined" && typeof(myData) !== "undefined"){(function(y,z){return 'myArray = ' + JSON.stringify(y) + ', myData = ' + JSON.stringify(z);})(myArray, myData);}
I am passing all these waypoints pretty easily. But really I'm not understanding what these are meant for or what they do.
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 10:14
I just lost EVERYTHING that I had written for my Simon game...because I clicked "new" on notepad. Don't do that
I was trying to open up a NEW notepad window
Zai Xeno
@removed~zaixeno
Nov 01 2015 10:14
is this coding for more back-end type stuff
h4r1m4u
@h4r1m4u
Nov 01 2015 10:15
@zaixeno this is just a javascript notation that allows you to access elements of an array. e.g. myArray[0] accesses the first element of the array, myArray1 the 2nd, etc.
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 10:15
oh..whew! I found the original....
h4r1m4u
@h4r1m4u
Nov 01 2015 10:15
there's plenty arrays are useful for - storing data, HTML elements of your page, etc.
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 10:15
that was scary
h4r1m4u
@h4r1m4u
Nov 01 2015 10:16
@TheHighPriestess ah, was just about to say perhaps the fresh start would be beneficial! :D but glad you found the original
Ankur Singh
@Ankurlvv
Nov 01 2015 10:16
@zaixeno these are just introduction of various notations, yeah these are easy keep it up
further u are gonna need them
h4r1m4u
@h4r1m4u
Nov 01 2015 10:17
@TheHighPriestess on a related note, get a proper editor for coding. notepad is horrible
i personally use sublime, some folks prefer atom
Zai Xeno
@removed~zaixeno
Nov 01 2015 10:17
any certain plugins you use on sublime?
Aniruddh Agarwal
@anrddh
Nov 01 2015 10:17
Visual Studio Code ftw!
The git support is amazing
I was a die hard sublime fan, but Code has won me over
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 10:19
@h4r1m4u I use Sublime....but I haven't been using it when I work in Codepen
perhaps I should start
h4r1m4u
@h4r1m4u
Nov 01 2015 10:20
@zaixeno nothing special, just a bunch of extra code highlighters, e.g. for Less
Jettyd
@Jettyd
Nov 01 2015 10:25
Thanks
CamperBot
@camperbot
Nov 01 2015 10:25
if you want to thank someone, put an @ before their name!
Jettyd
@Jettyd
Nov 01 2015 10:26
thanks @camperbot :)
CamperBot
@camperbot
Nov 01 2015 10:26
jettyd sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 470 | @camperbot | http://www.freecodecamp.com/camperbot
Zai Xeno
@removed~zaixeno
Nov 01 2015 10:28
var ourArray = [1,2,3];

ourArray[1] = 3; // ourArray now equals [1,3,3].

var myArray = [1,2,3];

// Only change code below this line.

var ourArray = [3,2,3];


// Only change code above this line.

if(typeof(myArray) !== "undefined"){(function(){return myArray;})();}
"You should be using correct index to modify the value in myArray."
Aniruddh Agarwal
@anrddh
Nov 01 2015 10:29
@zaixeno which waypoint?
You're just redefining the variable
This message was deleted
Zai Xeno
@removed~zaixeno
Nov 01 2015 10:30
146
Aniruddh Agarwal
@anrddh
Nov 01 2015 10:30
It seems the waypoint wants you to write:
myArray[0] = 3;
Zai Xeno
@removed~zaixeno
Nov 01 2015 10:31
oh wow got it
thanks @awesomeaniruddh
CamperBot
@camperbot
Nov 01 2015 10:31
zaixeno sends brownie points to @awesomeaniruddh :sparkles: :thumbsup: :sparkles:
:star: 455 | @awesomeaniruddh | http://www.freecodecamp.com/awesomeaniruddh
Aniruddh Agarwal
@anrddh
Nov 01 2015 10:31
np
Zai Xeno
@removed~zaixeno
Nov 01 2015 10:32
kind of scary passing these and having no idea what this part really means, all this array stuff. hopefully it'll be more familiar later on or something
Aniruddh Agarwal
@anrddh
Nov 01 2015 10:33
It is always scary the first time
Zai Xeno
@removed~zaixeno
Nov 01 2015 10:33
im expecting to watch the code actually do something like it did with html and css
but i dont know what these actually do.
Aniruddh Agarwal
@anrddh
Nov 01 2015 10:33
That's actually troubling
It suggests that the curriculum is not clear enough
This is very basic stuff that you should be able to understand pretty quickly
Zai Xeno
@removed~zaixeno
Nov 01 2015 10:35
I probably need to slow down way more on this part. html and css was very easy to understand
im about to start over again on this Boolean language
Wait, this is basic JavaScript?
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 10:37
Can someone tell me why nothing happens...and why it says that "play" is undefined?
Aniruddh Agarwal
@anrddh
Nov 01 2015 10:38
@zaixeno I haven't looked at the curriculum in a while now, but i'm pretty sure that comes under basic javascript
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 10:38
@zaixeno Get HeadFirst Javascript. it's a good book...explains everything very well
Aniruddh Agarwal
@anrddh
Nov 01 2015 10:38
@zaixeno but if the curriculum is not being clear enough for you, then it must be fixed asap so other campers don't have issues
@TheHighPriestess It looks really cool
Zai Xeno
@removed~zaixeno
Nov 01 2015 10:39
Thank you, yeah definitley about to get some visual training on Javascript right now from treehouse or something for better understanding
CamperBot
@camperbot
Nov 01 2015 10:39
if you want to thank someone, put an @ before their name!
Zai Xeno
@removed~zaixeno
Nov 01 2015 10:39
That game looks awesome
@TheHighPriestess thanks :D
CamperBot
@camperbot
Nov 01 2015 10:39
zaixeno sends brownie points to @thehighpriestess :sparkles: :thumbsup: :sparkles:
:star: 308 | @thehighpriestess | http://www.freecodecamp.com/thehighpriestess
Aniruddh Agarwal
@anrddh
Nov 01 2015 10:39
@TheHighPriestess you define game after you call the loop
Zai Xeno
@removed~zaixeno
Nov 01 2015 10:39
@awesomeaniruddh Thanks too
CamperBot
@camperbot
Nov 01 2015 10:39
zaixeno sends brownie points to @awesomeaniruddh :sparkles: :thumbsup: :sparkles:
:warning: zaixeno already gave awesomeaniruddh points
@awesomeaniruddh thank you
CamperBot
@camperbot
Nov 01 2015 10:42
thehighpriestess sends brownie points to @awesomeaniruddh :sparkles: :thumbsup: :sparkles:
:star: 456 | @awesomeaniruddh | http://www.freecodecamp.com/awesomeaniruddh
Maverick
@ircdtu
Nov 01 2015 10:42
how to use map method to add 3 to an array ? anyone? TIA
Aniruddh Agarwal
@anrddh
Nov 01 2015 10:43
@ircdtu
var foo = [1, 2, 3, 4]
var bar = foo.map(function(item) { return item+3; });
This will return
[4, 5, 6, 7]
Maverick
@ircdtu
Nov 01 2015 10:46
var oldArray = [1,2,3,4,5];

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

var newArray = oldArray;



// Only change code above this line.

(function() {return newArray;})();
@awesomeaniruddh
it is not adding three to each value in the array
BallaMatt03
@BallaMatt03
Nov 01 2015 10:47
Hi everyone, I'm at Waypoint: Style the HTML Body Element, and I think I've found the solution (e.g. body { background-color:black; } in the style element, but when I ran tests, it's not the solution, what I do wrong ?
Aniruddh Agarwal
@anrddh
Nov 01 2015 10:47
new array is the same as oldarray
Maverick
@ircdtu
Nov 01 2015 10:47
ohk
got it
thanks :)
CamperBot
@camperbot
Nov 01 2015 10:47
if you want to thank someone, put an @ before their name!
Aniruddh Agarwal
@anrddh
Nov 01 2015 10:48
@BallaMatt03 can you please post the url?
h4r1m4u
@h4r1m4u
Nov 01 2015 10:50
@BallaMatt03 it's a silly mistake caused by copying the code from the sidebar. there are invisible thin space characters just before the word 'background-color' which break the code even though it looks correct
delete them or replace them with normal spaces and you'll be fine
Aniruddh Agarwal
@anrddh
Nov 01 2015 10:51
Yep, typing it out manually fixed it
I think there's an issue regarding this
h4r1m4u
@h4r1m4u
Nov 01 2015 10:51
it's happening to a lot of people and FCC are aware of it
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 10:51
Anyone know why my setTimeout timer isn't working?
I'm not sure that this is the way to do it though
Aniruddh Agarwal
@anrddh
Nov 01 2015 10:51
@TheHighPriestess That's always fun to troubleshoot
BallaMatt03
@BallaMatt03
Nov 01 2015 10:52
@h4r1m4u ok thanks !
CamperBot
@camperbot
Nov 01 2015 10:52
ballamatt03 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 463 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 10:52
all the sounds play together
function test(){
  for (var i=0;i<compArray.length;i++){
     game.play(compArray[i]);
   }
}

setTimeout(test, 5000);
test();
Aniruddh Agarwal
@anrddh
Nov 01 2015 10:53
Because you loop through all of them
h4r1m4u
@h4r1m4u
Nov 01 2015 10:53
you should be setting the timeout in the forloop if you want to space out the sounds / button plays
Aniruddh Agarwal
@anrddh
Nov 01 2015 10:53
yep, the for loop should have the timeout
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 10:54
oh...i thought that you could do it this way...naming the function
Aniruddh Agarwal
@anrddh
Nov 01 2015 10:54
You have to use an anonymous function in this case
Replace test in setTimeout with an anonymous function that contains your for loop
h4r1m4u
@h4r1m4u
Nov 01 2015 10:54
that sets the timeout for the function as such, but once the time out triggers, it'll process the code in the function immediately
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 10:58

function test(){
setTimeout(function(){
 for (var i=0;i<compArray.length;i++){
     game.play(compArray[i]);
   }
}, 2000);
}  

test();
still plays a chord
h4r1m4u
@h4r1m4u
Nov 01 2015 10:59
set the timeout inside the forloop for the game.play() function only
not for the entire forloop
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 11:01

```
function test(){
for (var i=0;i<compArray.length;i++){
setTimeout(function(){
game.play(compArray[i]);
}
}, 2000);
}
function test(){
 for (var i=0;i<compArray.length;i++){
    setTimeout(function(){
     game.play(compArray[i]);
   }
}, 2000);
}
but codepen is giving me an error
h4r1m4u
@h4r1m4u
Nov 01 2015 11:04
@TheHighPriestess check your syntax and the order of the curly brackets. make sure that all your code blocks are closed where they should be
Aniruddh Agarwal
@anrddh
Nov 01 2015 11:05
@TheHighPriestess what's the error?
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 11:06
nothing happens:
h4r1m4u
@h4r1m4u
Nov 01 2015 11:07
@TheHighPriestess
function test(){
 for (var i=0;i<compArray.length;i++){
    setTimeout(function(){
     game.play(compArray[i]);
   }, 2000);
 }
} // my heart is broken, why oh why would you forget me?
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 11:08
@h4r1m4u ok..now the errors are gone...but still no sound
I'm feeling that maybe I should skip this zipline for now...and continue...and then come back to it later.
h4r1m4u
@h4r1m4u
Nov 01 2015 11:10
@TheHighPriestess alright, so what happens now is that as the test function is called, the for loop runs and schedules all the game.play() calls with the same timeout (perhaps with a tiny tiny difference as the for loop iterates). you need to schedule each of the game.play() calls with progressively increased delay
in other words, on the first pass, the time out should be 2000, on the second 3000, on the third 4000, etc.
Ankur Singh
@Ankurlvv
Nov 01 2015 11:11

arr[ [3,4,5],[4,5,6] ] arr.length=2
arr [ 7,6,5] arr.length =3

this is true?
or not
just wanna confirm

Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 11:12
There isn't even any sound
h4r1m4u
@h4r1m4u
Nov 01 2015 11:12
@Ankurlvv correct
Ankur Singh
@Ankurlvv
Nov 01 2015 11:12
@h4r1m4u thanks
CamperBot
@camperbot
Nov 01 2015 11:12
ankurlvv sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 464 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 01 2015 11:13
@TheHighPriestess there's a sound on my machine - one sound as without the different time, the sounds all blend into one
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 11:16
now it's playing with a delay..but the same sound
weird
h4r1m4u
@h4r1m4u
Nov 01 2015 11:16
could you post your updated code?
it has to be because the play method takes a color
h4r1m4u
@h4r1m4u
Nov 01 2015 11:18
@TheHighPriestess var compArray = [blue, red, yellow, green]; are these supposed to be strings? or are they variable names?
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 11:19
good question
h4r1m4u
@h4r1m4u
Nov 01 2015 11:19
same then in your play() function: if (color === blue) string or variable? ;)
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 11:19
strings, i suppose...for now
hold on
i changed them all to strings..but it's still the same sound
it seems to me that it should work
vere perrot
@perrot
Nov 01 2015 11:29

Hi firend,
I am work in my voting app. I want to add a count.

Every time the page loads, I will get a count in the database. And add one to the count then save it back to the database.

Yes, first time before the chart page loads, I get count 0 from the database. Then I add one, the count will be 1. After the chart page load, I can get count is one in the ejs variable.

But the second time, I try the first time behaviors. And get the same result. I don't know why? Has any suggestion?
Here is my code.

//file:routes.js
var count = user.local.polls[req.body.index].options[req.body.option].count;
                console.log(count);
                count=count+1;
                console.log(count);
                user.local.polls[req.body.index].options[req.body.option].count=count;
                console.log(user.local.polls[req.body.index].options[req.body.option].count);
                var poll=user.local.polls[req.body.index];
console.log(poll);
                user.save(function(err) {
                        if (err)
                                res.send(err);
                        res.render('chart.ejs', {
                            title:poll.name,
                            user : user,
                            poll:poll
                        });
                });
Zai Xeno
@removed~zaixeno
Nov 01 2015 11:44
var ourArray = [1,2,3];

var removedFromOurArray = ourArray.pop(); // removedFromOurArray now equals 3, and ourArray now equals [1,2]

var myArray = ["John", 23, ["cat", 2]];

// Only change code below this line.

var removedFromMyArray;

// Only change code above this line.

(function(y, z){return 'removedFromMyArray = ' + JSON.stringify(y) + ' & removed = ' + JSON.stringify(z);})(myArray, removedFromMyArray);
Waypoint 147.. Someone please help.
Amardeep
@Amardeep91
Nov 01 2015 11:46
anyone knows ruby on rails
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 11:52
@zaixeno isn't it just...myArray.pop();
Zai Xeno
@removed~zaixeno
Nov 01 2015 11:53
so how would it look in this syntax?
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 11:57
myArray.pop();
Zai Xeno
@removed~zaixeno
Nov 01 2015 11:57
under "var removedFromMyArray;" ?
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 11:57
var removedFromMyArray = myArray.pop();
try that
Zai Xeno
@removed~zaixeno
Nov 01 2015 11:58
wow thank you i was stuck on that for at least a hour.. I probably should re-do the whole javascript basics @TheHighPriestess
CamperBot
@camperbot
Nov 01 2015 11:58
zaixeno sends brownie points to @thehighpriestess :sparkles: :thumbsup: :sparkles:
:star: 309 | @thehighpriestess | http://www.freecodecamp.com/thehighpriestess
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 11:59
@zaixeno haha Try that Head First Javascript book.
free download
I found it extremely helpful
Zai Xeno
@removed~zaixeno
Nov 01 2015 12:10
going into it now
i wonder.. do even the more experienced coders get frustrated or is it just when starting out
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 12:14
Well....I think it's an art...and like all arts..it takes a TON of practice.
I can see though...that I am progressing. My struggles are just with different concepts now
I did take a few programming classes years ago...and I remembered the basics...so that's helping me now
In one of them though...there was a 13 year old kid...who was running rings around everyone.
I asked him about it and he told me that his father was a programmer..and that he started doing it from about age 8
so..there ya go
haha
I think it's a lot like learning a foreign language or a musical instrument.
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 12:19
Google helps A LOT
in fact...I just googled and I think I found the problem with my setTimeout
KSHK
@krisdigitx
Nov 01 2015 13:22
hi guys...
Zai Xeno
@removed~zaixeno
Nov 01 2015 13:26
hello there!
var ourArray = ["Stimpson", "J", ["cat"]];

ourArray.pop(); // ourArray now equals ["Stimpson", "J"]

ourArray.push(["happy", "joy"]); // ourArray now equals ["Stimpson", "J", ["happy", "joy"]]

var myArray = ["John", 23, ["cat", 2]];

myArray.pop();

// Only change code below this line.



// Only change code above this line.

(function(z){return 'myArray = ' + JSON.stringify(z);})(myArray);
Does anyone know how I would manipulate this with push?
EclecticSquare
@EclecticSquare
Nov 01 2015 13:53
I'm really struggling with this.

You can use Bootstrap's col-xs-* classes on form elements, too! This way, our radio buttons will be evenly spread out across the page, regardless of how wide the screen resolution is.

Nest all of your radio buttons within a <div class="row"> element. Then nest each of them within a <div class="col-xs-6"> element.

Here is my code
<div class="row">
<div class="col-xs-6">
<button class="btn btn-block btn-primary"><i class="fa fa-thumbs-up"></i> Like</button>
</div>
<div class="col-xs-6">
<button class="btn btn-block btn-info"><i class="fa fa-info-circle"></i> Info</button>
</div>
<div class="col-xs-6">
<button class="btn btn-block btn-danger"><i class="fa fa-trash"></i> Delete</button>
</div>
</div>
Johnny Garces
@jginbound
Nov 01 2015 13:54
hi @zaixeno, is your question more how can you reinsert into the original array what you popped out using push?
h4r1m4u
@h4r1m4u
Nov 01 2015 13:54
@TheHighPriestess sorry, i had to go away. did you manage to find out why it wasn't playing the colors from your array or do you still need help?
Johnny Garces
@jginbound
Nov 01 2015 13:54
by using push*
Oleg Cherkasky
@gunrunners-paradise
Nov 01 2015 13:55
Hey, I'm making the twitch zipline, I'm having trouble getting the twitch channel icons linkable. Can someone help?
Please
I already made a page on codepen.io
EclecticSquare
@EclecticSquare
Nov 01 2015 13:56
figured it out
never minde
Oleg Cherkasky
@gunrunners-paradise
Nov 01 2015 13:56
Johnny Garces
@jginbound
Nov 01 2015 13:57
@gunrunners-paradise sure, what exactly are you trying to make clickable?
Oleg Cherkasky
@gunrunners-paradise
Nov 01 2015 13:57
Can I please get help
Zai Xeno
@removed~zaixeno
Nov 01 2015 13:57
I just cannot seem to get any of this Array stuff right, Not a clue why i'm finding this so difficult either.
var ourArray = ["Stimpson", "J", ["cat"]];

removedFromOurArray = ourArray.shift(); // removedFromOurArray now equals "Stimpson" and ourArray now equals ["J", ["cat"]].

var myArray = ["John", 23, ["dog", 3]];

// Only change code below this line.

var myArray.shift([23]);

// Only change code above this line.


(function(y, z){return 'myArray = ' + JSON.stringify(y) + ' & removedFromMyArray = ' + JSON.stringify(z);})(myArray, removedFromMyArray);
Waypoint 149
Oleg Cherkasky
@gunrunners-paradise
Nov 01 2015 13:58
@jginbound you should be able to click on freecodecamp or delinquentMuse and get to their pages, it doesn't link correctly
Zai Xeno
@removed~zaixeno
Nov 01 2015 13:58
myArray should now equal [23, ["dog", 3]].
removedFromMyArray should contain "John".
h4r1m4u
@h4r1m4u
Nov 01 2015 13:59
@zaixeno you don't need to give the shift() function any parameter to remove the first element from the array: var myArray.shift();
Oleg Cherkasky
@gunrunners-paradise
Nov 01 2015 13:59
@jginbound try it, click on one of them
hello?
h4r1m4u
@h4r1m4u
Nov 01 2015 14:00
@zaixeno when stuck, always check the online documentation. it can be incredibly helpful in understanding how the functions work: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/shift
Johnny Garces
@jginbound
Nov 01 2015 14:00
yea i see it's undefined
Oleg Cherkasky
@gunrunners-paradise
Nov 01 2015 14:01
@jginbound Can you take a look at the Javascript and see what I did wrong? It seems to make sense to me but it still isn't working.
Johnny Garces
@jginbound
Nov 01 2015 14:03
taking a look
Oleg Cherkasky
@gunrunners-paradise
Nov 01 2015 14:06
@jginbound tell me If you're still here
Oleg Cherkasky
@gunrunners-paradise
Nov 01 2015 14:12
@jginbound where have you gone off to? You could have said that you don't have time
Johnny Garces
@jginbound
Nov 01 2015 14:13
@gunrunners-paradise no need to be rude man
i'm taking a look at this cuz like urself i'm learning this stuff
i was going to ask you to console log channel, and see what you get
it's undefined
Oleg Cherkasky
@gunrunners-paradise
Nov 01 2015 14:14
@jginbound k, thank you either way
CamperBot
@camperbot
Nov 01 2015 14:14
gunrunners-paradise sends brownie points to @jginbound :sparkles: :thumbsup: :sparkles:
:star: 108 | @jginbound | http://www.freecodecamp.com/jginbound
Johnny Garces
@jginbound
Nov 01 2015 14:14
i'll be more than happy to take a look at this and get back
Oleg Cherkasky
@gunrunners-paradise
Nov 01 2015 14:14
@jginbound ok
Ramakanth
@ramakanthmarda
Nov 01 2015 14:39

Here's an example of how you give your h2 element the id of cat-photo-app:

<h2 id="cat-photo-app">

Give your form element the id cat-photo-form.

How do i do this
jpjenkins
@jpjenkins
Nov 01 2015 14:49
@ramakanthmarda <form id="cat-photo-form"> :)
Dardan Kadrija
@DardanKadrija
Nov 01 2015 14:49
hello
jpjenkins
@jpjenkins
Nov 01 2015 14:49
hiya
Dardan Kadrija
@DardanKadrija
Nov 01 2015 14:49
Did anyone here do Bonfire: Reverse a String ?
jpjenkins
@jpjenkins
Nov 01 2015 14:50

I'm looking for some help on the waypoint "Make object properties private". We can also create private properties and private methods, which aren't accessible from outside the object.

To do this, just declare properties or functions within the constructor.

Let's create an object with two functions. One attached as a property and one not.

I've breezed through the rest but this one has me stumped, I don't know what to do at all. Can someone give me a push in the right direction?
Dardan Kadrija
@DardanKadrija
Nov 01 2015 14:50
post the code
maybe I can help
h4r1m4u
@h4r1m4u
Nov 01 2015 14:51

@gunrunners-paradise the problem that you're running into is the asynchronous nature of the getJSON function. what it means is that the program doesn't wait for the function to finish before it runs the rest of the code:

for (var i = 0; i<users.length; i++) {
  console.log(users[i]);   
  $.getJSON("https://api.twitch.tv/kraken/channels/" + users[i], function(channel) {
    $(".channels").append(
      '<a target="_blank"\
href="http://www.twitch.tv/'+users[i]+'">\
<div class="channel">\
<div class="image">\
<img class="logo" height="50" width="50" src="' + channel["logo"] + '" />\
</div>\
<div class="description">\
<p style="font-weight: bold">' + slicer(channel["display_name"]) + '</p>\
<p style="font-size: 11px">' + slicer(channel["status"]) + '</p>\
</div></div>\
</a>');
  });
}

in other words, your for loop finishes running before it gets all the responses and data from the twitch API. hence when you then refer to users[i]when generating the <a> link inside the callback function, it is undefined because the i no longer exists. the solution is simple, instead of generating the link based on the element from the users array, generate it based on the data you receive from twitch:

'<a target="_blank" href="http://www.twitch.tv/'+channel["display_name"]+'">
jpjenkins
@jpjenkins
Nov 01 2015 14:51
@DKadrija is it possible to clip it from the website?
Dardan Kadrija
@DardanKadrija
Nov 01 2015 14:51
yes you just have to use ```
h4r1m4u
@h4r1m4u
Nov 01 2015 14:52
@gunrunners-paradise and i need to second what @jginbound said: if you want help, be polite to people who offer it. it's no one's obligation or job to help you out
jpjenkins
@jpjenkins
Nov 01 2015 14:52
@DKadrija Sorry, I don't know what you mean
ah, I see it

var Car = function() {
// this is a private variable
var gear = 1;
// this is a private function (also known as a private method)
function addStyle(styleMe){
return 'The Current Gear Is: ' + styleMe;
}
// this is a public method
this.getGear = function() {
return addStyle(this.gear);
};

};

var Bike = function() {

// Only change code below this line.

this.speed = 100;

function addUnit(value) {
return value + "KM/H";
}

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

};

// Only change code above this line.

var myCar = new Car();

var myBike = new Bike();

if(myBike.hasOwnProperty('getSpeed')){(function() {return JSON.stringify(myBike.getSpeed());})();}

Dardan Kadrija
@DardanKadrija
Nov 01 2015 14:53
@jpjenkins You need to make getSpeed public,and speed undifined like name="something"
jpjenkins
@jpjenkins
Nov 01 2015 14:53
well that didn't work :s I think my evernote extension might be interfering with it
Dardan Kadrija
@DardanKadrija
Nov 01 2015 14:53
@h4r1m4u hey can you help me with bonfire ? reverse a string ?
CamperBot
@camperbot
Nov 01 2015 14:53
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
h4r1m4u
@h4r1m4u
Nov 01 2015 14:54
@DKadrija sure. what's your code so far?
Oleg Cherkasky
@gunrunners-paradise
Nov 01 2015 14:54
@h4r1m4u thanks
CamperBot
@camperbot
Nov 01 2015 14:55
gunrunners-paradise sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 465 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Dardan Kadrija
@DardanKadrija
Nov 01 2015 14:55
function reverseString(str) {
  var emri = str.split();
  emri.reverse();
  return emri.join(",");
}

reverseString("hello");
I dont know but I cant make my mind focus in this
h4r1m4u
@h4r1m4u
Nov 01 2015 14:57
@DKadrija
function reverseString(str) {
  var emri = str.split(); // <== what do you expect to get as a result here? 
  emri.reverse();
  return emri.join(","); // <== why are you joining emri with commas ,?
}
jpjenkins
@jpjenkins
Nov 01 2015 14:57
@DKadrija sorry I didn't understand you. Are you saying that I should remove the function from getSpeed?
Dardan Kadrija
@DardanKadrija
Nov 01 2015 14:58
not the function
@h4r1m4u to split hello into h e l l o
and than reverse it i guess ?
jpjenkins
@jpjenkins
Nov 01 2015 14:59
I'll work it out no doubt
@DKadrija thanks anyway
CamperBot
@camperbot
Nov 01 2015 14:59
jpjenkins sends brownie points to @dkadrija :sparkles: :thumbsup: :sparkles:
:star: 250 | @dkadrija | http://www.freecodecamp.com/dkadrija
Dardan Kadrija
@DardanKadrija
Nov 01 2015 14:59
ofc
h4r1m4u
@h4r1m4u
Nov 01 2015 15:01
@DKadrija let's say var str = 'my amazing dog'; if i do var split = str.split();, what do you think i'll get as a result?
Dardan Kadrija
@DardanKadrija
Nov 01 2015 15:02
if you would do split(" ") get my,amazing,dog ?
h4r1m4u
@h4r1m4u
Nov 01 2015 15:02
correct
what do i get with split()?
JoseMorenoINL
@JoseMorenoINL
Nov 01 2015 15:04
Hello. Im on the "Waypoint: Bring your JavaScript Slot Machine to Life"
im using $($(".slot")[0]).html(slotOne);
$($(".slot")1).html(slotTwo);
$($(".slot")2).html(slotThree); to answer
but seems to not work
Dardan Kadrija
@DardanKadrija
Nov 01 2015 15:05
nothing ?
h4r1m4u
@h4r1m4u
Nov 01 2015 15:05
nope, try again. try to run a test for yourself in jsfiddle or check the split() documentation
Dardan Kadrija
@DardanKadrija
Nov 01 2015 15:06
yeah
h4r1m4u
@h4r1m4u
Nov 01 2015 15:06
your thought process of how to approach the bonfire is correct. just a couple of small issues with your code
Dardan Kadrija
@DardanKadrija
Nov 01 2015 15:06
var emri = str.split("");
gets me var emri = str.split("");
"o","l","l","e","h"
h4r1m4u
@h4r1m4u
Nov 01 2015 15:07
getting warmer, are we? :)
Dardan Kadrija
@DardanKadrija
Nov 01 2015 15:08
got it
@h4r1m4u thank you
CamperBot
@camperbot
Nov 01 2015 15:08
dkadrija sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 466 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 01 2015 15:08
@DKadrija fantastic! nice work
@JoseMorenoINL that looks correct to me. are you still having issues with it?
gts00k
@gts00k
Nov 01 2015 15:12
hey guys
I have created a chat room where I want people who are learning javascript full time
if anyone is interested please let me know
the purpose of the chat is to talk and collaborate with coding :)
Arnis Jaundzeikars
@SangSatori
Nov 01 2015 15:13
@gts00k: Sound like a thing I'm all up for! Though I'm not sure about predicted activity there - no promises of being really active and all right away.
Dardan Kadrija
@DardanKadrija
Nov 01 2015 15:13
function factorialize(num) {
  return num;
}

factorialize(5);
Dardan Kadrija
@DardanKadrija
Nov 01 2015 15:31
anyone
?
Arnis Jaundzeikars
@SangSatori
Nov 01 2015 15:36
@DKadrija: Right now the code returns only the number that was given in without altering it, in other words, gets nothing done.
Dardan Kadrija
@DardanKadrija
Nov 01 2015 15:36
yeah I know
but I dont know how to start
Arnis Jaundzeikars
@SangSatori
Nov 01 2015 15:38
What aspect are you struggling with? Well, my math is pretty weak these days, but Wikipedia article on factorials & maybe looking up stuff on Rosetta Code or other sites with solution can help. Usually I'm seeing this as part of learning recursion; you are supposed to make the function call itself again, resulting in recursion. I haven't done this yet.
h4r1m4u
@h4r1m4u
Nov 01 2015 15:39
yep, what @SangSatori says is a solid advice. look up the mathematical definition of factorial and start there
Dardan Kadrija
@DardanKadrija
Nov 01 2015 15:43
Well I get the factorial 5!=54321
but how to turn that into code
Rex Schrader
@SaintPeter
Nov 01 2015 15:43
@DKadrija Can you think of how you might count from 5 to 1?
@DKadrija Is there some JS structure that is built for counting?
Dardan Kadrija
@DardanKadrija
Nov 01 2015 15:45
with loops ?
Rex Schrader
@SaintPeter
Nov 01 2015 15:45
@DKadrija Yup
@DKadrija So, Step 1: Make a loop that counts from num to 1 (or vice versa).
@DKadrija BTW, you can develop your code at http://repl.it for an easier to use JS console.
Dardan Kadrija
@DardanKadrija
Nov 01 2015 15:46
great thank you @SaintPeter
CamperBot
@camperbot
Nov 01 2015 15:46
dkadrija sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1313 | @saintpeter | http://www.freecodecamp.com/saintpeter
Dardan Kadrija
@DardanKadrija
Nov 01 2015 15:48
mehh fuck it I better leave it
Arnis Jaundzeikars
@SangSatori
Nov 01 2015 15:54
Speaking of frustrations, any advice on dealing with that? Every now and then I hit a wall with learning or doing something, and I'd say on a few cases out of those I should have given myself a well-timed break and looked at the problem at large, or have done something else instead.
Rex Schrader
@SaintPeter
Nov 01 2015 15:55
@SangSatori I've heard it said that "Programmers are paid to be frusturated". :D
Arnis Jaundzeikars
@SangSatori
Nov 01 2015 15:57
Haha, codes can do that to a person, for sure! @SaintPeter I've been learning stuff about Visual Format Language some more today, and it just happens to be one of those hard but not actually mandatory tasks. VFL isn't generally used in web development anyway.
Rex Schrader
@SaintPeter
Nov 01 2015 15:57
@SangSatori A couple thoughts:
1) Break down the problem. If you can't precisely formulate a single question that would answer/solve your problem then you don't understand it well enough yet and you need to break it down more.
2) A break can be helpful, but take care not to use it as an excuse to procrastinate.
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 15:58
@h4r1m4u No....I haven't managed to get anything done,
Rex Schrader
@SaintPeter
Nov 01 2015 15:58
@TheHighPriestess How many hours of sleep are you operating on?
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 15:58
I've gone back to the idea of just looking at someone else's code
@SaintPeter oh, I get enough sleep haha
I'm just totally stumped by this project for some reason
...and I really despise wading through someone else's code
jonkoW
@jonkoW
Nov 01 2015 15:59
Basic Q: Where is my command line?
Rex Schrader
@SaintPeter
Nov 01 2015 16:00
@jonkoW In most major browsers on Windows, F12 opens your Dev Tools
@jonkoW Unless you're talking about like a Windows/OSX command line
h4r1m4u
@h4r1m4u
Nov 01 2015 16:01
@TheHighPriestess awww. you were close with getting the function for playing out the computer sequence right
Arnis Jaundzeikars
@SangSatori
Nov 01 2015 16:01
I'm starting to jumble up my HTML tags and CSS properties. I'm not sure why this is happening so early (6PM for me), but I guess I'm not thinking at my optimal performance now.
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 16:02
@h4r1m4u well....it was playing the same sound
h4r1m4u
@h4r1m4u
Nov 01 2015 16:02
@SangSatori take a break. coding can be mentally very taxing
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 16:02
and i found a link to a question on stackoverflow related to that, i think...but I couldn't implement the concept
jonkoW
@jonkoW
Nov 01 2015 16:02
Right, though initial intro implies there is a command line somewhere in my browser's code camp window.
h4r1m4u
@h4r1m4u
Nov 01 2015 16:02
@TheHighPriestess do you still have it in codepen?
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 16:03
@h4r1m4u yeah...just a sec...let me put the js back into it
Rex Schrader
@SaintPeter
Nov 01 2015 16:03
@jonkoW There is an output window just under the buttons, but it's not very good.
@jonkoW Which specific intro? I want to take a look and make sure it's not confusing to new users. I can fix that :D
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 16:03
h4r1m4u
@h4r1m4u
Nov 01 2015 16:05
@TheHighPriestess this seems to be quite different from what you had before. you got rid of all the functionality to play the sounds and highlight the buttons?
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 16:06
@h4r1m4u yeah...hold on...
jonkoW
@jonkoW
Nov 01 2015 16:06
@SaintPeter I am going through the code camp tutorial and assumed there was a command line somewhere in the browser. I.e. if I hadn't downloaded git hub locally, I would need a command line, right?
yuyao17
@yuyao17
Nov 01 2015 16:07
Hi, can anyone tell me what an i element is in HTML again?
Sorry guys im new
Rex Schrader
@SaintPeter
Nov 01 2015 16:07
@jonkoW There is a command line in your browser, but I'd like to know the specific waypoint you're on so I can read it and see what specifically it says.
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 16:07
@h4r1m4u I don't know where that code is now
h4r1m4u
@h4r1m4u
Nov 01 2015 16:07
@yuyao17 https://developer.mozilla.org/en-US/docs/Web/HTML/Element/i. but it's often used for icons
@TheHighPriestess oh, ok. pity
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 16:08
@h4r1m4u I think I'm going to put back all the code I originally had there
that I do have
Arnis Jaundzeikars
@SangSatori
Nov 01 2015 16:08
@yuyao17: Googled it (and you should try looking stuff up as well); it's HTML 4.01 tag for italics, not used in HTML5 any more but is used for icons because it's so short and quick to type out.
Yusef Habib
@yhabib
Nov 01 2015 16:09
@TheHighPriestess this is my solution
I don’t know why it does not work here but in codepen no probs
h4r1m4u
@h4r1m4u
Nov 01 2015 16:10
@TheHighPriestess you basically had the function for playing the computer sequence to the player done. there was just some minor issue with it not taking in the color as the parameter correctly
jonkoW
@jonkoW
Nov 01 2015 16:12
@SaintPeter Let me see if I can find it. I passed it in an earlier step.
yuyao17
@yuyao17
Nov 01 2015 16:12
@SangSatori @h4r1m4u Yeah thought <i> was meant for range of texts and just a semantic markup, didnt know it was also meant for icons. thanks!
CamperBot
@camperbot
Nov 01 2015 16:12
yuyao17 sends brownie points to @sangsatori and @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 179 | @sangsatori | http://www.freecodecamp.com/sangsatori
:star: 467 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 16:12
@h4r1m4u Here's what I originally had
jonkoW
@jonkoW
Nov 01 2015 16:13
@SaintPeter Sorry, got mucked up when I tried to go back in the sequence . . .
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 16:13
@yhabib thanks. I'll take a look at it
CamperBot
@camperbot
Nov 01 2015 16:13
thehighpriestess sends brownie points to @yhabib :sparkles: :thumbsup: :sparkles:
:star: 335 | @yhabib | http://www.freecodecamp.com/yhabib
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 16:15
I'm just totally lost. That's why I got rid of all the original code and decided to start over.
but...maybe I should just continue with where I was at
Rex Schrader
@SaintPeter
Nov 01 2015 16:16
@TheHighPriestess You should work on building and testing blocks that work.
@TheHighPriestess For example: Code that highlights and plays sounds.
@TheHighPriestess Once it works, don't change it.
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 16:17
@SaintPeter Yes, I agree. I need to focus on doing ONE thing at a time.
Yusef Habib
@yhabib
Nov 01 2015 16:18
@TheHighPriestess I have to say that i really like your designs. The camper news is pretty cool!
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 16:19
@yhabib Thanks. I'm much better at design than I am coding LOL
CamperBot
@camperbot
Nov 01 2015 16:19
thehighpriestess sends brownie points to @yhabib :sparkles: :thumbsup: :sparkles:
:warning: thehighpriestess already gave yhabib points
h4r1m4u
@h4r1m4u
Nov 01 2015 16:20
@TheHighPriestess i think there's more issues with this code than i saw before. @SaintPeter 's advice is good. looking at the code i think you're on the right track - you have most of the functions and blocks that you need in place. you understand how you need to approach the problem. now you just need to make the individual functions and blocks actually work.
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 16:21
@h4r1m4u Yeah...I think what you saw before...was a piece of code.
Richard Casanova
@ricardofer2412
Nov 01 2015 16:21
I am new here. I m working on the lessons and I ma stuck in one.

<style>
body {
background-color: black;
font-family: Monospace;
color: green;
}
</style>

<h1>Hello World!</h1>

Your h1 element should have the class pink-text.
Your h1 element should be pink.
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 16:22
@h4r1m4u I do believe that my main problem is knowing HOW to approach the problem. I mean...I can get pieces of code to work fine.
It's putting them all together that's hard
Richard Casanova
@ricardofer2412
Nov 01 2015 16:22
I tried this but it did not wokr

<style>
body {
background-color: black;
font-family: Monospace;
color: green;
}
pink-text{
color:pink
}
</style>

<h1 class="pink-text">Hello World!</h1>

Rex Schrader
@SaintPeter
Nov 01 2015 16:23
@TheHighPriestess Well, the "how" is what you're learning. It is indeed "the hard part", since it's clear you know how to write code. It may, in fact, be "the hardest part".
Yusef Habib
@yhabib
Nov 01 2015 16:23
@ricardofer2412 a css class definition should start with a point —> .pinkt-test
Rex Schrader
@SaintPeter
Nov 01 2015 16:23
@ricardofer2412 In your class definition you need a . before pink-text, because it's a class.
Jinx!
Yusef Habib
@yhabib
Nov 01 2015 16:24
This message was deleted
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 16:25
Are there any good books on this?
jpjenkins
@jpjenkins
Nov 01 2015 16:25
I'm getting the correct return but it's saying that it's wrong. The second bonfire waypoint where I have to reverse a string and return it:

var reverseString = "hello";
var array = reverseString.split("");
array.reverse();
reverseString = array.join("");

function reverseString(str) {
return str;
}

"olleh" returns but the error: reverseString() should return a string.
it is a string... :s
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 16:26
So....as I see it...my FIRST state will be....showing the computer generated random pattern
jpjenkins
@jpjenkins
Nov 01 2015 16:27
anyone here able to push me in the right direction? :)
Coira Ellison
@Coira
Nov 01 2015 16:28
@jpjenkins your code should be inside the function reverseString, and you should be reversing that function's argument, str
Rex Schrader
@SaintPeter
Nov 01 2015 16:29
@TheHighPriestess There may be books on it, but it still comes back to learning how to break down problems and figure out your state transitions.
jpjenkins
@jpjenkins
Nov 01 2015 16:29
aaah, I wonder why I was having to change the original line
@Coira thanks :)
CamperBot
@camperbot
Nov 01 2015 16:29
jpjenkins sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 290 | @coira | http://www.freecodecamp.com/coira
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 16:30
Is this correct syntax:
if(1<=num && num<=25){
Rex Schrader
@SaintPeter
Nov 01 2015 16:31
@TheHighPriestess Ok, so, if the computer is done playing the sequence, it's now waiting for the human to click. So there are two things: The computer needs to count down (like a setTimeout) and the human needs to be able to click. Once they click, the button they clicked needs to be added to the human sequence (or the index of the current sequence) and checked against the comptuer sequence so far.
@TheHighPriestess Yup, looks good.
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 16:31
@SaintPeter Yes, my original thought was to keep adding to the computer generated sequence..and then comparing the human sequence to that
h4r1m4u
@h4r1m4u
Nov 01 2015 16:31
@TheHighPriestess write the basic functions that do one thing only first: randomColor() (generates a random color), playButton() (plays the sound of a button and highlights it visually), computerTurn() (uses the randomColor() function and pushes it into the array of computer moves), updateScore() (updates the score on the Simon with the user's streak). make them work in isolation as @SaintPeter suggested. then start working on the larger functions leveraging these basic code blocks you've already written: playSequence() (plays out all the colors in the computerMoves array, using the playButton() function), gameLogic(), etc.
Rex Schrader
@SaintPeter
Nov 01 2015 16:32
@TheHighPriestess And that's a good thought. Just need to figure out how/when to do that :D
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 16:33
@SaintPeter @h4r1m4u Ok...I think I'm having a problem that I previously solved. It was something simple...but I can't remember what it was now. When you press start...it just keeps going to "blue"
something is wrong with that if statement, i think
the array gets built...but it's all blue
h4r1m4u
@h4r1m4u
Nov 01 2015 16:36

@TheHighPriestess

  if(1<=num && num<=25){
    compArray.push(blue);  
  }

what's 'blue' here? where did you define that variable?

same here:
$("#green").on("click",function(){
  green();
    humanArray.push(green); // where's green defined? what's it's value?
  console.log(humanArray);
});
Nathan
@terakilobyte
Nov 01 2015 16:37
@TheHighPriestess as a style note, if you look at your big if/elseif/else construct, what would happen if the number was 49 and it was passed into something like?
if (num <= 25) {
  // blue
} else if (num <= 50) {
  // red
} else if (num <= 75) {
  // green
} else {
  // yellow
}
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 16:39
@h4r1m4u it's from the createAndPush function
Rex Schrader
@SaintPeter
Nov 01 2015 16:39
@TheHighPriestess your randomNum function returns a number between 1 and 4, I think, not 1 and 100. So your logic is always going to select blue
@TheHighPriestess BTW, it would be a lot easier to just take that number between 1 and 4 and do this:
switch(num) {
   case 1: 
      //blue
   case 2:
     //green
/* ... etc . . . */
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 16:40
@SaintPeter ahhh....yes, I think I changed that before
h4r1m4u
@h4r1m4u
Nov 01 2015 16:40
@SaintPeter onto something there. as for my question compArray.push(blue); blue here is a variable, not a string 'blue'. you didn't define var blue anywhere
Rex Schrader
@SaintPeter
Nov 01 2015 16:40
@h4r1m4u blue is a function - she's very clever :D
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 16:41
I need to re-read my own code now.
haha
I have forgotten what I was doing
Rex Schrader
@SaintPeter
Nov 01 2015 16:41
@TheHighPriestess BTW, this is a case where a console.log(num) would be very helpful. Always check your assumptions.
h4r1m4u @h4r1m4u facepalms
h4r1m4u
@h4r1m4u
Nov 01 2015 16:42
thanks @SaintPeter didn't realize she was pushing entire functions into the array
CamperBot
@camperbot
Nov 01 2015 16:42
h4r1m4u sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1315 | @saintpeter | http://www.freecodecamp.com/saintpeter
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 16:47
ok..here's what i'm going to do
I'm going to continue with what i have here so far...
but..now I need to reacquaint myself with my own code
h4r1m4u
@h4r1m4u
Nov 01 2015 16:48
that sounds like a good plan to me. you're on the right track with what you have so far
Rex Schrader
@SaintPeter
Nov 01 2015 16:48
"Hello, code I wrote. I wish I remembered what I meant when I wrote you."
True story.
Abhisek Pattnaik
@abhisekp
Nov 01 2015 16:50
"I promise, I'll document you next time."
h4r1m4u
@h4r1m4u
Nov 01 2015 16:51
:point_up: :D
TorontoMonkey
@TorontoMonkey
Nov 01 2015 16:53
LOL @SaintPeter
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 16:55
It's the truth haha
Rex Schrader
@SaintPeter
Nov 01 2015 16:56
@abhisekp "Your lies are like ashes in your mouth. You know you don't mean it!" ;)
Abhisek Pattnaik
@abhisekp
Nov 01 2015 16:58
lol
karenchungg
@karenchungg
Nov 01 2015 16:58

I met some problem...The question asks me to use the map function to add 3 to every value in the variable array. And here's my code..:
var oldArray = [1,2,3,4,5];

// Only change code below this line.

var newArray = oldArray;
newArray.map(function(val){

return val+3 ;

});

This message was deleted
Is there anyone can help? > <
Abhisek Pattnaik
@abhisekp
Nov 01 2015 17:00
explain format
CamperBot
@camperbot
Nov 01 2015 17:00

: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

Abhisek Pattnaik
@abhisekp
Nov 01 2015 17:00
@karenchungg :point_up: November 1, 2015 10:30 PM
karenchungg
@karenchungg
Nov 01 2015 17:01
var oldArray = [1,2,3,4,5];

// Only change code below this line.


var newArray = oldArray;
  newArray.map(function(val){

    return val+3 ;
  });
Like this?
Zai Xeno
@removed~zaixeno
Nov 01 2015 17:01
//Use map to add three to each value in the array
var array = [1,2,3,4,5];
// Only change code below this line.

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

// Only change code above this line.
(function() {return array;})();
@zaixeno walks away in shame
Abhisek Pattnaik
@abhisekp
Nov 01 2015 17:02
@karenchungg you also need to return the newArray
Zai Xeno
@removed~zaixeno
Nov 01 2015 17:03
yeah what he said ^
I'm on this same one >.< I thought I just had it -.-
MohameddAli
@MohameddAli
Nov 01 2015 17:05

guys what is rong here? <style>
  .red-text {
    color: red;
  }
</style>

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

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

karenchungg
@karenchungg
Nov 01 2015 17:05
@abhisekp @zaixeno but it had returned it already for me?
Abhisek Pattnaik
@abhisekp
Nov 01 2015 17:06
@karenchungg so the default code returns? Then they might have manually overwritten it.
MohameddAli
@MohameddAli
Nov 01 2015 17:07

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

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

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

karenchungg
@karenchungg
Nov 01 2015 17:07
@abhisekp it returns [1,2,3,4,5]
@abhisekp but it supposed to returns [4,5,6,7,8]?
h4r1m4u
@h4r1m4u
Nov 01 2015 17:08
@MohameddAli did you copy the class definition from the sidebar? if yes, delete the spaces in front of the '.red-text' part. there's a bug when the code gets copied from the sidebar as it uses non-standard character for blank space
Abhisek Pattnaik
@abhisekp
Nov 01 2015 17:08
@karenchungg yes. After mapping, return the mapped array! :D
MohameddAli
@MohameddAli
Nov 01 2015 17:08
ok
karenchungg
@karenchungg
Nov 01 2015 17:09
@abhisekp so I haven't mapped successfully?
Paul Kim
@machopaul
Nov 01 2015 17:09
help with adding comment...
CamperBot
@camperbot
Nov 01 2015 17:09
no wiki entry for: with adding comment
:pencil: click here to create one now!after creating your page type update to reload it here
Paul Kim
@machopaul
Nov 01 2015 17:09
Comment out your call to Google for the Lobster font by putting <!-- in front of it.
where do i insert this comment ?
h2 {
font-family: Lobster, monospace;
}
Abhisek Pattnaik
@abhisekp
Nov 01 2015 17:10
@karenchungg link pls
Zai Xeno
@removed~zaixeno
Nov 01 2015 17:10
<!-- Lobster , --> monospace; i believe
h4r1m4u
@h4r1m4u
Nov 01 2015 17:11
@machopaul Comment out your call to Google for the Lobster the call is at the top of the codepane, before the <style> tag
Paul Kim
@machopaul
Nov 01 2015 17:11
ah
both worked
thanks
CamperBot
@camperbot
Nov 01 2015 17:11
if you want to thank someone, put an @ before their name!
Zai Xeno
@removed~zaixeno
Nov 01 2015 17:11
oh you dont actually comment out Lobster?
Zai Xeno
@removed~zaixeno
Nov 01 2015 17:12
var oldArray = [1,2,3,4,5];

// Only change code below this line.


var newArray = oldArray;

oldArray = newArray.map(function(val){

  return val*4;

});


// Only change code above this line.

(function() {return newArray;})();
You should add three to each value in the array.
You should be making use of the map method.
You should only modify the array with map.
Im stuck
h4r1m4u
@h4r1m4u
Nov 01 2015 17:12
@zaixeno if you do that, h2 will use the monospace font only. but the lobster font will still be imported into your project
Abhisek Pattnaik
@abhisekp
Nov 01 2015 17:12
@karenchungg map method doesn't mutate the array
@zaixeno store the mapped oldArray in newArray
karenchungg
@karenchungg
Nov 01 2015 17:15
@abhisekp so I can't return "val+3" directly?
Abhisek Pattnaik
@abhisekp
Nov 01 2015 17:16
Zai Xeno
@removed~zaixeno
Nov 01 2015 17:16
var newArray = [1,2,3,4,5];

// Only change code below this line.




 newArray = newArray.map(function(val){

  return val + 3;

});


// Only change code above this line.

(function() {return newArray;})();
so then this should work?
got it, thanks
CamperBot
@camperbot
Nov 01 2015 17:17
if you want to thank someone, put an @ before their name!
Zai Xeno
@removed~zaixeno
Nov 01 2015 17:17
thanks @abhisekp
CamperBot
@camperbot
Nov 01 2015 17:17
zaixeno sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 789 | @abhisekp | http://www.freecodecamp.com/abhisekp
Abhisek Pattnaik
@abhisekp
Nov 01 2015 17:17
@zaixeno you don't need to change the oldArray variable name. You can keep it that way!
@zaixeno
var oldArray = [1,2,3,4,5];
// Only change code below this line.

var newArray = oldArray.map(function (num) {
  return num + 3;
});

// Only change code above this line.
(function() {return newArray;})();
karenchungg
@karenchungg
Nov 01 2015 17:21
@abhisekp I did it! Thanks! how can I send you a brownie? :+1:
CamperBot
@camperbot
Nov 01 2015 17:21
karenchungg sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 790 | @abhisekp | http://www.freecodecamp.com/abhisekp
Abhisek Pattnaik
@abhisekp
Nov 01 2015 17:21
@karenchungg you just sent! :smile:
karenchungg
@karenchungg
Nov 01 2015 17:21
@abhisekp I think I just did? :smile:
@abhisekp Haha Thanks a lot!
CamperBot
@camperbot
Nov 01 2015 17:21
karenchungg sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:warning: karenchungg already gave abhisekp points
Abhisek Pattnaik
@abhisekp
Nov 01 2015 17:21
no more :(
Zai Xeno
@removed~zaixeno
Nov 01 2015 17:22
one brownie at a time haha
no overeating huh
SaintPeter @SaintPeter couldn't eat another bite
Rex Schrader
@SaintPeter
Nov 01 2015 17:23
status @SaintPeter
Abhisek Pattnaik
@abhisekp
Nov 01 2015 17:23
about @SaintPeter
CamperBot
@camperbot
Nov 01 2015 17:23
:star: 1316 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Nov 01 2015 17:23
Right .. that one . .
abhisekp @abhisekp forces more brownies into @SaintPeter's mouth.
SaintPeter @SaintPeter explodes
Abhisek Pattnaik
@abhisekp
Nov 01 2015 17:24
:bomb: :fire:
Robert Uivarosi
@URobert
Nov 01 2015 17:34
good evening guys
and girls (?!)
...
is this: LinkedIn recognizes Free Code Camp as a university. You can gain access to our large alumni network by adding Free Code Camp to your LinkedIn profile's education section.
Set your graduation date as next year.
For "Degree", type "Full Stack Web Development Certification".
For "Field of study", type "Computer Software Engineering".
a good idea? ^^
Rex Schrader
@SaintPeter
Nov 01 2015 17:40
@URobert I think so. I did it at least.
@URobert It's one of those things that may not mean much now, but as more FCC grads get out in the marketplace and kick butt, our repuatation will grow. You may not get any direct benefit from it, but those who follow you may.
TorontoMonkey
@TorontoMonkey
Nov 01 2015 17:42
Hey guys I need some help, I'm having an issue using the filter function in JS and I'm getting error : array is not defined.
Rex Schrader
@SaintPeter
Nov 01 2015 17:42
@TorontoMonkey Can you share your code?
TorontoMonkey
@TorontoMonkey
Nov 01 2015 17:43
@SaintPeter yeah one sec
@saintpeter is there a way to do this properly, so far I just take a picture using capture on my mac
Rex Schrader
@SaintPeter
Nov 01 2015 17:44
Yeah, like this:
wiki format
CamperBot
@camperbot
Nov 01 2015 17:44

: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

Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 17:44
I did it
Rex Schrader
@SaintPeter
Nov 01 2015 17:44
@TheHighPriestess You did it?
@TheHighPriestess You mother effin DID IT?
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 17:45
oh...I meant...the linkedIn thing haha
Rex Schrader
@SaintPeter
Nov 01 2015 17:45
@TheHighPriestess Oh man
@TheHighPriestess I was getting all excited.
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 17:45
@SaintPeter I did fix the one color thing though
h4r1m4u
@h4r1m4u
Nov 01 2015 17:45
awww, i was excited there for a while! @TheHighPriestess you tease!
SaintPeter @SaintPeter tamps down his enthusiasim
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 17:45
haha
...and my human clicks are also going into an array
TorontoMonkey
@TorontoMonkey
Nov 01 2015 17:46
<paste your code here>,
```
whoops
SaintPeter @SaintPeter does a small cheer for @TheHighPriestess
Rex Schrader
@SaintPeter
Nov 01 2015 17:48
"Human Clicks" is the name of my new techno band
TorontoMonkey
@TorontoMonkey
Nov 01 2015 17:49
var oldArray = [1,2,3,4,5,6,7,8,9,10];

// Only change code below this line.

var newArray = oldArray;

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

// Only change code above this line.

(function() { return newArray; })();
@SaintPeter
Robert Uivarosi
@URobert
Nov 01 2015 17:51
@SaintPeter Thanks for the advice !
CamperBot
@camperbot
Nov 01 2015 17:51
urobert sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1319 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Nov 01 2015 17:51
@TorontoMonkey You need to apply filter to oldArray - there is no array defined.
TorontoMonkey
@TorontoMonkey
Nov 01 2015 17:59
got it, thanks @SaintPeter
CamperBot
@camperbot
Nov 01 2015 17:59
torontomonkey sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1320 | @saintpeter | http://www.freecodecamp.com/saintpeter
Elizabeth Hatleli
@TheHighPriestess
Nov 01 2015 18:02
@SaintPeter haha
gts00k
@gts00k
Nov 01 2015 18:06
hello
Rex Schrader
@SaintPeter
Nov 01 2015 18:08
@gts00k greetings
varindernagra
@varindernagra
Nov 01 2015 18:08

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

<h2>CatPhotoApp</h2>

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

I am stuck, this wont change h2 color to blue
??????
jpjenkins
@jpjenkins
Nov 01 2015 18:09
So I just completed a bonfire where I had to factorise a number. I found that I had to use an if statement for 0, it seems that there's not a way to work it out. Anyone else come across this?
gts00k
@gts00k
Nov 01 2015 18:09
need some help with the binary agents bonfire
CamperBot
@camperbot
Nov 01 2015 18:09
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Rex Schrader
@SaintPeter
Nov 01 2015 18:09
@jpjenkins That is the only way to solve it, as far as I know.
jpjenkins
@jpjenkins
Nov 01 2015 18:09
isn't it '.h2'?
Rex Schrader
@SaintPeter
Nov 01 2015 18:09
@jpjenkins You might be able to do something with a for loop where i starts with 1, maybe?
jpjenkins
@jpjenkins
Nov 01 2015 18:09
@varindernagra
Rex Schrader
@SaintPeter
Nov 01 2015 18:09
@jpjenkins Nope, only class references start with a dot
varindernagra
@varindernagra
Nov 01 2015 18:10
is this a bug?
jpjenkins
@jpjenkins
Nov 01 2015 18:10
It appears that 0 is found to be 1 only by simplifying an equation
like a special argument used to prove the existence of an integer
or set
even if the set is empty, it still returns that there is '1' way to organise it
@varindernagra if you look on w3c schools, check the styles section. You'll learn a lot there. It's not a bug.
gts00k
@gts00k
Nov 01 2015 18:12
need some help with the binary agents bonfire
CamperBot
@camperbot
Nov 01 2015 18:12
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
h4r1m4u
@h4r1m4u
Nov 01 2015 18:12
@varindernagra yeah, it's a bug. if you copied the code from the sidebar, delete the empty spaces just before the word 'h2' in the <style> section. the sidebar text uses non-standard characters for space and it breaks the CSS code when copied over
gts00k
@gts00k
Nov 01 2015 18:12
binary agents bonfire
jpjenkins
@jpjenkins
Nov 01 2015 18:14
@h4r1m4u good to know
varindernagra
@varindernagra
Nov 01 2015 18:14
@h4r1m4u ahhaaa.. that works
jpjenkins
@jpjenkins
Nov 01 2015 18:14
all the same @varindernagra you don't need a semi-colon
h4r1m4u
@h4r1m4u
Nov 01 2015 18:15
@jpjenkins while you're right, it's a good habit to use the semi-colons because you will need them the moment the style for the element has more than one CSS rule
so @varindernagra use the semi-colons
varindernagra
@varindernagra
Nov 01 2015 18:16
@h4r1m4u sure, will do.
jpjenkins
@jpjenkins
Nov 01 2015 18:16
again, good to know :) thanks @h4r1m4u
CamperBot
@camperbot
Nov 01 2015 18:16
jpjenkins sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 468 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
varindernagra
@varindernagra
Nov 01 2015 18:17
thanks @h4r1m4u
CamperBot
@camperbot
Nov 01 2015 18:17
varindernagra sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 469 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 01 2015 18:18
my pleasure @varindernagra @jpjenkins
gts00k
@gts00k
Nov 01 2015 18:20
hey
any help on Bonfire: Binary Agents ?
CamperBot
@camperbot
Nov 01 2015 18:20
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Nic Galluzzo
@ngalluzzo
Nov 01 2015 18:21
yep
@gts00k what do you need?
gts00k
@gts00k
Nov 01 2015 18:27
@ngalluzzo solved it lol
Jeremy Roe
@jeremyroe
Nov 01 2015 18:36
Having some trouble with my setInterval function in my Pomodoro timer - anyone have a second to take a peek - console is tossing an “Unexpected Number” error on the final line but I can’t spot my error in syntax
Rex Schrader
@SaintPeter
Nov 01 2015 18:37
@jeremyroe You're closing your function call before the interval is sent
Jeremy Roe
@jeremyroe
Nov 01 2015 18:37
cool - Thanks @SaintPeter
CamperBot
@camperbot
Nov 01 2015 18:37
jeremyroe sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1321 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Nov 01 2015 18:38
@jeremyroe }), 1000); The first parentheses shold not be there
Jeremy Roe
@jeremyroe
Nov 01 2015 18:38
Cool - That did the trick!
Rahul Jha
@RJ722
Nov 01 2015 18:45
Can anyone plz tell me the problem with my code :

<style>
2
.red-text {
3
color : red;
4
}
5
</style>
6

7

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

Pranay Kothapalli
@kotAPI
Nov 01 2015 18:47
What's the error?
Jeremy Roe
@jeremyroe
Nov 01 2015 18:47
@RJ722 are you using bootstrap or some other integration that could be overriding your CSS? Perhaps try color:red !important;
Rahul Jha
@RJ722
Nov 01 2015 18:48
Your stylesheet should declare a red-text class and have its color set to red.
Pranay Kothapalli
@kotAPI
Nov 01 2015 18:48
nothing wrong with code, as jeremyroe suggested, something seems to be overriding ti
Rahul Jha
@RJ722
Nov 01 2015 18:48
But color is already red..
h4r1m4u
@h4r1m4u
Nov 01 2015 18:48
@RJ722 did you copy the class definition from the sidebar? if so, delete any spaces that you might have before the .red-text { bit. there's a bug when copying the code from the sidebar
Rahul Jha
@RJ722
Nov 01 2015 18:49
I can send the whole code
No I haven't copied..
Pranay Kothapalli
@kotAPI
Nov 01 2015 18:49
true, try typing out everything again.
Rahul Jha
@RJ722
Nov 01 2015 18:50

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

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

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

Sure..
h4r1m4u
@h4r1m4u
Nov 01 2015 18:50
try deleting the spaces around = : <h2 class="red-text"> ...
Rahul Jha
@RJ722
Nov 01 2015 18:51
Did it no effect
Pranay Kothapalli
@kotAPI
Nov 01 2015 18:51

as geremyroe suggested, add !important, after color:red

like this color:red !important

Rahul Jha
@RJ722
Nov 01 2015 18:52
OK
h4r1m4u
@h4r1m4u
Nov 01 2015 18:52
that shouldn't be the issue. there's nothing else overriding the style
Rahul Jha
@RJ722
Nov 01 2015 18:52
Nope not working..
Pranay Kothapalli
@kotAPI
Nov 01 2015 18:52
this is weird
h4r1m4u
@h4r1m4u
Nov 01 2015 18:52
can you copy the URL from your browser and paste it here?
Rahul Jha
@RJ722
Nov 01 2015 18:53
OK
h4r1m4u
@h4r1m4u
Nov 01 2015 18:55
delete the space after after color in color : red; so it is color: red;
@RJ722
Rahul Jha
@RJ722
Nov 01 2015 18:56
Not working..
Pranay Kothapalli
@kotAPI
Nov 01 2015 18:56
i just finished that problem
works fine for me without a hassle
h4r1m4u
@h4r1m4u
Nov 01 2015 18:57
deleting the space after 'color' made your code pass for me
Rahul Jha
@RJ722
Nov 01 2015 18:57
Yeah yeah it did
h4r1m4u
@h4r1m4u
Nov 01 2015 18:57
oh, and get rid of that !important bit
it shouldn't be there
Rahul Jha
@RJ722
Nov