Semantic Versioning with npm
Semantic Versioning, often referred to as SemVer, is a crucial convention within the Node.
Read MoreUnderstanding Peer Dependencies in Node Modules
When working with Node.js and managing packages for your projects, you’re likely familiar with the dependencies and devDependencies sections in a package.
Read MoreProgramming Languages Series
1. Introduction Welcome to our Programming Languages Series! In this series, we’ll explore various programming languages, understand their purposes, provide code examples, and discuss when to use each one.
Read MoreReact State Balancing: A Guide to State Management
As React apps grow, managing shared and app-wide state can become challenging.
Read MoreReact + Node: Beginner's Guide to Full Stack Dev
React excels at building fast, dynamic frontends. Node.js shines for server-side APIs and microservices.
Read MoreOptimal React Patterns: Beginner's Guide
As with any framework, React comes with its own set of best practices and optimal patterns.
Read MoreDebugging React Apps: Beginner's Guide
Bugs are inevitable in complex React applications. Thankfully, React provides great tools to squash bugs quickly.
Read MoreAdvanced React Patterns: Compound Components & More
As React apps scale, you’ll want to structure components for greater reusability and composability.
Read MoreReact Animation Guide: Libraries and Techniques
Animation brings interfaces to life. Thankfully, React has great open source libraries for animation.
Read MoreTesting React Apps: Beginner's Guide to TDD
Testing is crucial for ensuring React apps are stable and bug-free.
Read MoreData Fetched Fast - A Beginner's Guide to React Query
Fetching data in React often means using stale state and complex caching logic.
Read MoreForms Simplified, A Beginner's Guide to Managing React Forms
Forms are a common need for many React apps. However, managing form state and validation can be tricky.
Read MoreOptimizing React Performance: Beginner's Guide
As React apps grow, you may notice performance starting to lag - sluggish interactions, choppy animations, janky scrolling.
Read MoreState Management 101 - A Beginner's Guide to React State
State management is a crucial concept in React. State allows components to dynamically update UI based on data changes.
Read MoreAccessible React Apps: Beginner's Guide to Accessibility
Accessibility is an important consideration when building modern web apps. React provides useful tools to make accessible, inclusive products.
Read MoreMystery Boxes - A Beginner's Guide to React Fragments
When returning multiple elements from a component’s render method, they must be wrapped in a single parent DOM node:
Read MoreUnidirectional Data Flow in React: Beginner's Guide
A key advantage of React is its unidirectional data flow. This makes the flow of data predictable, and helps avoid unexpected side effects from data changing unexpectedly.
Read MoreEvent Handling in React: Beginner's Guide
Responding to user events is a crucial part of building interactive UIs.
Read MoreHooked on React - A Beginner's Guide to React Hooks
When React was first released, class components were the standard way to build complex UIs.
Read MoreLifting State in React: Beginner's Guide
As React apps grow in complexity, managing shared state between components can become tricky.
Read MoreLooping in JSX with React Keys: Beginner's Guide
Looping over arrays to render lists of elements is a common need in React apps.
Read MoreConditional Rendering in React
In React apps, you’ll often need to render different UI components conditionally based on certain state.
Read MorePassing Data Between React Components with Props
One of React’s core concepts is reusability through composable components. Components allow splitting complex UI into separate, reusable pieces.
Read MoreHow to Download a File in NodeJS without any Third Party Libraries
If you need to download a file in NodeJS without using any third party libraries, then you can do the following.
Read MoreHow to Execute a Shell Script in NodeJS
If you need to execute a shell script in NodeJS, then you can use the exec keyword.
Read MoreHow to Convert Milliseconds to Date in Javascript
If you need to convert Milliseconds to Date in Javascript, then you can do the following:
Read MoreHow to Convert String to Title Case in Javascript
If you need to convert a String to Title Case in Javascript, then you can do one of the following:
Read MoreHow to Deploy React App to S3 and CloudFront
If you would like to deploy a React App to AWS S3 and AWS CloudFront, then you can follow this guide.
Read More[Solved] export ‘Switch’ (imported as ‘Switch’) was not found in ‘react-router-dom’
In react-router-dom v6, Switch is replaced by routes Routes. You need to update the import from:
Read MoreHow to get all checked checkboxes in Javascript
If you need to get all the checked checkboxes using Javascript, then you can do the following:
Read MoreHow to Create a Hashtag Generator in Javascript
If you want to create a hashtag generator in Javascript, then you can do the following:
Read MoreHow to Confirm before Leaving Page in Javascript
You can implement a function to be called before the user leaves a page with Javascript as follows:
Read MoreHow to Style an Element using Javascript
If you need to style an element using Javascript then you can use the style object to support all your CSS needs.
Read MoreHow to Wait 1 Second in Javascript
If you need your Javascript code to wait one (1) second (or more) while executing, then there are a couple of ways to achieve this.
Read MoreHow to use forEach method in Javascript
Arrays come with a useful forEach function that allows you to loop through the array.
Read MoreHow to Remove an Element from an Array in Javascript
If you need to remove an element from an array in Javascript, then you can use one of the following five (5) options:
Read MoreHow to get the Alphabet as Array in Javascript
If you need to get an array of alphabetical letters in Javascript then you can use one of the following:
Read MoreHow to get the Screen Width in Javascript
Javascript gives a few options to determine the screen width.
Read MoreHow to Reset Udemy Progress
If you need to redo a Udemy course and you would like to reset the course’s progress, then you can use the following Javascript snippet below.
Read MoreHow to Sort an Array of Objects by Property in Javascript
If you need to sort an array of objects by their property values using Javascript, then you don’t need to look further than the built-in sort functionality.
Read More[Solved] npm ERR! could not determine executable to run
If you get the following message, then there’s a very easy fix:
Read More[Solved] npm ERR! path node_modules/node-sass
If you get the following error and need a solution, then look no further!
Read MoreHow to Install Lodash through Yarn for React
You can install lodash through yarn as follows: Step 1 – Install Lodash to get the Library yarn add lodash Step 2 – Get the Typescript info yarn add --dev @types/lodash
Read MoreHow to update each dependency in package.json to the latest version
You have 2 options: Option 1 – Recommended (Using npx) npx npm-check-updates -u npm install Option 2 – Older way (Using npm globally) npm i -g npm-check-updates ncu -u npm install
Read MoreHow to Convert IPv4 to int32 in Javascript
The challenge Take the following IPv4 address: 128.32.10.1 This address has 4 octets where each octet is a single byte (or 8 bits).
Read MoreHow to Solve the Grouped by Commas Challenge in Javascript
The challenge Finish the solution so that it takes an input n (integer) and returns a string that is the decimal representation of the number grouped by commas after every 3 digits.
Read MoreHow to Create a Pyramid Array in Javascript
The challenge Write a function that when given a number >= 0, returns an Array of ascending length subarrays.
Read MoreHow to Create a Reverse Polish Notation Calculator in Javascript
The challenge Your job is to create a calculator which evaluates expressions in Reverse Polish notation.
Read MoreHow to declare a global variable in React?
If you need to declare a global variable in React, then you can do the following:
Read MoreHow to Find the Missing Term in an Arithmetic Progression in Javascript
The challenge An Arithmetic Progression is defined as one in which there is a constant difference between the consecutive terms of a given series of numbers.
Read MoreHow to Count Characters in a Javascript String
The challenge The main idea is to count all the occurring characters in a string.
Read MoreHow to Increment/Decrement a value in React/NextJS
Use the following code block to get started: function GetCount() { const [count, setCount] = useState(1); const incrementCounter = () => { setCount(count+1) } const decrementCounter = () => { if (count>1) setCount(count-1) } return <div className="_counterWrapper"> <span className="_dec" onClick={() => decrementCounter()}>-</span> <span className="_val">{count}</span> <span className="_inc" onClick={() => incrementCounter()}>+</span> </div> } Then in your HTML code, add it like this:
Read MoreFixing: ImmutableService requires getRowNodeId() callback to be implemented, your row data need IDs
If you have gotten this error before, then you have been trying to implement a rowData mapping onto Ag-Grid.
Read MoreAutomatically Resize All Columns to Fit in Ag-Grid
If you have an Ag-Grid, and want to automatically resize all the columns to fit the width of the viewport, you can use this hack.
Read MoreHow to Get All Rows in Ag-Grid
The easiest way to get the content of all rows’ data, back into a Javascript/Typescript array, is as follows.
Read MoreHow to Download a CSV file using Javascript
Ever wanted to generate a CSV (comma separated values) file directly from the browser, using Javascript?
Read MoreHow to Format Numbers by Prepending 0 to single-digit numbers in Javascript
If you have a single-digit number, and you need to format it to always have at-least two digits, then you can use the below function to solve your problem:
Read MoreValidate Email Address in Javascript
Below is a nice little Javascript RegularExpression to validate email addresses.
Read MoreRemove hash from window.location in Javascript
E.g. URL:<br>http://example.com/?option=1&task=2&listing_id=36&layout=4&table=5#some_hash_value_here So how would you get the current URL using Javascript?
Read MoreHow to use Google Analytics in AngularJS
It seems to be quite a popular question with not as many answers to hold the weight.
Read MoreComparing Java and Javascript
Perhaps the first thing that most people ask when they hear the names of these two programming languages are.
Read MoreConvert URL String into a Javascript Object
Sometimes you find yourself with a String, something like and you want to repeatably access elements of it correctly.
Read MoreHow to fix a Javascript Uncaught ReferenceError
Sometimes you may get an error that looks something like this:
Read Moreuncaught typeerror: $ is not a function
The dollar-sign ($) in Javascript has for many years now been associated with jQuery.
Read MoreAnother WTF Javascript Moment
Javascript is a powerful language, but sometimes it doesn’t always do what you expect it to.
Read MoreHow to Format a Number as a Currency in Javascript
There are quite a few ways to format a number as a currency value in Javascript.
Read MoreHow to Host an AngularJS site on AWS S3
AngularJS is a Javascript Framework that allows you to create dynamic front-end web applications easily.
Read MoreGenerate a random number between two numbers in JavaScript
If you need to generate a random number between two numbers in JavaScript, then you are in the right place!
Read MoreHow to tell if a String contains a Substring in Javascript
Javascript comes with some pretty good support for determining if a string contains a substring.
Read MoreHow to write Anonymous Functions in Javascript
There is a lot of power in Javascript syntax. One of those powerful things is that of Javascript Anonymous Functions.
Read MoreWhat is Fizz Buzz?
Fizz buzz is a common programming interview question. The problem statement usually reads something like this:
Read MoreHow to safely parse JSON in Javascript
JSON stands for Javascript Object Notation and has become wildly popular to transport and store data between application, databases and more.
Read MoreCheck if an HTML Checkbox is checked using Javascript
While processing forms in web development, it’s a common requirement to be able to tell if a checkbox has been checked or not.
Read MoreHow to Merge Javascript Objects
A Javascript Object – now just called JSON – is a collection of values and properties stored as a map.
Read MoreIntroduction to NPM
What is NPM? NPM stands for Node Package Manager, and is the default way to extend your Node applications.
Read MoreHow to replace all occurrences of a string in Javascript
I have pretty much resigned myself to the fact that in Javascript, there are really only two ways to do a proper search and replace.
Read MoreKeep Google Map v3 centered when browser is resized
Using Google Maps V3 Javascript API you can keep the map centered to the browser’s window by using the following trick when resizing the window.
Read MorejQuery limit fields to alphanumeric characters only
I was trying to restrict a form’s field from only allowing the user to enter alphanumeric characters into it.
Read MoreDisable Cache in jQuery
I usually run into this problem when dealing with good ol’ Internet Explorer (.
Read MoreHow to break out of an iframe
So someone’s trying to make their site better by opening a page on your site inside of their site using an iframe?
Read MorejQuery Colorbox not showing but background shows
I was using Colorbox for some lightbox type effects to show larger images when clicking on thumbnails, but for some reason the background was showing up but the pretty little box in the middle where the larger image is supposed to show never showed up, so this is how I made it finally appear after many failed attempts!
Read MoreGet Value of Checkbox using jQuery
This one is quite an easy one, but a good one to mention non-the-less as it does definitely come in really handy.
Read MoreTernary Operation
If you do not know what the Ternary operator is, or do not use it while you are coding, let me be the first to tell you how much you are missing out!
Read MoreIE6 PngFix in Javascript
As a web developer you will know just how much we all love hate Internet Explorer 6 – one of the most dreaded browsers and browser versions that still exists in the deep dark corners of the interwebs – and you will probably have figured out that it doesn’t play well with PNG images.
Read MoreHow to get ‘how many days in February’ using Javascript?
It is quite handy to have a function that can tell you how many days there are in February due to the leap year shift of either 28 or 29 days.
Read MoreSearch and Replace Anchor Href using Javascript
I have a site that is under development and it was made really badly so I needed a quick way to replace all anchors on page to the relevant path.
Read MoreSwap HTML Elements Using Javascript
It is quite easy to use javascript to swap between divs or any other html dom elements.
Read More[Exception… “Could not convert JavaScript” nsresult: “0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)”
What the heck is.. uncaught exception: [Exception… “Could not convert JavaScript argument arg 0 [nsIDOMHTMLDivElement.
Read MoreFirefox error in FeedProcessor.js
[Exception… “Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIChannel.contentType]” nsresult: “0x80040111 (NS_ERROR_NOT_AVAILABLE)” location: “JS frame :: file:///C:/Program%20Files/Mozilla%20Firefox/components/FeedProcessor.
Read MoreTypeError: node is null message=node is null
The following error message occurs in Firefox 3 when using Firebug.
Read MoreHow to Temporarily Edit the Text of Any Website
Have you ever wanted to temporarily edit a webpage displayed in Chrome or another browser?
Read MoreSending data from javascript to php
If you ever find yourself needing to do some ajax and in turn sending strings of characters via javascript then you should really try encodeURIComponent() to wrap your strings in.
Read MoreWhat is Eb in firebug?
Gmail produces the following error/warning in firebug. Eb is not defined
Read MoreAdd TinyMCE code button
I had quite a few problems adding the htmlCode button to a fairly old copy of TinyMCE (I think around version 2.
Read More