Vineeth.mariserla has Published 140 Articles

How can Detached DOM elements cause memory leak in JavaScript?

vineeth.mariserla

vineeth.mariserla

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

Detached Dom elementsDetached DOM elements are the elements which have been removed from the DOM but their memory is still retained because of JavaScript. This means that as long the element have a reference to any variable or an object anywhere, it does not garbage collected even after destroyed from ... Read More

What is the use of ()(parenthesis) brackets in accessing a function in JavaScript?

vineeth.mariserla

vineeth.mariserla

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

The ()(parenthesis) brackets play an important role in accessing a function. Accessing a function without () will return the function definition instead of the function result. If the function is accessed with () then the result can be obtained.Without ()ExampleIn the following example, the function is accessed without () so ... Read More

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

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

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

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

Explain about logical not(!) operator in detail with example in javascript?

vineeth.mariserla

vineeth.mariserla

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

NOT operatorThe logical NOT operator gives true for false values and false for true values. Live DemoExample var x = 200; var y = 300; document.getElementById("logical").innerHTML = !(x < y) + "" + !(x > y); Outputfalse true

Previous 1 ... 5 6 7 8 9 ... 14 Next
Advertisements