Dremca's Posts
Nairaland Forum › Dremca's Profile › Dremca's Posts
1 2 3 4 5 6 7 8 9 10 (of 29 pages)
Good morning boss. I was about mentioning your moniker so as to help him with a better answer. It is very obvious his intentions is to "Jakpa" by asking such question. TWoods: |
In other words, you simply want to jakpa. Leleky: |
Wow. Thank you so much for this priceless information. I was even considering honda civic and toyota rav4 and with these great information, I have to switch my attention to honda crv. nurey: |
nurey:Please tell me more about security in honda electrical system because I'm considering getting a Honda civic due to good ground clearance and fuel efficiency I read online. |
nurey:Does it mean that cars are robber's magnet have more resale value when stolen and resold. Is honda civic a robber's magnet? |
Good evening all. Please how fuel and reliable are honda civic and Ford escape. |
Hello guys, if you have questions on what I have explained so far, please ask. |
Thanks for the recommendation. @TMwise1942 feel free to send me a pm. SageX1444: |
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--; |
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: |
You are very correct but it will be confusing for beginners since ES6 is used more often. akus6060: |
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. |
If you are on lagos mainland and interested in my programing class, please indicate. |
We have learnt such about string previously. We can also use a variable name if we want to use the values in that variable. For instance: let ciroma = "intelligent " const adekunle = ciroma If you notice, we didn't add double quotation marks to ciroma because we are using the variable name. Therefore, ciroma is equal intelligent and adekunle is also to intelligent. same as (const adekunle = "intelligent" ![]() Now, the next question is, how do we use the 3 data types in a variable but for now we only make use of string and numbers along side using variable reference that we just learnt now. For instance: let chukwuma = "wiper" const ciroma = "the boy is a "+ chukwuma + "age "+ 30 I know you are wondering what is happening here especially with the plus sign. We use the plus sign to join data types together when defining a variable. This use of plus sign is known as concatenation in Javascript. As you observed, the string is in double quotation marks as usual and also you will notice a spacing before the second quotation mark. The necessary else, Javascript will join every data writing as the variable as one word. However, is advised to give spacing after writing the plus sign. Example: const ciroma = "the boy is a" + chukwuma + "age" + 30 |
peterdrury:if you still in need of this, you can join my tutorial. https://www.nairaland.com/6546837/everything-javascript-frontend-backend |
Still on variable and data types. If you noticed, we have only been using one word word as example in our string data types. Example: let ciroma = "guru"; Infact, we can write a long sentence as our string. We can have something like this: let adekunle = "Adekunle is a guru who is famous in WAEC exams"; You can see we are now writing a full sentence as our string but wait a minute, what do you think will happen if we write our string with single quotation in a situation where we have apostrophe (') in our sentence, besides, we can chose to use single quotation mark in writing strings rather than double quotation mark. Take for instance: let chukwuma = 'ciroma's brilliance has earned him international recognition' In the above example, we now have 3 single quotation marks but what we intend to write is just 1 apostrophe in our string and 2 single quotation marks. What happens is that Javascript will assume the apostrophe to be the (second) closing quotation mark and every other characters that comes after the apostrophe will not be recognise by Javascript as a string. To avoid this situation, we can now make use of double quotation marks so that Javascript can differentiate the 2 types of quotation marks. For instance: let chukwuma = "ciroma's brilliance has earned him international recognition"; With the above example, Javascript can now render the whole sentence as a string. But there is another problem, what if in our sentence, we want to use double quotation marks, what happened previously with the single quotation marks and the apostrophe will still happen. For instance: const adekunle = "The president said to ciroma, "you are a genius" "; In the above example, we now have 4 double quotation marks but what we intend to write is just 2 double quotation marks in our sentence and 2 double quotation marks for opening and closing the string. What happens is that Javascript will assume that the opening quotation mark of our sentence to be the (second) closing quotation mark of the string and every other characters that comes after it will not be recognise by Javascript as a string. To avoid this situation, we can now make use of what is known as template literal (template literal is a backtic (`) sign found at the top left corner of the keyboard) so that Javascript can now know that the opening and closing double quotation marks are for the sentence and not for the string. For instance, we will now have: const adekunle = `The president said to ciroma, "you are a genius"`; |
I want to make it only on weekend for the sake of those working. hakeemhakeem: |
When writing string in Javascript, we can decide to write it with single quotation or double quotation mark but we can't combine single quotation mark and double mark together. Examples are: Writing string with double quotation mark const adekunle = "boy"; Writing string with single quotation mark let ciroma = 'guru'; But the two examples below will give you error in Javascript and are incorrect. let chukwuma = 'student"; const adekunle = "dullard'; |
The beauty of Javascript is that we can assign any data type (string, number or boolean) to our variable or constant. That's why Javascript is "dynamically typed" language. For instance: let ciroma = "dullard"; Remember that is a string, if I want to give it another value, I can change "dullard" to a number or boolean. We can then have something like this: ciroma = 45; |
Thank you. We are all doing great so long as we passing knowledge. I never knew Ciroma Chukwuma Adekunle is a dullard ![]() Karleb: |
Thank you. I'm glad you found my tutorial useful. SageX1444: |
The next questions will be, "what kind of values can we give to our variable or constant?" The value we can give to it are those data types we discussed earlier and I used one of them in explaining variable and constant earlier and that is string. We can write a statement like, Ciroma Chukwuma Adekunle is 40. That will be writen like this: const ciromaChukwumaAdekunle = 40 If you notice didn't use double quotation as we used in string. Example: const ciromaChukwumaAdekunle = "guru" only string are written with double quotation mark (" " . So numbers are just writen like numbers. Same applies to boolean which simply means if something is true or false and we write that as: const ciromaChukwumaAdekunle = true You also notice that there is no quotation mark when writing boolean values. |
Hello guys. Today, let's talk about what we call "variable" and "constant". The word may sound too complex but I will break it down. Let's take our memory back to our secondary school or universities days, Our real name when we get into school could be "Ciroma Chukwuma Adekunle." This the name or in a Javascript a value assigned to you at birth but our classmates can decide to nickname us "guru" maybe because you are good in maths. Your close male friends can nickname you "wiper" maybe because you are a chronic womaniser but at the end of the day, these names still refers to same person. But remember when registering for official documents like National Identity Number or international passport, we can never use "guru" or "wiper" as your name even though it refers to same person. Simply because, Ciroma Chukwuma Adekunle is permanent (constant) name that never changes while "guru" or "wiper" are several (variable) nicknames giving to you by different people but still refers to same person. Constant are used for storing values that will never change. For example, if I want to write in Javascript that Ciroma Chukwuma Adekunle is tall. I will simply write: const ciromaChukwumaAdekunle = "tall"; In the above example, "const" is use to tell Javascript that the value being as "tall" will never change. If you try to change the value to "short" in Javascript, you will get error. You will also notice I wrote the name as "ciromaChukwumaAdekunle" instead of "Ciroma Chukwuma Adekunle." This way of writing in Javascript is known as camel casing where you capitalise every first letter of every second words and above. The semicolon after "tall" is similar to when using full stop to end a sentence in English language, so in Javascript, we semicolon our sentence. For us to write our variable which we can change the value as we like. We can write something like, Ciroma Chukwuma Adekunle is also known as guru. We will write it this way: let ciromaChukwumaAdekunle = "guru"; We can decide to nickname Ciroma Chukwuma Adekunle to be "wiper" and Javascript will recognise it. Since we have used the word "let" to tell Javascript on the first place that the value can change. If we decide to change that value to something else, we won't write "let" anymore, rather it be: ciromaChukwumaAdekunle = "wiper"; So in the above code, Javascript will now recognise that the value is no longer "guru" but "wiper " So this is all about variable and constant in Javascript. |
Now, before we proceed, I urge to download any code editor of your choice. There are several types of code editor but I suggest you download virtual studio code. You can download it at code.virtualstudio.com |
Everything about programming is all about data. For instance when we want to use our calculate figures, we can say 6*5 equals 30. In Javascript, numbers like this is a type of data. These data types are: STRING strings is nothing but our normal English alphabet of A-Z. When writing strings we use a very simple syntax (method) which is either single Open and close quotation (' ') or double open and close quotation (" " .NUMBERS As the name implies are just numbers entered in Javascript code like 5, 7, 10 etc. BOOLEAN boolean is simply to know if something true or false. For instance, we can ask the computer if Nigeria is a country and the computer will return because Nigeria is a country but it will return false if we ask Javascript if Nigeria is food because is not. I will continue with other data types as we proceed |
Let's now talk the basic concepts of Javascript |
Let me come back to what HTML, CSS and Javascript really do now we have known what makes a Frontend of a website. Imagine, you're building a house. The very first thing you think of is the land where the house will be built. That land is known as a domain name examples are Facebook.com, Google.com etc. These are addresses that shows where the website is situated same way the land gives address to where the house is located. The next phase of the building is to get an Architect to draw the house on paper showing all the features the house should have like lighting, the kind of roofing and all that. In the web, the person responsible for this drawing is known as a User Interface designer (UI designer). After the Architect of the this website is done with his drawing, he passes it on to the Frontend developer who then designs the website according the drawings of the Architect (UI designer). This is where the Frontend developer job starts. Back to our house analogy, so after the designs has been done by the Architect, the building engineer supervises the bricklayer on how to lay the foundation of the house and subsequently lay blocks. Those block laying is the skeletal part of the building, that's where HTML comes in. HTML is used in building the structure of the house defining if the website will have a click button or how many text content it will have. Once the building is ready, the next thing is to builtify it with nice roofing, plaster it and then paint it, fence the house and mount gate. That's where the job of the CSS comes in. CSS is simply used to add beauty to the website. As a matter of fact, we have a complete building (website) but this kind of website doesn't do anything special and is known as static website because is doesn't change. A website can be built with just HTML and CSS. Imagine, the owner of the house wants a type gate that opens automatically the moment a car approaches the gate or he wants the outside light to switch on automatically once is night. That's where the idea of dynamic website comes in and we then make use of Javascript to add interactivity to our website. We can decide to program the website to open a new page after 30seconds of inactivity or another interactivity we may want. |
There is also a popular term known as framework. Imagine sewing a clothe with hand needle and sewing same clothes with sewing machine. Who do you think wilbw more efficient. Certainly, the sewing machine will do job much better that using hand needle. So frameworks are web tools that allows us to perform our task much faster and efficiently saving us precious time. There are several frameworks used on the Frontend. Examples are Angular, Vue, React and on the backend we have express, meteor etc. |
The 3 basic things that make up this FRONTEND are HTML (Hypertext Markup Language), CSS (Cascading Style Sheets) and Javascript itself. Javascript also runs on the backend using Nodejs which is most common. There are other programing that's use for backend. Examples are python, java, Ruby, ASP.Net, php etc. But our interest is Javascript. |
As I mentioned earlier, is advised to learn HTML and CSS before learning Javascript. the term FRONTEND simply means the user interface (UI) users interact with like the click button or the whole content of the website you see on the screen while BACKEND refers to part of the website where most logic are performed and returned back to the user. What connects this FRONTEND and BACKEND is known as API (Application Programing Interface). |
Javascript is the most programming language used for development. Hardly will you come across website that's not built with Javascript. If you are new to Javascript or want to learn it, I advise learning HTML and CSS first. There are several videos on YouTube for learning or you can make use of Javascript.info. In my opinion, that's one of the best place to learn Javascript. |
I created this thread for everything that has to do with Javascript, both on Frontend and Backend. Ask your Javascript related questions, drop your suggestions and tips and get help from experts. |
