The development team at React introduced the concept of Hooks in React version 16.8. A React Hook allows the use of state and other React features in a function component. With the hook useState, a function component can set its…
React Lifecycle: An Overview
A lifecycle in React can be thought of in three different phases: mounting, updating, and unmounting. Mounting occurs when the React component renders to the DOM (Document Object Model). When changes are made to that component, it enters the updating…
A Closer Look at jQuery Selectors
Selectors are the foundation of the jQuery library. They will always be used when using jQuery to manipulate the DOM. Selectors operate as a function to return a matching element. They come with the jQuery library and are ready to…
What is JSON?
JSON is an acronym for JavaScript Object Notation. It is a JavaScript object that organizes data in key/value pairs. Storing data in this manner makes these objects lightweight and language independent. This means JSON can be read by most programming…
An Introduction to Strings in JavaScript
A string in JavaScript, as is the case in many other programming languages, is a data type that holds data in text form. A common use for strings in the context of a web application is holding a user’s input…
Manage State in React with setState
Keeping track of an application’s state is how a single page application (SAP) registers changes and renders them to the user. Unlike a model, view, controller (MVC) framework, SAPs do not redirect the user, and therefore need a way to…
A Beginner’s Guide to jQuery on()
The jQuery on() method is a way to attach an event handler on an element. The element passed to the selector can be anything on the page. Most commonly, on() is a way to attach a click handler to a…
JavaScript alert() Method
The JavaScript alert() method, also known as Window.alert(), displays an alert dialog box to a user. It accepts an optional message argument to display a message with an OK button to the user. Common uses for alert() are to let…
How to Disable a Button Using jQuery
There are many reasons to disable a button in a web application. Whether it’s to prevent a user from adding a sold out item to their shopping cart, or not allowing the user to click a button after an action…
How jQuery each() Works
jQuery each() is a concise way to iterate over DOM elements. Each() method is designed to be called on the target jQuery object. A jQuery object is an object that contains one or more DOM elements and has access to…