Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,150,707 members, 7,809,688 topics. Date: Friday, 26 April 2024 at 01:11 PM

Everything Javascript: Frontend And Backend - Programming (2) - Nairaland

Nairaland Forum / Science/Technology / Programming / Everything Javascript: Frontend And Backend (2367 Views)

Omo! See My MERN Full Stack Diamon Web App (frontend And Backend) / Why Are Backend Developers Paid More Than Frontend Developers? / Learn How To Be A Good Frontend And Backend Programmer (2) (3) (4)

(1) (2) (Reply) (Go Down)

Re: Everything Javascript: Frontend And Backend by updatechange(m): 6:15pm On May 16, 2021
Good
Re: Everything Javascript: Frontend And Backend by Dremca(m): 5:35am On May 26, 2021
Today, let's talk about numbers in variable. Just like in mathematics, we can add, minus, divide or multiple numbers. In Javascript, we can do all that and more. Below is the the following mathematical operations we can do in Javascript:
+ means addition
- means subtraction
* means multiplication
/ means division
% means modulo

I know the last operation looks strange. You may be thinking that's percentage but it simply means a remainder after dividing a number. For instance:

let adekunle = 7 % 2;

Javascript will return the result as 1 because the remainder we will have after using 2 to divide 7 will be 1. How about:

let ciroma = 10 % 5;

The above result in Javascript will be 0 because the the remainder we will get after using 5 to divide 10 will be 0. You can try out other 4 operators in your computer since is already what we are familiar with.

2 Likes 1 Share

Re: Everything Javascript: Frontend And Backend by updatechange(m): 7:44pm On May 27, 2021
Dremca:
Today, let's talk about numbers in variable. Just like in mathematics, we can add, minus, divide or multiple numbers. In Javascript, we can do all that and more. Below is the the following mathematical operations we can do in Javascript:
+ means addition
- means subtraction
* means multiplication
/ means division
% means modulo

I know the last operation looks strange. You may be thinking that's percentage but it simply means a remainder after dividing a number. For instance:

let adekunle = 7 % 2;

Javascript will return the result as 1 because the remainder we will have after using 2 to divide 7 will be 1. How about:

let ciroma = 10 % 5;

The above result in Javascript will be 0 because the the remainder we will get after using 5 to divide 10 will be 0. You can try out other 4 operators in your computer since is already what we are familiar with.



For starters like me, pls how can I understand clearly the method of the end result pls kindly explain better...
Cos when 10%5= 0 and 7%2=1
Does it mean 11%5 will be = 1?
Pls kindly explain further
Re: Everything Javascript: Frontend And Backend by akus6060(m): 4:56pm On May 28, 2021
updatechange:




For starters like me, pls how can I understand clearly the method of the end result pls kindly explain better...
Cos when 10%5= 0 and 7%2=1
Does it mean 11%5 will be = 1?
Pls kindly explain further
using % sign(modulus) means u are looking for the remainder. We know that if we are dividing 11%5, (that is 5 will go into 11 twice and the remainder is 1 ) so ur answer will be 1

1 Like

Re: Everything Javascript: Frontend And Backend by Dremca(m): 5:30pm On May 28, 2021
You are very correct but it will be confusing for beginners since ES6 is used more often.
akus6060:
U are really doing a nice and perfect job by breaking it down to the nearest minimum so that beginners can get the message u are passing across. But u would have explained about ES6 (that gave rise to let and const) because when learning JavaScript, what we first encounter is var declaration which was used for earlier version of JavaScript.
Re: Everything Javascript: Frontend And Backend by updatechange(m): 8:43pm On May 28, 2021
akus6060:
using % sign(modulus) means u are looking for the remainder. We know that if we are dividing 11%5, (that is 5 will go into 11 twice and the remainder is 1 ) so ur answer will be 1

Great thanks, so what I will like to know now is how they all being put in use. *+-%
Re: Everything Javascript: Frontend And Backend by Dremca(m): 9:17pm On May 28, 2021
A common use of modulo is when we want to write a Javascript program for finding even or odd numbers. There are other use cases. Learning programing is like knowing the uses of all carpentry tools like hammer, saw, nail etc. So is now left for you to know the tool you need in solving the problem.
updatechange:


Great thanks, so what I will like to know now is how they all being put in use. *+-%

1 Like

Re: Everything Javascript: Frontend And Backend by Dremca(m): 6:58pm On May 29, 2021
Let's talk about other operators that can be done with numbers. They are:

++ means increment operator
-- means decrement operator

The increment operator increases the number by 1 when is run in Javascript while decrement operator decreases the number by 1 when run in Javascript.

For instance:

let increment = 5;
increment++;

We can use any variable name with the counter. It is most common using counter instead but still remember you can use any variable name.

We first declare the variable to be 5 and any we ran the code, it will be increased by increased. If we ran the increment operator, it will no longer be 5 but will be 6. If we run it the second time, it will 7. If we run it the third time, it be 8. So the number keeps increasing each time we run the increment operator.

Same rule Applies to the decrement operator only that the number decreases by 1 instead of increasing by 1. For instance:

let decrement = 10;
decrement--;

4 Likes

Re: Everything Javascript: Frontend And Backend by Dremca(m): 2:35pm On Jun 14, 2021
Hello guys, if you have questions on what I have explained so far, please ask.

(1) (2) (Reply)

Front End Developer Vs Cloud Engineering / Whats The Difference B/w Mysql And Sql: Do They Relate? / Junit: How To Set Classpath On Windows Xp

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 20
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.