Javascript Tips

Maruf Hossain
3 min readNov 2, 2020

--

Array.isArray()

Javascript Array.isArray() is a method to know the file is array or not. Ok so let’s see how we can understand that its an Array.

So in the photo you can clearly see, how to check that, its Array or not.

How to create a Object in Javascript

If you want to create an Object in Javacript, Just follow my Instruction.

This is how you can create a Object in Javascript.

Number.inFinite()

Javascript Number.isFinite() is a method to determine that provided value is Finite or not. Let’s watch quick example to understand.

So, this is how you can understand the provided value is Finite or not.

charAt()

Javascript charAt() method is used for getting the specified character of a string. Ok let’s check the quick Example.

So this is how you can get a character form a string.

replace()

Javascript replace() method is used for replace a new word with an existing word. Let’s see a Example , so we can understand it better.

In the photo you can see I replace ‘Maruf’ with ‘Mamun’ in a sentence.

‘&& and ||’ Operator in Javascript

Javascript && Operator is used for checking the all dependencies is right. And the || Operator is used for checking if any of the dependencies is right. Let’s see an Example to clear it.

In the first example job got false so the dependencies was gone for ‘I am not ready’. And in the second dependencies money got correct, so it passed and say ‘I am ready’. Hope you understand.

Math.max() and Math.min()

Math.max() method in Javascript is used for getting the biggest value of an element. And Math.min() method is used for getting the lowest value of an element.

Math.ceil() and Math.round() and Math.floor()

In Javascript Math.ceil() method is used for changing a dot(.) value into the higher number. And Math.round() method is used for changing the dot(.) value into an number but it change like that 2.4 = 2 and 2.6 = 3. And Math.floor() method is used for changing a dot(.) value into lowest number. Let’s watch an Example to understand clearly.

Math.random()

In Javascript Math.random() method is used for getting a random. Watch an Example to know how to do that.

filter() and find()

In Javascript filter() method is used for getting all the number match with its dependencies. And find() method is used for getting the first number match with its dependencies. Let’s check an Example.

--

--

Maruf Hossain

I am a Frontend Web Developer. My goal is to work for a Company to contribute for the growth of the company while having the scope to develop my own skills.