@chris542 type three backticks ` (under the ESC key, if you have the same kbd layout as me), then press shift+Enter to start a new line without sending. Paste your code, press shift+enter again, then three more backticks

@TheAmazingKarla no, that on it's own won't work, but it's closer. If you use checkProp instead of "gift" or "pet" you are at least checking the variable. Now that you are doing that, look at the rest of the logic. You don't need so many if/elses

Hey all. I'm on the Profile Lookup exercise for javascript. I had trouble figuring it out, so I looked up someone elses' solution to reverse engineeer what I was doing wrong, and I dont understand why at the end of their solution the return statement is not an else statement.

@TheAmazingKarla you don't need to assign checkProp with a new value, you just need to know it has a value and use checkProp in the right places. You used it correctly in the if statement, you need to use it on one more place

Cannot for the life of me figure out why the button color and background color don't change at the same time when you click "New Quote" http://codepen.io/thedeany/pen/reGZZY The button color changes very clearly before the background color.

Explanation:

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

It has to add two numbers passed as parameters and return the sum.

It has to check if any of the numbers are actual numbers, otherwise return undefined and stop the program right there.

It has to check if it has one or two arguments passed. More are ignored.

If it has only one argument then it has to return a function that uses that number and expects another one, to then add it.

Explanation:

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

It has to add two numbers passed as parameters and return the sum.

It has to check if any of the numbers are actual numbers, otherwise return undefined and stop the program right there.

It has to check if it has one or two arguments passed. More are ignored.

If it has only one argument then it has to return a function that uses that number and expects another one, to then add it.

@meankraken - oh, okay... I cannot help you directly with that, I'm not up to speed on angular... if you should me a codepen post or something I might have a shot at giving you some help? I'm willing to try, at least...

@robdesautel - hello there... what lesson or challenge is this? What have you got going with it so far?

@robdesautel - okay - you have a slight misinterpretation of the functionality. You have a value (or should have a value) in the call to the function checkObj(); That property is associated with the argument in the function checkObj that has the name checkProp. That becomes the property name (or the potential property name) that you are looking for in the object myObj. You then need to have something that looks my myObj.hasOwnProperty(), because .hasOwnProperty is a method of an object. So what you are doing with this line: checkProp = myObj; is changing the value of the checkProp function argument variable. So you need the value that is passed in, and you need to use the myObj variable (which is the object) as I described...

@robdesautel - no you cannot do that. the checkObj function will have different property names passed to it, as you see in the test code that is below the test description. You cannot change what is being passed to it because you have no control over that aspect of the solution.

@daemedeor@robdesautel - you cannot make that change because the test code that is going to run against that function would be doing something totally different. the test code is going to have three different cases - checkObj("gift") should return "pony". is the first one. See that they are passing names of properties that are potential properties in the myObj object. So what you have to do is use .hasOwnProperty() to see if the value that is passed in is a property of the object.

@robdesautel - the scope of the variable myObj is global to the function, so within the function you can access it freely and see the properties and get the values without having to pass it into the function. So you really just have to take the step of using the variable checkProp as the argument within myObj.hasOwnProperty() and check to see if that's true. @daemedeor 's code that he posted is essentially what you need to do, it could be optimized slightly. I was trying to help you see how to do it.

@daemedeor - that wasn't a criticism, and it's not really a requirement, just a good thing to be able to do. I was trying to point out that it could be simplified a little, but they talk about some of that in later lessons, I think? The fact that a function works to meet the tests is all that's required. thanks for helping out!

@daemedeor - you're correct - sometimes the one-line solutions to a problem can be confusing... I know it gets me confused sometimes! Especially with some of the higher-order Array methods. I'm still trying to get a handle on some of those!

anyone with ubuntu? I'm trying to get started with babel and es2015 but my (npm install -g babel-cli) isn't working. honestly the whole goal was to get the react starter kit to work on the browser. I don't mind doing either though

@robdesautel - the example in the lesson is really a fairly clear example of how to use it. The only difference is that instead of having a literal string as the argument, as they have in the example, you are being given the value that you are trying to check. I don't remember what they give you to start with in that lesson?

if the property is found = myObj.hasOwnProperty returns TRUE. If the property is not found = myObj.hasOwnProperty return FALSE. You just use that information in your testing. As @daemedeor showed, with a slight rewrite:

@daemedeor - I explained that... just wanted to point out that their example of showing that it returns true or false can be used in the code with an explicit test, but it is not necessary. I was just trying to tie the example to the code that I was showing. There is yet another optimization, you don't need the else part.

@kmorton1988 - I'm wondering if your first test for "data.stream" is where things are going wrong at this point? Because if that has a "null" value, then it will not pass that test? It seems like you're just trying to scope out how to handle the return at this point. I was thinking that you can use .hasOwnProperty there, since I just spent an hour talking about that method here in some chat discussions...

@kmorton1988 - well, it looks like you're getting a lot of help here. But the first thing that I tried was to use the 'hasOwnProperty', and it is returning "Streaming Now" and "Account Deleted", but you don't have the user names because they are not available from the array at the point where the callback gets executed. But you could get the channel information from the returned data.

@khaduch@daemedeor I understand that I had a hard time understanding that challenge and the requirements. However what I was thinking is, if .hasOwnProperty is true then execute the return. However how blatantly obvious that it was wrong I didn't need you to tear it all a part to use me as a bad example. I am a learner and will continue to learn, but it don't help the learning process when I have to be the "what not to do" example.....thank you

@robdesautel - if you took offense at anything that I posted, I apologize. I was just trying to help you, and I didn't know how. Sometimes it is difficult to try and convey the information without face-to-face interaction. I didn't know where you were having confusion, as the concept seems to be simple to me. I was not trying to make any kind of bad example - it just seemed to be getting more confusing as the discussion went on. When I finally saw how you seemed to be stuck on the 'true' and 'false' aspect of the function, I tried to explain it clearly. As I said, no offense intended, I had no desire to make a 'bad example' of you. There are a lot of concepts here and some of them come a little more naturally, some of them are more difficult. I try to provide help, try to provide hints without giving the answer because I think in the long run that will be more helpful in the learning process? I might be wrong, or sometimes it doesn't work well.... I apologize. Thank you for your understanding!

@robdesautel - and one more point: this chat room concept is both great and terrible. You can get help here - but things get very confusing sometimes as people chime in with helpful comments, and other things get missed and misinterpreted. It's a struggle to find a clear thread of communication here, especially when you have multiple threads going on. It takes patience to try and help, and also to get help! Sometimes people are downright nasty here, most often not. I try not to be offensive - but sometimes you walk a fine line between just giving the answer and trying to coach someone toward understanding when that seems to be more helpful? But please don't be offended - there are many times when I give what I think is a good answer only to have someone else chime in and point out my error(s). I have an expectation that things in these chats don't always go as well as you'd like them to, so you have to take some things with a grain of salt. I appreciate people who are trying to learn this - I'm trying that, as well! Best of luck to you, I hope I can be more helpful and do it in the right way in the future!

@robdesautel programming is not easy. I struggle with it all the time. Take a break, however long you need, then come back and keep working those problems. Read some new documentation. Find someone on the forums you can help - the best way to learn is when you put yourself in a position to teach.

@khaduch@daemedeor while we were discussing I felt I was starting to learn a bit, but I still have some confusion, however it was after the discussion I didn't feel was 'helpful' starting from when you were discussing about my if statement. To me it seemed like the was snickering about how many times can he test a true statement. Like I said I would like to learn more about how this code worked and how that example was relatable to the lesson tomorrow if you're still on.

@robdesautel - sure thing - always happy to help. And as @daemedeor just said - part of it went to a discussion between the two of us on the merits of doing one thing or another, when many options are available... and I don't consider it "ripping" :) I just felt it was a healthy discussion about how to do this. It just happened to be in the context of helping you with something that you were having trouble with.

and @daemedeor is right - sometimes things can get nasty here, but I think that even some of that "nastiness" is more or less done in jest, or at least with tongue-in-cheek. (Although I have seen some things that seems nasty to me!)

Challenge: Introducing JavaScript Object Notation JSON

JavaScript Object Notation or JSON uses the format of JavaScript Objects to store data. JSON is flexible because it allows for Data Structures with arbitrary combinations of strings, numbers, booleans, arrays, and objects.

I think performance is worth tweaking when orders of magnitude are at stake (less time, less memory, LOC), but smaller than that - waste of effort. focus on making sure it works, and others can easily contribute to it / take over

@0x0936@daemedeor@robdesautel - my last comment for now - I also have a lot of background in different programming languages, so a lot of the things are not "new" to me. I sometimes find that people get tripped up on things here through the lessons just because there are many concepts introduced, and then a "leap" to something that was not clearly explained or sometimes it takes some deduction from what was presented up to that point. Or something that was presented quite a few lessons back that was covered and then maybe forgotten (one of my problems...) So I sometimes have to remember that things that I think are 'easy' aren't all that intuitive if you are approaching this for the first time - maybe the lessons could be improved somewhat, or maybe the "Learn what to do if you get stuck" lesson should be reviewed. "Read-Search-Ask"...Good night all - time to shut down (for me) for the night...

Hey..I'm in Everything Be True challenge. I am not able to find out the error in my code. Though it works fine if you see console.. but yet shows XX in test results.I have not added conditions for last two test cases. But this should atleast work for first few.

@buonarfcc What we want is key: value;. In this case, key = alpha and so on and value is Adams. So it would look something like 'alpha': 'Adams'The lookup object can then then be used in the return statement as lookup["alpha"]We get the key in a variable (lookup), hence lookup[lookup]

I'm working on the Map the Debris problem and my solution prints out the correct answer (so I think) but i can't get it to pass. The first test will pass but the second will not. What am I missing here.. ```var answer = [];function orbitalPeriod(arr) { var GM = 398600.4418; var earthRadius = 6367.4447; var a = earthRadius + arr[0].avgAlt;