Home

JavaScript (Page 2)

Pass Argument to addEventListener

When using the native addEventListener function, you may often want to pass arguments to the callback function. Anonymous functions are here to help.

Sep 28, 2022

Passing Arguments to JavaScript Function Parameters

Things can be tricky when you want to use a function (with required parameters) as an argument within another function.

Sep 13, 2022

Should You Learn jQuery in 2022?

It may seem like jQuery has been dead for years, but it is still widely used in 2022. But should you take the time to learn it?

Jul 22, 2022

10 Angular Tools to Build Creative Web Apps

To help the developers build robust and high-quality web apps, Angular offers plenty of useful tools.

Harikrishna Kundariya
Jun 30, 2022

Open External next/link Links in a New Tab

Add a component that dynamically swaps between next/link and a native anchor tag, and decides how to write the target attribute, all based on the href property.

Jun 30, 2022

Styling Placeholders for Select Fields

A (limited) CSS-only approach for styling placeholders, along with a way to work around the limitations with a custom JS-based solution.

Jun 16, 2022

Pro Tip: Simplify If Statements Using Exit Conditions

Exit clauses can help you write less code and make your code more readable. Here is a simple example, along with some additional tips.

May 24, 2022

Mapping Dynamic Object Keys in TypeScript

Dynamic property maps are a super powerful paradigm in JavaScript, but they can be tricky to type correctly with TypeScript.

May 20, 2022

Use Dynamic Property Maps over Switch Case Statements

An everyday JavaScript pattern to avoid clunky switch-case statements and unnecessary if conditionals.

May 19, 2022

Run JavaScript Script Before Another Script

Automatically run scripts with NPM/Yarn before or after another script.

May 09, 2022