Please describe the most important advantages of using JavaScript?

Posted by Jessica Taylor | Updated on | JavaScript


There are several advantages to using JavaScript. Most notable amongst them are listed down as follows: Enhanced interactivity – JavaScript allows creating interfaces that react when the user activates them via the keyboard or merely hovers …

Javascript Number object

Posted by Prem Tiwari | Updated on | JavaScript


The built-in Number object has properties for numerical constants, such as maximum value, not-a-number, and infinity. You cannot change the values of these properties and you use them as follows: You always refer to a …

How to define a function in JavaScript?

Posted by Pinki | Updated on | HTML JavaScript


In this example you will learn, how to define a function in JavaScript. Let’s take a look at the following example to understand how to define a function in JS.

How to Sleep Before Continuing in JavaScript?

Posted by Pinki | Updated on | JavaScript


In this example you will learn, how to Sleep Before Continuing in JavaScript. You can simply use the setTimeout() method to sleep or wait before continuing to run the code in JavaScript. The time to …

How to Convert UTC Date Time to Local Date Time in JavaScript?

Posted by Prem Tiwari | Updated on | JavaScript


In this example you will learn, how to Convert UTC Date Time to Local Date Time in JavaScript. You can simply use the toString() method to convert UTC or GMT date time to local date …

JavaScript Number.prototype.toString() example

Posted by Editorial Staff | Updated on | JavaScript


JavaScript Number.prototype.toString() example. The Number object overrides the toString() method of the Object object. (It does not inherit Object.prototype.toString()). For Number objects, the toString() method returns a string representation of the object in the specified …

JavaScript Number.prototype.toExponential() example

Posted by Editorial Staff | Updated on | JavaScript


JavaScript Number.prototype.toExponential() example. If you use the toExponential() method for a numeric literal and the numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot that precedes the method call to …

How to get a subset of a javascript object’s properties?

Posted by Editorial Staff | Updated on | JavaScript


Want to get a subset of a javascript object’s properties? Use the below example to get a subset of a javascript object’s properties. And you only want the name and age, you can create the …

What is the replacement of lodash pluck() method?

Posted by Jennifer | Updated on | JavaScript


In this example, I have shared what is the replacement of lodash pluck() method? As a replacement, you can use the map function in the following way:

How to deserialize a JSON into Javascript object?

Posted by Editorial Staff | Updated on | JavaScript


Want to deserialize a JSON into Javascript object? JSON is literally Javascript Object notation. JS has built in support using the JSON object to parse JSON strings into JS objects. Here is an example: The …

Best practice for using window.onload

Posted by Jennifer | Updated on | JavaScript


In this example, I have shared the best practice for using window.onload. I’d say the better/newer way of doing this would be to use a framework, or to just to use a simple implementation of …

How to switch a div content that has php values?

Posted by Andre Scott | Updated on | JavaScript PHP


Want to switch a div content that has php values? Use the below jQuery code to switch a div content that has php values. Here is the live demo: http://jsfiddle.net/L0j5x8ow/3/

How to test a Jest console.log?

Posted by Editorial Staff | Updated on | JavaScript


Want to test a Jest console.log? If you want to check that console.log received the right parameter (the one that you passed in) you should check mock of your jest.fn(). You also have to invoke …

How to navigate via clickHandlers in Javascript?

Posted by Rohit Kumar | Updated on | JavaScript


Want to navigate via clickHandlers? I’m gonna make the assumption that you’re not building a single page app and using something along the lines of React router. And that what you need to do is …

How to convert JavaScript String to be all lower case?

Posted by Jessica Taylor | Updated on | JavaScript


Want to convert JavaScript String to be all lower case? Use just an examples for toLowerCase(), toUpperCase() and prototype for not yet available toTitleCase() or toPropperCase():