Posts tagged "Vanilla JS"

Published: July 21 2023

Vanilla JS - HTML Encode in JavaScript

HTML encoding simply replaces HTML special characters like angle brackets with HTML entities so they can be displayed as plain text in a web page.
Published: July 07 2023

Vanilla JS - Slugify a String in JavaScript

A slug is typically all lower case, separated by dashes (hyphens) instead of spaces and doesn't contain any special characters.
Published: June 20 2023

Vanilla JS - Wrap Object Methods in Try/Catch to Handle Errors in JavaScript

I created the below function recently to encapsulate error handling logic for multiple JS object methods in a single place.
Published: January 06 2023

JavaScript - Add Event Listener to Multiple Elements in Vanilla JS

This is a super quick post to show how to add an event listener to multiple HTML elements in pure JavaScript.
Published: January 04 2023

Vanilla JS + CSS - Modal Popup (Dialog) Tutorial with Example

This is a quick post to show how easy it is to implement modal popups in pure HTML, CSS and JavaScript.
Published: December 16 2022

JavaScript - Sort an Array of Objects by Property in Vanilla JS

This is a super quick post to show how to sort an array of objects by property value in JavaScript (or TypeScript).
Published: December 06 2022

JavaScript - Initialize Array with Conditional Values or Objects in Vanilla JS

This is a super quick post to show how to initialize an array with conditional values in JavaScript (or TypeScript).
Published: October 15 2021

Vanilla JS - 7 ways to convert a string to a number in JavaScript

Some quick examples of how to convert a string to a number in JavaScript
Published: October 02 2021

Vanilla JS - Create an array with a range of numbers in a JavaScript

Some quick examples of how to generate a range of numbers in an array in JavaScript.
Published: September 14 2021

Vanilla JS - Get the max prop value from an object array in JavaScript

A quick example of how to get the maximum value of a property in an array of objects in JavaScript
Supported by