FAQ: Welcome to Codecademy! - Change Physics!

This community-built FAQ covers the “Change Physics!” exercise from the lesson “Welcome to Codecademy!”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Web Development
Code Foundations

Welcome to Codecademy!

FAQs on the exercise Change Physics!

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

Though this code is working perfectly on codecademy.
Im trying to use DrawName,mouseResponseThreshold outside this plaform**
Its not working.Can anyone help me to get to know the concept associated with these.
Also how to use them outside this platform.

5 Likes

These are programs specially built for this exercise. As you’ll start to work your way through the JavaScript course you’ll learn fundamental instructions and code which you can use outside of codeacademy’s course engine.

1 Like

What is mouse interaction? I don’t know about it’s meaning

The OS is constantly tracking the mouse pointer so it always knows where on the coordinate plane it is situated using offsets from the left side for horizontal position, and from the top for vertical position. Just moving the mouse pointer is an event. We can listen for events such as mouse movement, button clicks, scrollwheel movement, etc. and react to those movements with event handlers. This is mouse interaction.

1 Like

The variable bounceBubbles is defined in an earlier stage, and so is mouseResponseThreshold, friction and rotationForce right??
or are they fixed commands in the syntax of this programming language(have fixed values)?

They are programmer defined variables that do not exist in the language, proper. If you examine the bubbles.js file (do not change anything) you will find the bounceBubbles function. We set the values on the three variables in the index.js file.

1 Like

I like this exercise! But could anyone explain why the animated dots will never rotate back when the rotation value is larger than 0.01?

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