DEV Community


Some Method

fateminsupria profile image Fatemin Supria ・2 min read

1.Arrow function:
Arrow function give us an alternative way to write a shortest syntax function for expression.
Example:suppose,add two number
let add =function(a,b)
return a+b;
Same thing with arrow function
let add = (a,b) => x + y;

2.Try catch:
JavaScript provides six primitive types as undefined, null, boolean, number, string, and symbol , and a reference type object
try {
//code testing process
//error handling process

An Updated version of JavaScript
Syntax--const,var,Spread operator etc.

  1. ES6 Destructuring: Destructuring that allows you to destructure an array into individual variables. Example: fuction addNumber(){ return[5,7,8]} returned value to a variable var number =addNumber(); for individual score let a =number[1], b=number[2], c=number[3];

5.Error handling:
If a problematic situation come then two things happen. Programmer code is wrong or Forget to pass a required function.Other side if the program needs a name but it gets back an empty string .In that situation need error handle.

6.Cross browser testing:
Cross browser testing as the name suggests verifying the Functionality of the website on the different common browsers that are widely used right now in the market.
Its important because:
-->To verify that what is wrong with your web application’s layout on the “Essential Browser or OS list“.
--> To provide an excellent User experience without any Browser or Device preferences.

7.Client caches:
Client caches mean its always need for client. Sometimes it is not large.Its help limit data cost for keeping commonly referenced data locally.

The initial string in a certain portion and return a new string
Example: let str ="i love bd"
let res =str.slice(0,2);
output: 'bd'

It is a method in a string that returns a new string with the value of a certain index that is included as a parameter of the method.
const x ="bangladesh"

Replace is a method that substring of a primary string which is given as a parameter of the method.
let str ="fatemin bd";
let addstr - str.replace("fatemin","bangladesh");
output: "bangladesh,bd"

Discussion (0)

Forem Open with the Forem app