AmitDiwan has Published 10744 Articles

Formatted Strings Using Template Strings in JavaScript

AmitDiwan

AmitDiwan

Updated on 18-Jul-2020 07:41:47

283 Views

Following is the code for formatted strings using template strings in Javascript −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .result,    .sample {       font-size: 20px;       font-weight: 500; ... Read More

Effective Function Signatures with Default and Rest Parameters in JavaScript

AmitDiwan

AmitDiwan

Updated on 18-Jul-2020 07:37:05

117 Views

Following is the code for to implement function Signatures with Default and Rest Parameters in JavaScript −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .result {       font-size: 20px;       ... Read More

Explain "for...in" statement in JavaScript?

AmitDiwan

AmitDiwan

Updated on 18-Jul-2020 07:36:57

143 Views

The for…in loop loops through all of the object properties. Following is the code o implement the for..in statement in JavaScript −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .sample, .result {     ... Read More

Lambdas with Arrow Functions in JavaScriptLambdas with Arrow Functions in JavaScript

AmitDiwan

AmitDiwan

Updated on 18-Jul-2020 07:34:26

1K+ Views

Lambda function is a small anonymous function that consist of only one expression and can take one or multiple parameters. They basically allow functions to be passed as parameter to other functions. Since in JavaScript, functions are treated as object so they can be passed and returned from other functions ... Read More

How to read data from JSON array using JavaScript?

AmitDiwan

AmitDiwan

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

4K+ Views

Following is the code to read data from JSON array using 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

JavaScript to parse and show current time stamp of an HTML audio player.

AmitDiwan

AmitDiwan

Updated on 18-Jul-2020 07:31:39

1K+ Views

Following is the code to to parse and show current time stamp of an HTML audio player −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .result {       font-size: 20px;     ... Read More

Explain JavaScript eval() function what are the rules to be followed while using it.

AmitDiwan

AmitDiwan

Updated on 18-Jul-2020 07:28:58

134 Views

The eval() function is used to evaluate the given string and execute it as JavaScript code. Using eval() is highly dangerous as someone can pass malicious code as input string to one of out inputs.Following is the code to show eval() function in JavaScript −Example Live Demo ... Read More

What's the best way to open new browser window using JavaScript?

AmitDiwan

AmitDiwan

Updated on 18-Jul-2020 07:28:53

253 Views

The open() method of window object is the best way to open new browser window using JavaScriptFollowing is the code for opening new browser window using JavaScript −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    } ... Read More

Can I verify if a JavaScript variable is loaded if so, how?

AmitDiwan

AmitDiwan

Updated on 18-Jul-2020 07:26:35

2K+ Views

To verify if a JavaScript variable has been loaded or not, we can check if it is undefined or has a null value by doing comparison for both the values. We can also use typeof() since it returns string always to know if variable has been loaded or not.Following is ... Read More

How to pass arguments to anonymous functions in JavaScript?

AmitDiwan

AmitDiwan

Updated on 18-Jul-2020 07:19:39

1K+ Views

Following is the code for passing arguments to anonymous functions in JavaScript −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .result {       font-weight: 500;       font-size: 20px;     ... Read More

Advertisements