Creating Objects with Dynamic Keys in Javascript (ES6 Way)
ES6 has brought in Computed property names that helps in creating a new object with dynamic property names. The dynamic keys are specified between [ ] square brackets.
Javascript Rest Parameter
Rest parameter syntax can be used in function declarations to compress passed arguments to an array. By using the Rest parameter syntax indefinite number of arguments can be passed to a function.
Javascript Spread Operator
Spread operator will expand an iteratable, such as an array or a string. Expansion here means that the input object is broken down to its individual values.
How to Read Local Files with Javascript
There are some cases where a web application needs to read a local file from the user's system. This can be done with the FileReader interface.
Merging of Arrays in JavaScript
The concat() method can be used to merge two or more arrays. Duplicates in the merged array can be removed using a Set object.
Extracting a Part of an Array in JavaScript
A part of an array can be extracted with the Array.slice() method.
Getting Browser Window Size with JavaScript
JavaScript has built-in methods which returns the browser window dimensions. We can also listen to an event to track resizing of the browser window.
Intersection and Difference of Arrays in JavaScript
The filter() method can be used to get intersection or difference of arrays. Duplicates can be eliminated by converting array to a Set object.
Union of Arrays in JavaScript
Union of arrays would represent a new array combining all elements of the input arrays, without repetition of elements.
Getting Date and Time in Node.js
In Node.js date and time are handled with the Javascript Date object. It is loaded by default and requires no import of modules.
Representing Very Large Numbers in Javascript with BigInt
BigInt is a new data type introduced in Javascript that can handle extremely large numbers. Such large numbers are typically created in financial sectors or in creating high-accuracy timestamps.
Vibrating Mobile Devices with Javascript
The Vibration API makes it possible for a web application to vibrate a mobile device with Javascript. Single or multiple vibrations can be performed with this.
Removing Elements from an Array with Javascript
The shift(), pop() and splice() methods can be used to delete elements from any position in the array.
Reversing an Array with Javascript
The reverse() method can be used to reverse the order of elements in an array.
Adding Elements to an Array with Javascript
The push() / unshift() methods can add elements to end / front of an array. The splice() method can be used to add elements at any position in the array.
jQuery position() in Pure Javascript
jQuery position() method gives the top-left position of the element relative to its offset parent element. Its equivalent in native Javascript can be found using the offsetTop and offsetLeft properties.
How to Get User Location Information with Javascript
The Geolocation API makes it possible to retrieve the current geographical location of the user. Latitide, longitude, altitude and many other location information can be fetched.
jQuery offset() in Pure Javascript
jQuery offset() method gives the top-left position of the element relative to the whole document. In Javascript there is no native method that directly gives this value, we need to calculate it.
Creating and Starting a Web Server in Node.js
The built-in http / https modules can be used to create a HTTP / HTTPS server in Node.
CSS Variables (VIDEO)
CSS variables makes many UI problems easy, which were not straightforward before. This video will show you many interesting details about CSS variables.