Razwan Hossain
5 min readNov 5, 2020

1 . Values of truth or false in javascript

Two types of elements can be included in an array. The first one is a string and the second one is the number. The value of any positive and negative number except 0 by default is true in javascript. As same to any kind of string even a space condition value is true except blank string. If the variable was not defined or was defined null, NaN then by default condition value will be false in javascript.

2 . Double or triple equal

Double equal means equal value but not equal type. On the other hand triple equal means equal value and equal type. Everyone prefer triple equal form double qual because there is a by default function in javascript. When a variable is 1 and the other variable is true, the double equal executes condition is true just because it does not check the equal type. On the other hand triple equal check qual value and qual type, that's why it returns the condition is false. As same as the first variable is 0 and the second variable is false, Double and triple equal execute the same answers. For better understanding, please check the image below….

3 . Javascript map, filter, find on an array of objects

Suppose we have an array containing multiple objects, each one represents a person's name and id. After using the map property of the object, this map property collect name or id according to the javascript developer. After a collect name or id property, this map pushes the elements to an array and the final output is we got an array from the object. The property of a filter is to bring out a specific element from all the other elements and the find on property work to find an element in an array.

4 . Javascript scope, block scope

If an algorithm is called inside a function, then it will have scope or boundary inside it. It cannot be called from outside. But if a variable called outside a function, it can be called in it. That will be called the global scope. Var is a global variable. Programmers are highly recommended that always should use let or const. This does not create any confusion in the output of the function.

5 . Find the largest element of an array

Suppose we have an array with a bunch of numbers. We find the largest number from an array. There is a variable that is called by var and the initial value is 0. We use for loop which is renowned by count controlled loop and use if loop to find the max value…

6 . Sum of all numbers in an array

For a total of all the numbers, we should declare a variable and initial value. In that case, also we should use for loop because we know that for loop is a count controlled loop. For loop will count all the elements from the beginning to the end of the array and will give output at the end of the count.

7 . Remove duplicate element from an array

Suppose we have an array with duplicate numbers. We need to remove duplicate items from the array. In that case as usual we need a for loop which is used for the count, an indexOf property that sees if there are any duplicate elements in it. When it see that there is no element in that array, it will push the element in it.

8 . Reverse a string in javascript

For string to reverse, we use a function where is included for loop and an empty string. After the function written for this problem solving, we need a string to reverse. That's why call the function and inside the arrow, we should call the element of string to reverse.

9 . Calculate Factorial of a number using for loop

Factorial is the product of all positive integers less than or equal to a given positive integer and denoted by that integer and an exclamation point. Thus, factorial seven is written 10!, meaning 1 × 2 × 3 × 4 × 5 × 6 × 7×8 × 9× 10. Factorial zero is defined as equal to 1. We use for loop to calculate a number of factorial. For better understanding, please check the image below..

10 . Create a Fibonacci series in a recursive way

Fibonacci is a well-known math in mathematics. Also, it is one of the most popular problem-solving in javascript. For solving this problem, we have to use the function,if-else condition to make it happen by javascript. For better understanding, please check the image below….

Razwan Hossain
Razwan Hossain

Written by Razwan Hossain

0 Followers

Life is always happening for us , not to us.

No responses yet