FAQ: Welcome to Codecademy! - Change Physics!

Quite possibly due to infinite space. Think of the New Horizons spacecraft that just recently sent us a crisp photo of an object way out in the Keiper Belt.

The lesson fails to advance to the next task when I click on the NEXT button… Also the Code editor fails to display the actual code discussed in the lesson comments in the instruction panel

Why the variables defined without any of keywords var, let or const in index.js ?

If the declaration is made in global scope then the keywords are optional. It does nothing to alter the scope.

it doesn’t declare a global variable, it creates a global property.

Since variable declaration creates property with the DontDelete flag, the difference between var x = 1 and x = 1 (when executed in global scope) is that the former one - variable declaration - creates the DontDelete’able property, and latter one doesn’t.

In strict mode, assignment to an undeclared identifier is a ReferenceError.

And in the end do you think that teaching bad practice from the start is a good idea ?

1 Like

Not if it leads to more research; besides, who’s teaching? It is a long way from here to working in a production environment, with plenty of time to sort out the confusing concepts like scope and the global object in the course of learning. Getting into the finer details and splitting hairs puts too much on a learner’s plate.

Ok and I am about it. If there is no time to teach about confusing concepts just don’t confuse learners.
When I saw in this exercise that variable declared without var I said okay they choose this way of teaching, but right in the next exercise I saw that variables are declared using var and that confused me a bit but I said ok lets continue to see whats happening, and in the next exercise I saw that the variable declared with var in theory and without in the editor and I said stop its enough, we should do something with this.



I’m just about to keep same style. In this concrete case, declare variables either using var either without, don’t mix them without describing differences.

What you are referring to is inconsistencies in the courses, which are in the hands of the curriculum development staff over at CC headquarters. We have no hand in that, other than to point out what others point out to us in the forums.

The fact remains that var is on its way out, having been supplanted by a better keyword, let which gives block scope, not just function scope.

As for deleting variables, we can fashion our code so that there is never a need to delete one, just put it in a function and when that is exited, everything gets garbage collected, or put it in a block, which also gets garbage collected when the block is exited (not so for var).

Learners are often asking which is better, to which my response is usually, “don’t fuss over that, right now.” Syntax is more important at this stage than best practices. Let one thing sink in before extrapolating qualitative details that lead away from the foundational material.

The courses on CC have seen a lot of transition and iterations, with many of the concepts of ES5 and ES6 being overlapped. Any learner is going to find this confusing as they attempt to get off to good start. My suggestion there is to not worry about how good anything is, at first. Take the time to make lots of mistakes and try all sorts of ways while expectations are still low. In a year’s time, after copious amounts of practice, drill and experimentation one is better able to comprehend the reasoning behind style guides and best practices of the industry.

If we expect to never fall of a horse, then we will never learn how to ride one.

Ok as I understnd I should refer to curriculum development staff for this kind of questions. Thanks!

1 Like

I need help solving the change physics exercise I’ve already put the mouseReponseThreshold to 150 and I haven’t move on the next question

Hi, I’m a new learner. My question is, how does the function bounceBubbles(); know about the new variables mouseResponseThreshold; friction; and rotationForce in this exercise?

The variables like friction and mouseResponeThreshold are mentioned before DrawName, but you don’t see them inside of the prenthesis, so how does it know that the variables are referring to it?

what does “friction” do? does it slow down the animation?

Pretty much, yes. Friction is a force that acts opposite to the direction of travel.

Consider the Soyuz as it leaves the International Space Station on its return to the surface. When it meets the atmosphere at 17000 mph, it is friction that causes the tremendous heat (~3000 degrees F).

2 Likes

2 posts were split to a new topic: Interesting behaviors when rotationForce is sufficiently small

A post was split to a new topic: Bubbles physics values

Hello! I set the friction to .001 and it greatly diminished the dot size. Beyond that, it also stopped the dots from responding to my cursor.

Why is this? It states “This variable controls how strongly the dots will try to return to their starting position” but I’m assuming it actually influences more than just this, correct?

1 Like

Answering that question will be in your hands once you complete these courses. Happy coding!

The numbers associated with the colors are they always the same?

If the numbers are always the same, the colors are always the same. Do you mean, can we change the colors?