Latest Javascript Tutorials and How-To's

javascript

How to Read a Local File Using Javascript in Browser (.txt .json etc)

To read a file we can use the Javascript FileReader object that gets the content of the file. File name, size & type can be found through the properties of the selected File object.
July 11, 2019
javascript

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.
July 9, 2019
javascript

Extracting a Part of an Array in JavaScript

A part of an array can be extracted with the Array.slice() method.
July 7, 2019
javascript

Getting Browser Window Size with JavaScript

Javascript window.innerWidth and window.innerHeight properties gives the dimensions of the viewport window. window.outerWidth and window.outerHeight gives the dimensions of the full browser window that includes the location bar, menu etc.
July 5, 2019
javascript

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.
July 3, 2019
javascript

Union of Arrays in JavaScript

Union of arrays would represent a new array combining all elements of the input arrays, without repetition of elements.
July 1, 2019
javascript

Represent 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.
June 27, 2019
javascript

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.
June 26, 2019
javascript

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.
June 25, 2019
javascript

Reversing an Array with Javascript

The reverse() method can be used to reverse the order of elements in an array.
June 21, 2019
javascript

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.
June 20, 2019
javascript

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.
June 14, 2019
javascript

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.
June 13, 2019
javascript

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.
June 10, 2019
html

How to Create a HTML Slider / Carousal

This tutorial shows how to create a slider / carousal from scratch using HTML, CSS & Javascript. Using a custom self-made slider can prevent inclusion of external plugins in your application.
June 4, 2019
videos

WebAssembly for Web Developers (Google I/O 2019)

Web development is entering to a totally new phase with WebAssembly coming in. With WebAssembly it is possible to run desktop like applications inside a browser.
May 28, 2019
css

Using Data-Attributes (data-*) in CSS

A special thing about HTML data-attributes is that its values can be directly rendered through CSS also. Whenever value of data-attribute changes, new value can be rendered in the page automatically.
May 26, 2019
javascript

Reading & Writing Data-Attributes (data-*) in Javascript with dataset

Custom data attributes (data-*) can be used to store extra information for an HTML element. In Javascript the dataset property of the element can be used to read and write its data attributes.
May 25, 2019
javascript

Getting Network Information with Javascript

The Network Information API gives an idea of the underlying network. Getting the network type may help the application in giving a suitable experience to the end user.
May 25, 2019
javascript

Detecting CapsLock State (On/Off) with Javascript

In login forms, it is better to inform the user that his CapsLock is currently locked. State of the CapsLock key can be detected with the get​Modifier​State method in keyboard/mouse events.
May 18, 2019