!! Operator - Boolean can be converted using !! Operator (double negation operator). To confirm the true value of a variable, one needs to check if it’s a valid value. Double negation operator can be used for this validation. It converts all types of data into Boolean value.
+ Operator - This operator can be used to convert the data into numeric form. It is quite simple but only works with string numbers else NaN (Not a Number) will occur.
|| Operator – ES6 contains an argument that is default. || Operator (OR operator) is used to simulate this feature in the old browsers.
Loop based array.length caching – It is very important when it comes to processing large arrays while in loop. This code counts the array size in iteration that causes delay. Use of array.length makes the code simpler.
Object property – this method is used when the programmer is planning to write a code that is cross browser. However document.querySelector () is not a part of certain browsers, therefore object property is used.
Replace all – String.replace () function uses Regex to substitute strings. This function only substituted the first string. In order to substitute all the elements, use replace.All() at the end of regex.
Merging array – Array.concat() is used to merge two arrays but it consumes memory and is not quite suitable for large arrays. Array.push.apply (arr1, arr2) can be used for merging large arrays without occupying much memory.