by Halah Al-Shaikhly
Also referred to as client side.
referred to as serverside.
tables with records of data such as users, files etc. Those records are inserted/deleted/edited using languages such SQL and MongoDB.
Accessing the data and sending it back and and forth from the user interface to the tables of records using Languages such as Javascript (NodeJS), php and ruby .. etc
It was written in 10 days only ..
it is supported by most web browsers and it can be used within other environments too
It can be used at frontend and backend!
Each instruction is a statement
var a =0;
In programming, to hold values, we use variables. How do we declare variables in Javascript? We declare them using the word var.
a is the name of the variable. a is like a box containing the value 10
= is the equality operator. What is an operator? It is character that represents an action. That action can be performed on values and variables. Other operators are +,- , * ..etc
10 is just a value.
Open Repl. https://repl.it/languages/javascript_web
Open developer’s tool on your chrome/firefox browser using this command (command + shift + j or sometimes i). Or Right click anywhere on your browser’s window and click inspect and click on the console tab.
If you’re using windows PC or/and IE .. download chrome and use it to order a new MacBook.
IE: Open Tools -> Developer Tools
// variable a to store the value10
var a =10 ;
//variable b to store the value 2
var b = 2;
// var c to calculate the multiplication of a & b and store the value of it
var c = a * b;
// prints the result to your console.
// variable called year
var year = 1989;
//variable called now
var now = 2016;
//variable called age
var age = now - year;
it logs what is inside the parentheses to your console. Try it.
In that example, it takes a string (What is a string? It is immutable string of characters, must be between quotation marks like this ‘Halah’).
Does the console.log take a variable?
var a = 10;
console.log(a);
Does it take a combination of strings and variables?
To create a variable, you must give it a name. Are there any rules to naming variables in javascript?
A variable name must begin with a either letter, $ or _.
It can contain letters, numbers, $ and _.
They’re case sensitive, meaning a variable name aBC is different from one named abc.
Do not use reserved words for variable names. Reserved words you say? They’re special words reserved for javascript. Reserved for what? When you use these words, javascript understand that you’re doing something special.
Open any console and play around with these. Which one of these is not a valid variable name? Why?
var var = 10;
var 10 = 5;
var $10 = 5;
var _10 = 5;
Hint you need a variable to store the result of celsius temperature.
to convert from celsius to fahrenheit, you multiply the celsius by 9, then you divide by 5 and afterwards, you add 32.
Hint: use the multiplication, division and the addition operators.
Hint you need a variable to store the result of the conversion
// declare a variable to store some celsius value
var celsius = 0;
// convert the celsius to fahrenheit and store the result in a variable
var f = celsius * 9 / 5 + 32;
// print the result