Vineeth.mariserla has Published 212 Answers

How can Forgotten timers or callbacks cause memory leaks in JavaScript?

vineeth.mariserla

vineeth.mariserla

Updated on 30-Jul-2019 22:30:26

Forgotten timers/callbacksThere are two timing events in javascript namely setTimeout() and setInterval(). The former executes a function after waiting a specified number of milliseconds, whereas the latter executes a function periodically(repeats for every certain interval of time).When any object is tied to a timer callback, it will not be released ... Read More

What is the use of Atomics.store() method in JavaScript?

vineeth.mariserla

vineeth.mariserla

Updated on 30-Jul-2019 22:30:26

Atomics.store()Atomics.store() is an inbuilt method that is used to store a specific value at a specific position in an array. This method accepts an Integer typed array, index and the value as arguments.SyntaxAtomics.store(typedArray, index, value);Parameterstyped array - it the shared integer typed array that we need to modify.index - It is ... Read More

How to convert a value into Boolean in JavaScript?

vineeth.mariserla

vineeth.mariserla

Updated on 30-Jul-2019 22:30:26

There are three ways to convert a value into boolean. In those 3 methods, 2 methods include the Boolean keyword in them whereas the other method is a new method in which a symbol !! is used. Let's discuss them in detail.Using Boolean keywodExampleIn the following example, the methods which ... Read More

In how many ways can we find a substring inside a string in javascript?

vineeth.mariserla

vineeth.mariserla

Updated on 30-Jul-2019 22:30:26

We can find a substring inside a string in two ways. One way is using the indexOf() method and the other is using ES6 includes() method. let's discuss them in detail.indexOf()syntaxindexOf(str);This method tries to check the index of the substring we need. If there is index, which means substring is present, then true ... Read More

How to access an object value using variable key in JavaScript?

vineeth.mariserla

vineeth.mariserla

Updated on 30-Jul-2019 22:30:26

We know that an object value can be accessed by using a Dot notation or Bracket notation. But we can also access the value using a variable key. Let's look over them in a nutshell.Using Dot and Bracket NotationsExampleIn the following example, object value is accessed using Dot and Bracket ... Read More

Write the main difference between '==' and '===' operators in javascript?

vineeth.mariserla

vineeth.mariserla

Updated on 30-Jul-2019 22:30:26

The difference between '==' and '===' is that former checks only value but the latter checks value and also data type(String, Boolean etc).The following example gives whether values assigned are equal or not irrespective of datatype. a) "==" operator(checks equality) Example Live Demo    var x = 5;    var ... Read More

what is the main difference between '=' and '==' operators in javascript?

vineeth.mariserla

vineeth.mariserla

Updated on 30-Jul-2019 22:30:26

The use of  "=" operator is that it assigns value from right to left, whereas "==" shows whether the given values are equal or not.In the following example variables x and y were assigned values using "=" operator and their magnitudes were checked using "==" operator.Example Live Demo ... Read More

How to set dynamic property keys to an object in JavaScript?

vineeth.mariserla

vineeth.mariserla

Updated on 30-Jul-2019 22:30:26

Previously it is a two-step process to create a property in an object but the advent of ES6 has made the task very simple. In only one step we can create a property dynamically. Let's discuss it in a nutshell.Old method(2 step process)ExampleIn the following example, the property, instead of ... Read More

What is the importance of ES6's template strings in JavaScript?

vineeth.mariserla

vineeth.mariserla

Updated on 30-Jul-2019 22:30:26

ES6's template strings is a new way to combine strings. We already have methods such as join(), concat() etc to combine strings but the template strings method is the most sophisticated because it’s more readable, no backslash to escape quotes and no more messy plus operators.Using concat() and join()ExampleIn the ... Read More

What types of logical operators are in javascript?

vineeth.mariserla

vineeth.mariserla

Updated on 30-Jul-2019 22:30:26

Logical OperatorsLogic operators are used to find the logic between variables in JavaScript.There are three logical operators in JavaScript: || (OR), && (AND), ! (NOT).The AND operatorThe AND operator (&&) returns true if both expressions are true, otherwise it returns false.Example Live Demo    var a = 200; ... Read More

Advertisements