Introduction To Javascript
Introduction To Javascript
Beginners’ guide
What is Javascript?
Javascript is ubiquitous and versatile. Our focus for this lesson will be to understand
javascript basics and be able to read and write simple syntax.
The Syntax
Code is all about syntax (and semantics). The syntax for javascript that runs on any
machine is the same!
This difference lies in the APIs (Application Programming Interface) that is available on
each environment. More on that later.
First, let’s look at general Javascript syntax.
The Syntax (cond.)
Variables
Javascript like any other language has things known as variables. A variable is
something that holds a value in memory.
The examples below show two variables. first_name, last_name
If (first_name == 'Maryann') {
console.log("Happy to see you!")
} else {
console.log("Welcome !")
}
More code samples
More code samples
What is Node.js?
It is written in C++.
Other backend languages like PHP that run synchronously. Which means it waits for one
process to end before running another.
With Node.js processes run asynchronously, which means one process does not need to
complete before another starts to run. This uses a background system known as the event
loop.
Popular Startups That Use Node.js
- Netflix
- Uber
- Linkedin
- Mozilla
- Ebay
How To Install Node.js
Steps
- Visithttps://nodejs.org
- The website automatically detects your operating system and provides you with
down options. “LTS” or “Current”. You can download the “LTS”. Both are fine
though.
- Run the installer package on your computer to install node.
What the Node website looks like
Verifying your installation
To verify your installation is good run the command below in your terminal and you should see the expected
response with the version of your installation.
Brief About What a Terminal is
A terminal is an environment on your computer where you directly run commands for
the computer to do things you can or cannot achieve by using the normal user interface.
On windows, the default terminal is the “command prompt”, you can also use the
windows “powershell”.