Hello! Can anyone help with the Weather App challenge? Cannot get info from my JSON object into my html (I had the same problem with Random Quote Machine and have tried my solution from there with no luck.) Here is my pen: http://codepen.io/lizzieshipton/pen/NNYprM?editors=0010

@dagman Loops are quicker, each function call has some overhead (so for long code blocks the overhead is relatively smaller). I think I would add some standard values, so that it works on empty array, like

@coymeetsworld@Blauelf is that something that applies to APIs in general...for example, the open weather map site just says "api.openweathermap.org" and doesn't specify that you need http in front. so all API urls need to have http added to the beginning? (sorry total newb here...)

If you don't specify a protocol (or // for same-protocol-as-here), your URL is relative path on the same server. Like all those dead links with href="www.google.com". Simply does not work, as this could also be a path on your server (relative to current path), and the browser should not guess.

anyone feel like taking a look at my JS.......i want to run a function using a variable (user input from function before) as an argument.....when i do that it crashes my browser......if i call the function manually entering a number it works fine...i don't understand

@zico0o Quotes show that something is a string literal, a value of type string written in javascript code. If you assign that to a variable, you won't start using quotes around that variable name (the meaning of that would be a string that happens to have that variable name inside, but without any connection to the variable).

i can't check for a string in if condition statement i use it as a var without quotes inside my condition.it run correctly, i was only confused with the right syntax for the condition.thanks again @Blauelf

Truthy is not falsy. And falsy is any of those six values 0, null, false, undefined, NaN, "". They have in common that truthy values when converted or coerced to boolean become true, and falsy values become false. Most functions that expect a boolean in reality also accept truthy/falsy values. That's how while (arr.length && !func(arr[0])) arr.shift(); works, A&&B evaluates to A if A is falsy, else to B.

anyone feel like taking a look at my JS.......i want to run a function using a variable (user input from function before) as an argument.....when i do that it crashes my browser......if i call the function manually entering a number it works fine...i don't understand

@Chrono79 That will do about the same as !! (!! is shorter, but Boolean is a function, and for falsy bouncer a function is really useful)

@kmulligan You could use a function like function(elem) { return pre in elem && elem[pre]; } (if pre is not a key to elem, elem[pre] would silently fail and evaluate to undefined, which is also falsy, so one could skip the first part and just return elem[pre])

I ask because to me the one I called 'traverse' seems cleaner, but the FCC lesson teaches the 'increment' method. I was wondering if that was because it was better practice, or just because the increment method works when only accessing odd/even arr elements and they didn;t want to teach both mehods? Any ideas?

@JacksonBates with the logic of the incrementArrayOutput for you can iterate no only one by one, you can use the increment you want there, also you can run backwards if you use a decrement, the other way you run through all of the items one by one in ascending order

One way to think of a multi-dimensional array, is as an array of arrays. When you use brackets to access your array, the first set of bracket refers to the entries in the outer-most array, and each subsequent level of brackets refers to the next level of entries inside.

@JSOdin you're right - just found this: http://blog.humphd.org/vocamus-1205/?p=1205My favourite quote from this: "This is one of those things that everyone knows not to do, so they never mention it, and new developers never get told it's bad. Well, it's bad. And it bears repeating." Thanks :)

@ChrisL108Same thing as jquery all of them simply bind event listeners to DOM element. The more you use JS you'll notice there are many different ways of attaching event listeners and handlers to DOM elements. Don't worry about being a bit overwhelemed early on.

@ndburrus I ran your code, it passing hte first two tests because your if statement will never reach the second condition.You need to review how if statements work it's what I'm trying to explain to you.

@joshbivens yeah - that one stumped me for a little while. The trick for me was to really learn how to use array.filter(). I tried reading the MDN entry for it, but it was a youtube video that finally helped it click for me.

@Isymm You need to use square brackets when you are working with a variable name rather than the actual name of the property..My previous example was poorly thought out and will just confuse you. Ignore it.

@96street Essentially all your code does is scroll past these images. The reason you don't see anything is because once it reaches the last image there is nothing there. However as soon as you are reaching the last slide it resets back to the first position. So if we add the three slides to the end of it then when it scrolls back to the start, we won't notice that a switch has occured.

my assignment looks like this Compound Assignment With Augmented AdditionIn programming, it is common to use assignments to modify the contents of a variable. Remember that everything to the right of the equals sign is evaluated first, so we can say:

myVar = myVar + 5;

to add 5 to myVar. Since this is such a common pattern, there are operators which do both a mathematical operation and assignment in one step.

One such operator is the += operator.

myVar += 5; will add 5 to myVar.

InstructionsConvert the assignments for a, b, and c to use the += operator.

@jw1540 - there is another challenge "Diff Two Arrays" that does a symmetric difference on just two arrays (I didn't realize that and forgot about it.) I don't know if that will help you with this, at least it's a starting point?

Write a function nextInLine which takes an array (arr) and a number (item) as arguments. Add the number to the end of the array, then remove the first element of array. The nextInLine function should then return the element that was removed.

Hey guys so I'm trying to add to this json object. the instructions are to make a new album and have artist title release year and format properties but the tests are saying it doesn't have any properties, any ideas?

@shotgunleo - you need to add that new entry within the original array, so just before the closing bracket, you enter a comma after the previous object, and then enter your new one in a similar manner. That is what they are expecting

@AndrewThM Let's break your function down. You start by taking in celsius as a parameter. Then you define a variable named convertToF which is equal to 9/5 + 32. Finally you return the (undeclared) variable fahrenheit.

There are two things wrong with your function. Try to figure out what they are.

hey guys, I keep getting "value.toFixed is not a function" error in my console even though I explicitly checked that 'value' is a number with "typeof" the line before. Has anyone had that issue before?

@Radascript I think you have to parse it before calling the the toFixed() method. This method converts a number into a string, so I think the second time around your while loops fails because ansPennies is now a string?

@ALMY91 for loops are good if you need to use the iterator for something. Usually for the index of an array. W while just loops until a condition is not met. you would have to manage the iterator in that loop

hello i was doing check for Palindromes in Basic Algorithm, how do i print the value of string2 and string3 in the console, i used console.log(string2); but it is not working, help me please. here is my code

@sameershamsudheen no need to escape _ because it's not a special character. your regex matches an underscore after a non-word character, so you need or in between them using | Test regex here: https://regex101.com/

You pass that function a callback function, bu you don't call it yourself. A function (function literal, named function, or variable pointing to function) followed by parentheses means that you call it at the time that code is evaluated. You want to call your callback only after the async action has finished.

@naassi At the time you call the position, the callback function does not exist. That's a classical use-before-initialize. Note that named function are done first, but assignments of functions are not.

@omiq17 I just looked up map-the-debris, and the "map" in the title might be a hint. You are meant to map objects to other objects (then no longer with avgAlt, but with orbitalPeriod), so return an array with the same number of objects as the input array.

Hi wanted some help with parsing JSON. I have used stringify to get the raw data display but don't know who to only get selected items (e.g. game or status null). This is for Twitch TV and codepen is http://codepen.io/vaspv/pen/VaXLyG

@kirbyedy hi yes that is what I want to ultimately achieve but how do I find out if stream value is null? if I type data.stream === null or data[0]=== null then nothing is fetched . This is where I'm stuck - on how to get the value of a specific field only like stream or game or id etc.

@cvdeby"&<>'".replace(/[&<>"']/gi, replacer) like this? replacer will be called with a couple of arguments, but the first is the whole match (followed by groups, then I think some start index and the whole string, but that's in the documentation of replace