Introduction of JavaScript

JavaScript is most powerful browser based scripting language. Now days it is used an incredible number of high-profile applications.

JavaScript was created in 1995 by Brendan Eich. JavaScript is a dynamic language for its types and operators structure .

Number

String

Boolean

Function

Object (Function, Array, Date RegExp)

Symbol (new in ES2015)

Number

parseInt() = Convert a string to an integer

parseFloat() = gives floating number (Ignore everything if contain any sign (+, -, .)

NaN = Not a Number

isNaN(‘hello’); // true

isNaN(‘1’); // false

String

‘tree’. length (it shows 4)

Other Types

false, 0, empty strings (“”), NaN, null, and undefined all become = false.

Except these all become = true.

Variables

let x ;

let name = ‘person name’ (for change variable use ‘let’)

const Pi = 3.14 (for fixed vabiable we use ‘const’)

var x ;

var name = ‘person name’ (it does not have any restriction, how will we use whether it is fixed or changeable)

Operators

Comparison Operators

Control structures

if else operator

if (name === ‘hen’) {

name += ‘ kut-kut’;

} else if (name === ‘man’) {

name += ‘ owa-owa’;

} else {

name += ‘!’;

}

console.log(name);

// man owa owa

if anyone call the variable ‘man’ it answer ‘owa owa’

if anyone call the variable ‘hen’ it answer ‘kut kut’

if anyone call the nothing ‘’ it answer ‘!’

for Loop structure

for (var i = 0; i < 10; i++) {// Loop Will execute 10 times and last value will be 9
}
for (var i = 0; i <= 10; i++) {// Loop Will execute 10 times and last value will be 10}

do while loop

var i = 0;

do {

text += i + “,”;

i++;

}

while (i < 5);

console.log(text);

//0,1,2,3,4,

Hello, I am Mehadi Hasan, Frontend React web Developer. From my little knowledge about JavaScript I am trying to publish somethings.