AmitDiwan has Published 10744 Articles

Continuing a loop in functional programming JavaScript.

AmitDiwan

AmitDiwan

Updated on 17-Jul-2020 07:34:13

127 Views

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

Explain import “as” and Export “as” constructs in JavaScript.

AmitDiwan

AmitDiwan

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

207 Views

Import as allows us to import a named module under different name.Export as allows us to export a named module under different name.Following is the code for import as and export as construct in Javascript −Example Live Demo Document    body {       font-family: ... Read More

How to get all unique values in a JavaScript array?

AmitDiwan

AmitDiwan

Updated on 17-Jul-2020 07:31:41

434 Views

Following is the code for getting all unique values in a JavaScript array −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .result,    .sample {       font-size: 18px;       font-weight: ... Read More

Passing empty parameter to a method in JavaScript

AmitDiwan

AmitDiwan

Updated on 17-Jul-2020 07:28:12

1K+ Views

Following is the code passing empty parameter to a method 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

What are Partial functions in JavaScript?

AmitDiwan

AmitDiwan

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

3K+ Views

Partial functions allow takes a function as an argument and along with it takes arguments of other types too. It then uses some of the arguments passed and returns a function that will take the remaining arguments. The function returned when invoked will call the parent function with the original ... Read More

object.is() in equality comparison JavaScript

AmitDiwan

AmitDiwan

Updated on 17-Jul-2020 07:25:56

115 Views

The object.is() method introduced in ES6 as a way to compare two values. These two values can either be primitives or objects. It does a little better comparison than == and ===.Following is the code for object.is() in equality comparison −Example Live Demo Document    body ... Read More

How to borrow methods in JavaScript?

AmitDiwan

AmitDiwan

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

147 Views

The call(), apply() and bind() are used to borrow methods in JavaScript.Following is the code for borrowing methods in JavaScript −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .result, .sample {       ... Read More

Event bubbling vs event capturing in JavaScript?

AmitDiwan

AmitDiwan

Updated on 17-Jul-2020 07:23:13

974 Views

Event Bubbling − Whenever an event happens on an element, the event handlers will first run on it and then on its parent and finally all the way up to its other ancestors.Event Capturing − It is the reverse of the event bubbling and here the event starts from the ... Read More

Undefined in JavaScript

AmitDiwan

AmitDiwan

Updated on 17-Jul-2020 07:19:59

294 Views

The JavaScript undefined property specifies if a variable has been declared or assigned a value yet.Following is the code implementing the JavaScript undefined property −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .sample { ... Read More

Template strings in JavaScript.

AmitDiwan

AmitDiwan

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

531 Views

Template were introduced in ES6 to allow embed expressions inside a string. Instead of ‘’ or “” quotation marks they use the backticks (``). They offer a much better way of string interpolation and expressions can be embedded in a way like ${a+b}. It offers a much nicer syntax than ... Read More

Advertisements