Basic JavaScript

What is JavaScript ?

JavaScript is high-level programming language often used to implement dynamic features on web pages.

Why to learn JavaScript ?

What to use JavaScript for ?

  • Web (frontend , backend)
  • Mobile Application
  • Application

Applications that use JavaScript

  • Facebook
  • Instagram
  • Netflix
  • Uber
  • Microsoft Team
  • etc.

Variables

Variables are used to store data values in computer memory. They can be referred by using their names.

Variables for JavaScript

  • var (not recommended to use)
  • let
  • const

How to use

{% hint style="danger" %} Name for variable can't start with number and can't use special character. {% endhint %}

// myName and MyAge is name for variable 
let myName = 'Alice'
// const can't edit value in variable
const myAge = 20

console.log(myName)
console.log(myAge)

myName = 'Bolb'
myAge = 18

//Result
Alice
20
Blob
Error