Javascript Training

This repository is created in order to get yourself better at javascript.

What is Javascript

  • Javascript is a popular and widely used programming language that adds interactivity to your website
  • Every browser has an engine that could run javascript code, example v8 in chrome.
  • It is single threaded, synchronous language which could be used to develop both frontend and backend.
  • It is already running in your browser on your computer or mobile.
  • It is used to create web, mobile and desktop application.

Basics of Javascript syntax

Variable definition

number, let x = 2;
String, let x = "Hello World!";
Array, let x = [1,2,3,4,5];
Object, let car = {type:"Fiat", model:"500", color:"white"};
Date, let datePResent = new Date();

If variable is declared but not assigned any value then it is value is equals to "undefined"

Function Declaration & Definition

function addNumbers(x,y)
{ return (x+y);
}
addNumber(2,3);

Conditional Statement

if(x > 0 ) {
return "Number is Positive";
}
else{
return "Number is Negative";
}

Loops

for(let i =1 ; i <= 10; i++){
console.log(i);
}

Array Methods in js


Various array methods are present in javascript to make the life of programmer bit easier and reduces lines of codes and make its visibility better.

forEach

map

some

includes

every

To know more about array methods, Click Here