JavaScript basic concepts that you need to know

Tania Akter
2 min readMay 5, 2021

Nowadays javaScript one of the famous static language that uses for server sites and client sites too. Here we discuss some basic concepts of javaScript.

JavaSript types:

JavaScript can divide into two categories — one is primitive other is an object. primitive types are number, strings, boolean, null, and undefined.

Number: JavaScript number is to represent integers and real numbers. Integer numbers using 64 bits floating points format. The number can be two types integer and floating number. Arithmetic operators(+, -, *, %, **) use numbers In addition to basic arithmetic operators, JavaScript supports more complex mathematical operations through a set of functions that defined as properties of the Math object. Some most used math object given below:

Math.round(1.5) // output will be 2: round to the nearest integer.

Math.ceil(1.3) // output will be 2: round up to an integer.

Math.floor(1.9)// output 1: round down to an integer.

Math.abs(-5)// output 5: negative will turn into positive.

Math.random() // random number will be generated.

Math.max(4,8,2) //output 8: find the largest number.

Math.min(4,3,6) // output 3: find the smallest number.

String: String is a sequence of characters. Some common methods that use in the string that are,

str.slice()

str.split()

str.toUpperCase()

str.toLowerCase()

str.trim()

str.charAr()

null: null is a language keyword that evaluates a special value that is usually used to indicate the absence of a value.

undefined: undefined is refer to that variable is declared but the value is not defined or initialize

Variable declaration: In javaScript has three types of variable declaration that are let, const, and var.

let is a block type keyword. If let is declare then that variable can not use outside of the block.

const declare variable can not allow changing its variable.

If var is declared before a variable that can change and use all over the code.

--

--