10 Important Topics of JavaScript that you can’t ignore…..

why are you still stuck into the caption ? Don’t you believe this caption? Ok…. let’s start about our 10 selected topics .

Azim Uddin Ahamed
3 min readNov 2, 2020
  1. First of all , we can start with a function which is familiar to us [toLowerCase()] . If we use this function to a variable this variable will be lower case of letters. let’s check it out .
const Case1 = 'You Are a ProGrammer'//if I use toLowerCase() function , it will make to lower case all of letters let's checkconsole.log(Case1.toLowerCase());

Output : you are a programmer

2. Secondly , we can discuss about first’s vise-versa which is familiar to all named [toUpperCase()] . If we use this function to a variable this variable will be upper case of letters. let’s check it out .

const Case1 = 'you are a programmer'//if I use toUpperCase() function , it will make to upper case all of letters let's check.console.log(Case1.toUpperCase());Output: YOU ARE A PROGRAMMER

3. Don’t give up from learning …. Now , I am talking about Math function which has many sub function . we will discuss some topics from this Math function, here one it is. [Math.floor()] .

if we use Math.Floor() function , the result of function will shows that nearest integer number . let’s see an example.

const mathFloor = 5.67;//if we use Math.Floor() function , the result of function will shows the lowest integer number .console.log(Math.floor(mathFloor));Output: 5

4.Here we are , lets think about what will be the vise-versa of of [Math.floor()]. yeah , allright . [Math.ceil()] . If we use Math.ceil() function we can get the highest value of integer .

const mathFloor = 5.67;//if we use Math.ceil() function , the result of function will shows the highest integer number .console.log(Math.ceil(mathFloor));output: 6

5. We all are familiar with javaScript array . Today I will discuss about a method of finding object from a javascript from an array named Filter . If we use filter method we can get some specific value from array. Here is an example…

const words = ['Rahim', 'Karims', 'laylabhai', 'MahabubBhai'];const result = words.filter(word => word.length > 6);console.log(result);// expected output: Array ['laylabhai', 'MahabubBhai']

6. After filter method we can approach another method to find an object from array which named find.. The find() method returns the value of the first element in the provided array that satisfies the provided testing function.

const array1 = [12,212,221,22,13];const found = array1.find(element => element > 12);console.log(found);// expected output: 212,221,22,13

7.Now, Lets talk about Map . There is a loop method in array with a function. The following code takes an array of numbers and creates a new array containing the square roots of the numbers in the first array

let numbers = [1, 4,16]let roots = numbers.map(function(num) {return Math.sqrt(num)})// expected result roots is now     [1, 2, 4]

8. There is another method of getting minimum value . The static function Math.min() returns the lowest-valued number passed into it, or NaN if any parameter isn't a number and can't be converted into one.

let numbers = [ 1,  4, 16]console.log(Math.min(...numbers));// roots is now     [1, 2, 4]

9. Math random method is a function that one can use that function to get the numbers randomly.The Math.random() function returns a floating-point, pseudo-random number in the range 0 to less than 1 (inclusive of 0, but not 1) with approximately uniform distribution over that range

let numbers = [ 1,  4, 16]console.log(Math.random(...numbers));//expected value 0.28109799366545984//0.7924519759559838

10 . We usually use slice to an array for getting some special index of array . It’s like sorting from an array.

const names = ['Rahim', 'Karim', 'Babul', 'Rahamat'];console.log(names.slice(2));// expected output: Array ['Rahim', 'Karim', 'Babul',]

Thank you for reading this . This is my first time to Medium.com .

stay connected to get more updates.

--

--