How to learn a JS when u don‘t know mathematics?

Yeah, maybe you are right. I had a not very good teacher who discouraged the desire to learn math in general, which is why I have it at such a terrible level.
but as in the example above, I know how to multiply 2 * 4, but I don’t know, for example, how to calculate if I have a multiplier and a result. I do not understand how this can be calculated.

That would be division. Again, you aren’t required to do that math for this challenge, but basic arithmetic will come up pretty often so you’d probably benefit from finding a good refresher course.

1 Like

Thanks. I will try to do this.

While it may be not needed for a lot of programming tasks, division and simple algebra is “kind of” like reading and writing these days.

Even html designers need to count some pixels and ratios.

Once again, I strongly advise to get your math knowledge. It will help you with more than just programming.

Simple example:
There are some people that do not know how to get their budget right. No matter how much they earn, as soon as they are out of job they are out of money. They are often good people, well educated in other areas.
Unfortunately for them, they are being exploited by loan agencies or insurances, or whatever else, because they do not know how to check if they are offered a good deal or a “legal scam” one.

My friend’s mum got done like that. Bought some advertised product, got put into a small debt. After a few years that debt was about 10 times higer, even though she paid every month.
If not for my friend, she would pay that for the rest of her life, and debt would only grow despite that.

They took advantage of the fact she did not know how to calculate interest.

Another fun example: nutrition - Did A&W customers think 1/3 pound burger patties weigh less than 1/4 pound ones? - Skeptics Stack Exchange

While may be not true or is a bit exaggerated, there is some truth to this.

People that know math don’t realise how much of a difference does it make.

I do not know how but I understand this banking fraud or something like this.
and I still do not understand how to count)))

the maths lessons on Khan Academy starts from Pre-K level, you can start at the level you need, and go forward

1 Like

If you are going to be a developer you will need at least a basic understanding of math(s). You will need to understand addition, subtraction, multiplication and division, at least.

While I do think you should do the Khan Academy courses or other learning, I’m going to try and make this really easy for you to get past this point.

Multiply just means adding something more than once. So 5 multiplied by 3 just means 3 lots of 5, or 5 lots of 3. You will get the same answer both ways. I am a great believer that we learn by doing, so prove this to yourself by getting 3 piles of 5 coins (or marbles or matchsticks or grapes or whatever works for you). Put them all into one big pile and count how many you have got. That is the same as multiplying 3 by 5. Then get 5 piles of 3 coins. Put them all into a big pile and count how many you have got. That is the same as multiplying 5 by 3. It should be exactly the same number as before!

In case it isn’t obvious, in most programming languages the * sign means multiply. In mathematics and on a calculator this is often a completely symmetrical symbol that looks like the letter x instead.

When you have two numbers separated by the multiply symbol, you just multiply them together to get the result. So on your calculator you would press 5 x 3 = and it would give you the answer of 15. This is the same as getting 5 piles of 3 coins (or 3 piles of 5 coins) then putting them all into one big pile and counting them. You would be able to count 15 coins in total.

Division just means dividing things into separate piles. So if you had 15 coins and split them into 5 piles you would have 3 coins in each pile. If you instead split them into 3 piles you would have 5 piles. Note the number are the same in both cases. This is not a coincidence. You have proved that 15 divided by 5 is 3; and 15 divided by 3 is 5. So if you know any two of these numbers you can work out what the other one must be. The symbol for division is a /. So 15 divided by 5 is written as 15 / 5 and 15 divided by 3 is written as 15 / 3. If you press 15 / 5 on your calculator then press the = button you will get the answer of 3. If you press 15 / 5 then the = button you will get the answer of 5.

So the following expressions are all true :

5 * 3 = 15

3 * 5 = 15

15 / 3 = 5

15 / 5 = 3

Taking all that together we have some basic rules.

  1. If we have two numbers (eg 5 and 3) and the multiply symbol we just multiply them together to get the answer or result. In this case 15.

  2. If we know the answer and one of the numbers we do the opposite and we divide the answer (15) by the number we do know (3 or 5) to work out the missing other number.

This is the basics of arithmetic and algebra. When we have a missing number in algebra we usually replace it with a curly x. In computers we usually make it a variable and give it a name instead.

So it should be obvious that if:

x = 3 * 5 (this could also be written as x = 5 * 3, or 5 * 3 = x, or 3 * 5 = x)

then x must be 15.

We can also say that

If x * 5 = 15 (or 5 * x = 15) then x must be 3.

If x * 3 = 15 (or 3 * x = 15) then x must be 5.

You should now see how we are dividing the result by the number we do have, to find out the missing number. So returning to your problem.

x * 8 = 80


x = 80 / 8 (divide the result by the number we do know to work out the missing number)

In other words if you had 80 coins and you split them into smaller piles with 8 coins in each, how many piles would you have? Try it and find out! Or if you had 80 coins and you split them into 8 piles, how many coins would you have in each pile? The answer will be the same.

Spoiler: You can get your calculator to do this for you by pressing 80 / 8 =

Once you have this number you can put it into your program instead of the 0 so that it passes the test.

Most of us learned enough math for most web dev jobs by the time we were 12. Realy, there are certain jobs where you need more, but there are also plenty than need only basic skills.

Thanks. your answer helped me understand something. But I still can’t count it without calculator, although I start learn Khan Academy. I have never before Heard about academy. it explains everything in a very accessible way

You can use the calculator to do that operation

There is no way around it you need to know basics for math - addition, subtraction, division, multiplication, and how to count - for some of the challenges.

A calculator can give you the result of inputs, but the challenges ask you to give them inputs to get a result. If you don’t know basic math you don’t know the inputs to enter to get the result.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.