N
N
Nikita Gusakov2013-11-18 22:55:16
JavaScript
Nikita Gusakov, 2013-11-18 22:55:16

How to add two numbers in JavaScript?

Please tell me, I have and How can I put them together? var a = 10;var b = 15;

Answer the question

In order to leave comments, you need to log in

12 answer(s)
C
codercat, 2013-11-18
@hell0w0rd

You should use Jquery for this.

A
Artem, 2013-11-18
@add1ct

trolling is not counted

I
issssrt, 2013-11-21
@issssrt

var c = Number(a)+Number(c);
alert(c);
ps Comrades, newbies, before asking questions, google in Google.

M
Microdel, 2013-11-18
@Microdel

var c = a + b;

Y
Yuri Yakovlev, 2013-11-18
@twentyfivesymbolsusername

Oh my god, questions.

C
codercat, 2013-11-18
@codercat

Also try to deploy apache and php, then just send an ajax request to the file, which, using this library https://github.com/Herzult/SimplePHPEasyPlus , will add 2 numbers and return them to you in json. And don't forget to filter the data.

S
switlle, 2013-11-19
@switlle

Thank you all for the detailed replies. The other day I faced the same problem. Finding a solution was not easy. It's good that you can find such detailed comments.
But so far I have not figured out how to do the subtraction.
If it’s not difficult for you to write a separate article about how you can do addition and subtraction, about multiplication and division, I don’t think about it yet, but if you manage to expand it in an article, I would be very grateful to you.

L
leventov, 2013-11-20
@leventov

Pathetic plagiarism.
ssRUr.gif

R
rozhik, 2013-11-19
@rozhik

tu2.png

var a=10; var b=15;
for(  alert('run');  b>0 ; b --,a++ ) alert('I am working');
alert('Add one to '+a+' To get result ');

S
Stepan, 2013-11-18
@L3n1n

kak-skladyvat-dvoichnye-chisla1.jpg

A
Anton, 2022-01-13
Websaytovsky @ws17

var result = +price + +sdek;

A
Andrey Belov, 2013-11-18
@Andrey_Belov

At least started a new trolling account, or something.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question