What is Javascript ?
JavaScript is a dynamic computer programming language. It is lightweight and most commonly used as a part of web pages, whose implementations allow client-side script to interact with the user and make dynamic pages.
in one word : java script is just in time compile programming language.
Why is it called JavaScript?
When JavaScript was created, it initially had another name: “LiveScript”. But Java was very popular at that time, so it was decided that positioning a new language as a “younger brother” of Java would help. But as it evolved, JavaScript became a fully independent language with its own specification called ECMAScript, and now it has no relation to Java at all.
Note : javascript is made by Brendon Eich in 1995 in that time javascript is called mocha before
Javascript Syntax
console.log : it is the function in javascript which used to print any kind of variables defined
before in it or to just print any message that needs to be displayed to the user.
double slash (//) : double slash is use for single line comment
variable declere keyword
1. var )----------~ this keyword is the redeclere and changable their value is undefine
ex :- var x = 5; var y = 5;
2. let )----------~ this keyword is undeclare but this the updatable and their value is define
ex :- let x = 5;
3. const )----------~ this keyword undeclere and unupdatble
ex :- const price = 10
Arithmetic operator
let x-5;
let y-9;
Datatypes in javascript
1. primative values
2. object
#Primative values
primative value are the those immutable data which is at the lowest level of this language
there are 7 primative datatypes
1. string
2. number
3. bigint
4. boolean
5. null
6. undefined
7. symbol
if else condition in javascript
here is code for if else explanation
//if else condition
let status = "roshay";
if (status === "roshay") {
message = "he is the programmer"
}else {
message = "welcome to our blog"
}
Comments
Post a Comment