@Carowyn getGear is what you might hear referred to as a "getter". It is used to return a certain object property without making modifications, and in this case its function does not need a parameter. You say return setGear, but what you really want to return is your bike's gear property.What is your bike's gear property called?Hint, car's speed property is called speed.

@kysnazz It's because binary is being used behind the scenes to represent those decimal numbers, which unfortunately isn't perfectly precise. You just so happen to have stumbled upon one of those cases.

no need to call replace and tolowercase againalso... this comparison (newString === str return a boolean value true or false..soo u can directly return the result of thatreturn newString === str;@Hijerboaand remove the if

@pablovvb Also note, as @moigithub points out, you can pass values into a function. Or rather, more importantly, you can provide that function with a parameter which enables you to reference a certain value...

@georgebatton Shift just removes first element from array. Doesn't really care what we lowly humans and/or rodents have to say. :pThere's no need for any kind of special input in order to remove an element.

Hi all,I am working on the "Arguments Optional" challenge. I have tested all 5 cases. The returned results are exactly what FreeCodeCamp wants, however, when click submit, only the top two cases are marked as correct. The last 3, which expects "undefined" to be returned, are marked incorrect. When testing for all 3 undefined cases in FCC's editor window, the returned result is "undefined" (It shows on the left hand column).

Does anyone know why FCC won't recognize the returned values of "undefined"?

convertToF(0) should return a numberconvertToF(-30) should return a value of -22convertToF(-10) should return a value of 14convertToF(0) should return a value of 32convertToF(20) should return a value of 68convertToF(30) should return a value of 86i need help

@ednorstrokes == par but that's the last one I'll give you, you're on your own from thereTry to see the logic of comparing strokes against the first column and returning the second, that's how you normally read a table

@ednor If you're still having trouble, let's take a step back on this problem for a moment.

Suppose par is 5. Let's not think of it as a variable at all... just 5.

if I hit ball in hole in 5, so strokes = 5, then I get "Par". What is the relation between strokes and 5 (par) here? Does strokes + 7 = 5? Or from another perspective, what is strokes - 5?if I hit ball in hole in 6, so strokes = 5, then I get "Bogey". What is the relation between strokes and 5 (par) here? Does strokes + 7 = 5? Or from another perspective, what is strokes - 5?

@Marmiz its all in canvas so i don't know if it'll work with no elements. I have a function tracking the mouse position and the color its on. i didnt know if there is a particular canvas method with what im doing that would work

Can someone familiar with flexbox please help explain how to get the h2 element in the following code to take up its own row above the other 3 div columns, I'm having difficulty getting the h2 text on its own row above 3 columns. Thanks for any help.

Imagine for a second.. You had to write a mini-research paper on someone:Who of this list ... would you chose?Immanuel KantEdgar Allen Poe (Not for his literary works but for his cryptograms)John LockeSocratesOr... Other.

@revisualize Honestly, the main reason I haven't done that thing is because I don't know who to do it on. There was a while I was considering having user enter their name and making it into a story about them... as a duckling on an adventure.

@moigithub if i understand correctly that means I have to pass the whole array inside charCodeAt() and iterate over a loop to get unicode values for all the elements in the string. is there a way to do this without using a for loop?

How can I get the array of objects accessible outside of the function? any guidance would be helpful. I am trying to take the array of objects and put them into the HTML of the page in table format . I am able to log the array to the console, but can't grab specific data. https://codepen.io/LemonStain/pen/yXPQbb

for only loops/iterate when condition is true.... so yes @surferpilgrimbut.. also.. return keyword exit the function immediatellythat return like u have.. will break ur loop.. making this iterate only onceand... charCodeAt syntax is wrong... check on mdn.io/charCodeAt

lol I've looked over it before, I was deep into objective-c and swift, the logic and everything is pretty much the same but for some reason I can't get the damn syntax and the way the methods work. I got contacted today out of nowhere for a scholarship to a bootcamp but i have to take an assessment test in JavaScript 😰

Yea I got my fingers crossed, I been doing the practice test all day, I been gettin the same exact solutions except for some stupid syntax or some methods that don't work in JavaScript like they do in swift or obj-c.. It's killing me lol

@jamesjpk123 The key if you're going to start off by hardcoding is not to try and do everything at once in hardcode, but to narrowly focus and as you go along say "okay, what can I do to generalize this? It does this in this case, how do I make it do this in all cases? etc..." changing to something closer and closer to what you need as you go along.

It might also help to think a little bit beforehand about the steps you have to take so you're less likely to get blindsided.

@abhishek4kahol I used a different API, you could hack the api call I suppose to get through that restriction like @Marmiz said, but even so I don't think that should be recommended. The point is you don't want a user to see it because they can take it and rack up calls (hopefully you didn't put a credit card on your account)

@Frostbites You could replace the word in the array, like lowArr[i] = lowArr[i].charAt(0).toUpperCase() + restOfTheWord;, and after the loop return lowArr.join(" ");, or use another array for that. For the rest of the word, you could use any of substring, substr, or slice.

@abhishek4kahol since you're using angular (I believe that's where the $http come from right?) You can still try with the get jsonp method and adding a callback to the request.JSONP is the "official" suggested method for CORS issue by codepen

Hello. need help with some javascript task i'm trying to accomplish. its an array with integers and i want to increase each array item by 1. any help?``` for (var i = 0; i < arr.length; i++) { return arr[i] + 1; }

@nanaowusunyamekye For future: if you write it in a code block, it makes it easier to read and allows you to do some formatting. To write it in a code block...for one line: ``` code goes here ```or for multiple lines vvv```code goes here```You can also edit your post if you make a mistake by clicking the … that appears when you hover your mouse over your comment.

@nanaowusunyamekye relating to the code you posted, return ends the entire function and returns the specified value. So you should only return when you're absolutely certain you've done everything you needed to do.

@BryanBusterHere's an outline, if you follow it step-wise it'll help a great deal in telling you what to do or step you missed

1. you need a loop to pick each objects in the contacts array
1.1 in the loop you need to
1.1.1 check if the objects picked has the firstName property equal to the firstName parameter
1.1.1.1 you need to check if it has a property prop
return the value of prop in the object
1.1.1.2 return no such property if 1.1.1.1 is false
2. when your loop is done looking through contacts return no such contact

hey, I have a JSON collection of objects which can come from multiple sources. I need to assign them unique ids. First what came to mind is calculate SHA1 and use that as the ID. These IDs will be later, among others used in jquery-generated html as DOM id properties.

My question is, is SHA-1 40 characters long an overkill for this purpose?

@amatayamada If the order of the fields is consistent, that should be fine (in Javascript, object property order is somewhat arbitrary, sometimes order of insertion, with in some browsers different behaviour for deleted and re-inserted properties, or alphabetic, with numeric properties in numerical order before the rest in default string ordering).

Hi I am working on the wikipediaviewer but get a CORS error with the following request. What exactly should I do? And why is there no documentation on it on the wikimedia pages?$(document).ready(function(){
$.getJSON( "https://en.wikipedia.org/w//w/api.php?action=query&format=json&list=search&continue=&srsearch=wikipedia&srwhat=text&srprop=timestamp", function( data ) {
console.log(data);
});
});I remember to use something like this on the end of the query: ?callback=? But it does not do the trick. Can someone help?

@amatayamada If you need reproducible values (same ID on same input), I'd use a hash, or UUID version 3 or 5. If it just were for avoiding collisions, and each input would be handled once, I'd use UUIDs of any version (but if you're ok with same object receiving same ID twice, hash again would work, too).

@amatayamada haven't looked at your code but in order to JSfiddle to listen to click events you need to change the JS loading in settings from onload to no wrap in body... or it used to be like that :)

@amatayamada Haven't read that link, but the problem with dynamically changed code is that you'd have to attach the event listener to the click-sensitive elements you just added to the DOM. The way around would be attaching the event listener to an element that's above and won't be removed, and filter for clicks bubbling from the meant-to-be click-sensitive elements you dynamically create.

@EpicTriffidHello all. So Im currently working on changing the text of a message when i initiate a click event. I can change the text, but I dont know how to put the fadein/fadeout into my js code$("#motiv").on("click", function () { $(".test").html("Loading Motivational Quote..."); });that's what im doing to change the text of "please slect quote"

@koder3 Ternary is an expression-type if/else, and as such has to have some value. It's not possible to skip the else part. Wouldn't make much sense to call it "ternary" then. ?: is the only operator with three operands.

@sjames1958gm@Blauelf thanks. btw i used to only need to click on the help box to access this chat room. but now there is no help box. theres only a "get a hint". i need to manuall go to beta free code camp then click on help which is avaialble on any of the challenges. (unlike normal freecodecamp). so whats up with that. am i banned?

Shouldn't be too hard then. todomvc.com has ToDo list implementations in all possible frameworks. If you want it to look like a blog, you'd need a few more fields, though. Todos don't have all that meta data like title, author, date, ...

@Kriis1 Variables in JavaScript should be in camelCase, starting with lowercase letters. Only functions used as constructors should start with an uppercase letter (Math object is probably an exception, I don't think you should construct your own maths object). And constants should be all-caps. The fCC challenges usually follow these recommendations.