Touhidul islam
3 min readNov 3, 2020

--

Error handling, “try..catch”

An Exception is an error that occurs at the time of execution(runtime) due to an illegal operation when a program is syntactically correct. For example, whenever you try to reference an undefined variable or call a non-existent method; an exception will occur.

try {alert('Hi Everyone');
alert(x);
alert('By everyone')
} catch (err) {console.log(err);}

Multi-Line String

Template literals allow you to embed JavaScript expressions inside a string.

To create a template literal, you should use backticks (``):

`I am a template stirng`console.log('Line 1 \n' + 'Line 2');

Never use var use const instead

using let will help with any scoping issues constcauses in JavaScript.

True:

let VAT_PERCENT = 20;

False:

const VAT_PERCENT = 20;

use semicolons (;)

Using a ;really helps to keep the code consistent and a great for statement separators.

True:

const VAT_PERCENT = 20;let amount = 10
return addVat(amount, vatPercent)

False:

const vatPercent = 20;
let amount = 10;
return addVat(amount, vatPercent);

Comparing use === instead of ==

This is important due to JavaScript being a dynamic language so using == might give you unexpected results due to it allowing the type to be different.

True:

if (val == 2)

False:

if (val === 2)

Use template literals when contacting strings

True:

let fullName = firstName + " " + lastName;

False:

let fullName = `${firstName} ${lastName}`;

Inline Commenting

Practically every single programming language offers inline comments.

// begin variable listingconst  name = 1;

Descriptive Blocks Commenting

/*** @desc opens a modal window to display a message* @param string $msg - the message to be displayed* @return bool - success or failure*/function modalPopup($msg) {...}

What is Caching ?

Caching is the process of saving intermediate or calculated values in memory (RAM) temporarily. This speeds up calculation time for calculated values because the previously saved computed values will simply be pulled from the cache memory every time there is a request for the cached calculated values.

Cross Browser Testing

Cross Browser Testing can be the biggest pain for any Software Tester. But thanks to all Cross-browser Test tools available online which help in minimizing the testing efforts.

Client Caching

Client-side caching is a technique used in order to create high-performance services. It exploits the available memory in the application servers, which usually are distinct computers compared to the database nodes, in order to store some subset of the database information directly in the application side.

Normally when some data is required, the application servers will ask the database about such information, like in the following diagram:

--

--