AmitDiwan has Published 10744 Articles

How to convert an Image to blob using JavaScript?

AmitDiwan

AmitDiwan

Updated on 17-Jul-2020 07:57:11

15K+ Views

Following is the code to convert an image to blob using JavaScript −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .result {       font-size: 18px;       font-weight: 500;     ... Read More

How to access JavaScript properties?

AmitDiwan

AmitDiwan

Updated on 17-Jul-2020 07:54:32

273 Views

There are three ways to access JavaScript properties −Using dot property access: object.propertyUsing square brackets notation: object[‘property’]Using object destructuring: let {property} = objectFollowing is the code for accessing JavaScript object properties −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, ... Read More

TextDecoder and TextEncoder in Javascript?

AmitDiwan

AmitDiwan

Updated on 17-Jul-2020 07:52:24

588 Views

TextEncoder is used to convert a given string to utf-8 standard. It retunes an Uint8Array from the string.TextDecoder is used to covert a stream of bytes into a stream of code points. It can decode UTF-8 , ISO-8859-2, KOI8-R, GBK etc.Following is the code for TextDecoder and TextEncoder in JavaScript ... Read More

Calculating average of an array in JavaScript

AmitDiwan

AmitDiwan

Updated on 17-Jul-2020 07:50:06

542 Views

Following is the code for calculating average of an array in JavaScript −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .result,    .sample {       font-size: 18px;       font-weight: 500; ... Read More

Can we re-throw errors in JavaScript? Explain.

AmitDiwan

AmitDiwan

Updated on 17-Jul-2020 07:48:06

218 Views

Exception can be rethrown after they have been caught by using the throw after catching the exception.Following is the code to re-throw errors in JavaScript −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .result ... Read More

Destructuring and function parameters in JavaScript

AmitDiwan

AmitDiwan

Updated on 17-Jul-2020 07:47:22

200 Views

Following is the code to destructure function parameters in JavaScript −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .sample,    .result {       font-size: 18px;       font-weight: 500;     ... Read More

How to check if a document is ready in JavaScript?

AmitDiwan

AmitDiwan

Updated on 17-Jul-2020 07:45:07

722 Views

Following is the code to check if a document is ready in JavaScript −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .result {       font-size: 18px;       font-weight: 500;   ... Read More

The generator.throw() method in JavaScript.

AmitDiwan

AmitDiwan

Updated on 17-Jul-2020 07:42:47

176 Views

The generator.throw() method is used to pass an error to the yield. The generator resumes the execution after throw has been called by throwing an error and returning object with properties done and value.Following is the code for generator.throw() in JavaScript −Example Live Demo Document   ... Read More

How to reduce arrays in JavaScript?

AmitDiwan

AmitDiwan

Updated on 17-Jul-2020 07:40:50

148 Views

Following is the code to reduce arrays in JavaScript −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .result,    .sample {       font-size: 18px;       font-weight: 500;       ... Read More

Breaking a loop in functional programming JavaScript.

AmitDiwan

AmitDiwan

Updated on 17-Jul-2020 07:35:27

156 Views

Following is the code for breaking a loop in functional programming −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .result {       font-size: 18px;       font-weight: 500;       ... Read More

Advertisements