Contact!

JavaScript

Posts in this category:

How to use guard clauses in JavaScript

How to/why use guard clauses in JavaScript

by Gav 16/03/2023

Learn how to improve code readability and performance by using guard clauses in JavaScript. Discover their benefits and best practices.

Implements and Extends, Object Oriented TypeScript

Implements and Extends, Object Oriented TypeScript

by Gav 15/03/2023

Learn the difference between implements and extends in TypeScript. Use Implements to implement interfaces and types, and extends to inherit from classes.

Measuring code execution performance in JavaScript

Measuring code execution performance in JavaScript

by Gav 13/03/2023

Measuring code execution performance is an important way to identify bottlenecks. Use these methods in JavaScript to help optimise your code.

Node Sass does not yet support your current environment

Node Sass does not yet support your current environment

by Gav 17/03/2021

Here is how you can fix node incompatibility error, using "Node Sass does not yet support your current environment" as an example.

Get the current mouse position from a JavaScript event

Get the current position of the mouse from a JavaScript event

by Gav 24/05/2020

Lets look at how to get the current clientX and clientY position of the mouse pointer from a JavaScript 'mousemove' event.

Multiple values in an Array, creating an inArray function in Javascript

Find single or array of values in JavaScript array using includes

by Gav 20/05/2020

Find out whether a JavaScript array contains single or multiple values by passing an array of values to includes() with the help of some() and every().

Find nearest number in array

Find the closest number in an array JavaScript

by Gav 12/11/2019

Would you like to match the closest number in an array using JavaScript? Find out how to achieve this using both reduce() and sort().

Get the difference JavaScript

Get the difference between 2 numbers JavaScript

by Gav 12/11/2019

Getting the difference between 2 numbers in JavaScript isn't as simple as it sounds. Let's look at 2 methods for reliably returning the difference.

String Interpolation JS, SCSS, SASS

String interpolation in JavaScript, Sass and scss

by Gav 01/11/2019

Use Sass variables inside css variables and strings. Learn how to interpolate strings in JavaScript(es6), Sass and scss.

;