JavaScript

·

2 min read

Table of contents

No heading

No headings in the article.

Javascript is the world's most popular programming language. It is light weighted, easy to learn, compiled programming language. It is used in web development.

History of JavaScript-

Before 1995, web pages were made using HTML and CSS only. In 1995, a language developed by Netscape named "Mocha" that gives capacity to the web browser, but there were a problem in this langauge that was that it only works in Netscape web browser. So to get out from this trouble all the developers, go to EcmaScript, then EcmaScript made some rules and regulations of this language, after that their name were changed from "Mocha" to "Live Script". After some time, it saw that "LiveScript" is not going to be famous at all, So, scientist changed their name from "LiveScript" to "JavaScript", then you think that Why Java-Script? Because at that Java programming langauge is the most popular at that time.

Values and Datatypes in JavaScript:

  • String ("Hello")

  • Number (1, 2, ...)

  • Array [1, 2, "hello", false]

  • Boolean value (true/False)

  • Undefined (undefined)

  • Null (null)

  • Object

console.log() is used to print any number, string, boolean value etc.

Variables in JavaScript:

  • Invalid variables are:

    let 1name = "sam";

    consol.log(1name);

  • Valid variables are:

    let name1 = "sam";

    console.log(1name);

Keywords in javascript:

cons, var and let are the basic keywords to declare variables in javacsript.

Eg. cons name = "hashnode";

let number = 78;

var string = "hello";

cons stands for constant, the value of cons can not be change. the value value of let and var can be change. Nowadays var is least popular keyword in javascript, let is the most popular keyword.