Find the difference between Dates in JavaScript

Learn how to find difference between two dates in JavaScript. Image from Lukas Blazek We learn about finding Number of Seconds , Number of Minutes , Number of hours , Number of days , Number of weeks , Number of months , Number of years between two dates. Let’s create two dates let d1 = Date.now(); let d2 = new Date(2019,5,22).getTime(); //Jun …

A short introduction to CSS variables

Using CSS variables we can set a value to a property and reuse it in our CSS code. This can be thought of almost exactly how we use variables in JavaScript. When do we need CSS variables? When we are working on a project, and we need to use the same value (text color, background, …

Create beautiful boxes using the outline CSS property

outline is a line outside the border of a container. Let’s create a simple rectangle and apply an outline and see how cool 😎 it is. The syntx for ourline is outline: size type color; The above code will create a beautiful frame 🖼 . The available values are outline: auto → Permits the user agent …

Enabling full screen in Javascript.

Learn how to enable full screen using Javascript. We can use requestFullscreen() method on any element to make the element as full screen. requestFullscreen() method makes an asynchronous request to make the element be displayed in full-screen mode. We can check if any other element is already in fullscreen mode by using document.fullscreenElement . To exit …

Creating a simple loader only using CSS

Loader are the impressing part of the website , which needs to be simple and fun , So we will build an elegant loader . This loader is inspired from here. Create a container which is going to hold the loader <html> <body> <div class=”container”> </div> </body> </html> Set the width and height of the body to 100% , …

Difference between String primitives and String object.

Learn about, in what way the string primitive and string objects are different in javascript. We can create string in three ways, 1. var a = “first way”; // we can also use single quotes 2. var b = String(“second way”); 3. var c = new String(“third way”); // also we can create using 4. …

The Set Data Structure in Javascript

Learn about how to use and when to use Set in JavaScript. The Set object allows you to create a collection of unique values(each value can occur only once). Set can contain any type of value (primitives or object reference). Set stores elements in the insertion order. The Set doesn’t contain’s keys 🔑 like a …

Best Resources to find select the beautiful gradient for front-end developers.

List of websites where you can select gradient for your websites. Gradient for frontend developers. UIGradient UIGradient is a community contributed collection of beautiful multi-color gradients. You can easily generate gradients , rotate and download the gradient as image . They also provide some open source libraries for iOS, react, etc., .Link to their repo is here 2.ColorSpace …

A Simple Introduction to the ES6 Map Data Structure in JavaScript

A Map is a collection of key🔑 — value pairs, similar to an object. It stores the key🔑 — value pairs in the insertion order. We can create a Map by passing an iterable object whose elements are in the form of key🔑 — value (Eg. [ [1,”one”], [2,”two”] ] ), or you can create an empty Map, then insert entries. …

Javascript Date and Time in Detail

Learn about date and time in Javascript by creating some cool 😎 stuffs Javascript has a built-in Date object to handle all the time and date related operations. For example, you can display the current date/time, create a calendar, build a Pomodoro timer, code out a 🛑 stop-watch, and much more. Creating a Date Object We can …

Design a site like this with WordPress.com
Get started