FeaturesPricingTopicsBlogGuides
← All topics

JavaScript

98 articles from DEV Community, Medium, freeCodeCamp and more. Refreshed every few hours.

DEV Community

Weighted overtime average: when one worker has two different hourly rates

Most overtime calculators assume one hourly rate. Real work is messier. I know people who stock shelves at $20 an hour on weekdays and wash dishes at $14 an hour at the weekend, all for the same employer. When that week hits 50 hours, which rate does the overtime use? The answer is neither — and this is the rule I had to build into the overtime calculator on mytimecardcal.com when I added support for mixed-rate weeks. Under the US Fair Labor Standards Act, overtime is paid at one and a half time

JavaScriptProgrammingWeb development
27 Nov 2026
DEV Community

`use()` Breaks the Rules of Hooks on Purpose. Here's the Catch.

You rip out a useEffect, a useState, and a cleanup flag, replace all three with one line of use(), and the component looks cleaner than it has in months. Then you refresh the page and the loading spinner never stops. Network tab: the same request, firing again, and again, every few milliseconds, forever. Nothing in the code is wrong, exactly. You just found the one rule use() actually enforces — by being the React API that's allowed to break every other rule. use() was built to end Before use(

JavaScriptProgrammingReact
27 Nov 2026
DEV Community

Template Literal Types Explained: Catching Path Typos at Compile Time

Somewhere in your codebase there's a function that looks like this: function get(obj: any, path: string) { return path.split(".").reduce((acc, key) => acc?.[key], obj); } const primaryColor = get(config, "theme.colros.primary"); Read that path again. colros, not colors. TypeScript compiles it without a single complaint. The app ships. primaryColor is undefined, some fallback kicks in, and the button is the wrong shade of blue for three weeks before a designer notices and files a ticket nobod

JavaScriptProgrammingTypeScript
27 Nov 2026
DEV Community

Your WebSocket Reconnects Fine. The Messages It Missed Never Do.

The badge in the corner goes from green to red to green again. Three seconds, tops — long enough to walk through a subway turnstile, short enough that nobody files a bug. Your reconnect logic did exactly its job: it noticed the drop, waited, and opened a fresh connection before the user even looked up. Two days later, someone on your team says "wait, I never got the update you pushed at 2:14." You check the logs. The server sent it. The client was definitely connected by 2:16. The message is jus

JavaScriptProgrammingWeb development
27 Nov 2026
DEV Community

Next.js 16 use cache: remote vs use cache: private

A team ships personalized product recommendations on a product page. The data depends on the visitor's session cookie, so a teammate wraps the fetch in a plain 'use cache' function and reads cookies() inside it. next build passes. next start doesn't: every request to that route throws next-request-in-use-cache, because use cache cannot see request-time APIs at all, by design. The fix looks obvious: switch to 'use cache: private', since the docs say it's the directive that can read cookies. It co

JavaScriptProgrammingWeb development
27 Nov 2026
Medium

JavaScript: Event Loop, Call Stack, Microtask ve Macrotask Nasıl Çalışır?

JavaScript’in asenkron çalışma mantığını kod örnekleriyle keşfedelim. Continue reading on Medium »

JavaScriptProgrammingSoftware engineering
27 Nov 2026
DEV Community

Generating CycloneDX v1.5 SBOMs from package.json, requirements.txt & go.mod in Pure JS

With the EU Cyber Resilience Act (CRA) and enterprise vendor security reviews requiring a Software Bill of Materials (SBOM) for nearly every B2B contract, engineering teams often need a fast way to turn package.json, requirements.txt, go.mod, or Cargo.toml into a valid CycloneDX v1.5 JSON manifest. Most online converters upload your manifest to a backend server—exposing private internal package names and pinned versions before you've patched CVEs. Here is how you can parse multi-ecosystem manife

JavaScriptProgrammingCybersecurity
26 Nov 2026
DEV Community

A Data Layer Contract for Reliable Lead Tracking in WordPress and SPAs

If a marketing dashboard reports a lead whenever somebody presses Submit, it probably reports attempts rather than accepted enquiries. Validation errors, blocked requests and double clicks are common, and they are easy to overlook in a tag-only implementation. A data-layer contract gives your website, Google Tag Manager and analytics team one agreed definition of an event. It also prevents every new plugin from becoming an accidental second source of truth. window.dataLayer is a JavaScript array

JavaScriptProgrammingWeb development
25 Nov 2026
DEV Community

MV3 Service Worker Timer Persistence: Four Strategies, Ranked

I have shipped three of these four strategies in production. The one I regret is the offscreen document, because it solved the visible problem while creating a hidden one: users could close a window and silently stop a background job they believed was running. This is the ranking I would give a team starting today, with the trade-offs stated plainly. Ranking criteria: does it survive a worker restart, does it keep sub-minute precision, how much code does it add, and what is the policy or mainten

JavaScriptProgrammingArchitecture
25 Nov 2026
DEV Community

Danger JS on Bitbucket Pipelines with a Repository Access Token

target: By the end of this tutorial, Danger JS runs on every pull request in Bitbucket Pipelines, logged in with a repository access token, and comments on the pull request when a rule fails. Bitbucket Cloud, Bitbucket Pipelines https://danger.systems/js/usage/bitbucket_cloud.html https://github.com/danger/danger-js/blob/main/docs/usage/bitbucket_cloud.html.md https://github.com/danger/danger-js/pull/1398 https://github.com/danger/danger-js/pull/964 https://support.atlassian.com/bitbucket-clou

JavaScriptProgrammingDevOps
25 Nov 2026
DEV Community

Your FDV chart can jump without a price move

CoinGecko's API docs show a Bitcoin price of $77,671 and a fully diluted valuation (FDV) of about $1.556 trillion. The same response lists a maximum supply of 21 million BTC. Multiply those two numbers and you get $1.631 trillion. Where did the extra $75 billion come from? The docs give us another field to check. The example response is dated May 18, 2026 and lists a total supply of 20,030,843 BTC. Here's what happens when you use each supply figure with the displayed price. CoinGecko's /coins/m

JavaScriptProgrammingWeb development
25 Nov 2026
Medium

Learn JavaScript testing with Jest: matchers, async tests, mocks and fake timers explained

A beginner friendly guide to testing JavaScript with Jest: matchers, async code, mocks, fake timers, coverage and good practices Continue reading on Medium »

JavaScriptProgrammingWeb development
24 Nov 2026
DEV Community

JavaScript fetch(): Pull Contacts From an API Into an HTML Table in Ten Lines (async, await and nested JSON)

Most business tools, from CRMs to accounting apps, share their data through an API: a web address that answers with data instead of a page. If someone on your team copies contacts from a CRM into a spreadsheet every week, that's a job for a few lines of JavaScript. This walkthrough uses JSONPlaceholder, a free practice API with ten made-up users, and JSFiddle (no account needed). By the end you'll have a "Client contacts" table filled by your own code. Open this address in your browser: https://

JavaScriptProgrammingWeb development
24 Nov 2026
DEV Community

Three breaks a day: the second break field nobody asked for until they did

When I built the first version of my time card calculator, each day had one break field. One lunch break, one start, one end, one total. It seemed like enough. Nobody works a shift with more than one break, right? Wrong. Within a week of the site going live, people were doing something I had never planned for: typing two breaks into a single field. "30+15" in the lunch box. "20, 20" in the minutes field. A few even left a note in the name field: "took a second break". The calculator just ignored

JavaScriptProgrammingWeb development
23 Nov 2026
DEV Community

Micro Frontends Are an Organizational Tool Wearing a Technical Costume

A practical guide to what they are, when they're worth it, how to build them, and how to avoid turning your frontend into a distributed mess Picture a Thursday afternoon at a growing company. The Checkout team has fixed a bug that's costing real money: some customers can't apply discount codes. The fix is three lines long. It was reviewed in ten minutes. It's ready. And it will reach customers… in eleven days. Because the frontend is one application, it ships as one unit. The release goes out ev

JavaScriptProgrammingWeb development
23 Nov 2026
DEV Community

Hash-chained audit logs, explained in under 40 lines of code

An audit log has one job that ordinary application logs do not: it has to be believable after something went wrong. When an agent ran a command it should not have, or a secret was used at 3 a.m., the log is what you show your team, your customer or your assessor. If anyone with database access could have quietly edited it, it is a story, not evidence. Hash chaining is the standard, simple technique for making a log tamper-evident. This post explains how it works, what it proves and what it does

JavaScriptProgrammingCybersecurity
23 Nov 2026
DEV Community

Why Your Extension's Counter Resets to Zero

The badge went 1, 2, 3, then 1. No exception, no reload, no second installation. The counter was a module-level let in the service worker, and the service worker had been terminated between clicks. This is the smallest possible MV3 bug, which makes it a good place to see the three levels of fix. The short version The counter lives in the worker's heap; the heap is disposable. Write it to chrome.storage.session on every change for correctness. Debounce the write if the counter changes rapidly, an

JavaScriptProgramming
22 Nov 2026
DEV Community

Why your "free" dynamic QR code stopped working, and how to design one that won't

A QR code is a picture of some text. When that text is a URL, phones open it. That is the whole trick, and it explains most of the problems people run into with QR codes printed on menus, posters and packaging. There are two ways to put a URL into a QR code. A static code encodes the final destination directly, for example https://example.com/menu.pdf. Nothing sits between the phone and your page. The code works for as long as that page exists, and no service can switch it off. The catch is that

JavaScriptProgrammingWeb development
22 Nov 2026
DEV Community

Pull the top pumpfun traders and what they are buying from a free public API, in TypeScript

Most pumpfun APIs return new coins. A different question is more interesting to a developer: which accounts made the most realized profit over the last 30 days, and which coins are several tracked traders buying right now? This post answers both with two plain GET requests and about 100 lines of TypeScript. No key, no scraper, no library. The output is two small tables, and a saved fixture lets you reproduce the numbers printed below. Disclosure: I am the founder of copy.top. The API used here i

JavaScriptProgrammingTypeScript
21 Nov 2026
DEV Community

Building an Ecommerce Ai Shopping Assistant

A shopper lands on an online store at 11 p.m. and types a simple question into the chat widget: "Can this get to me by Friday?" If the store relies on a static FAQ bot or manual replies the next morning, that shopper has usually already bought the gift somewhere else. Most basic storefront chatbots fail because they are disconnected from live store data. When a customer asks for a luxury gift under a specific budget that can arrive before the weekend, a generic language model either hallucinates

JavaScriptProgrammingAI
21 Nov 2026
DEV Community

Refactoring Anxiety: 5 Cognitive Distortions That Sabotage Your Code Cleanup

Refactoring Anxiety: 5 Cognitive Distortions That Sabotage Your Code Cleanup You stare at the legacy module. You know it needs refactoring. The tech debt is piling up, the bug reports are mounting, and every new feature takes twice as long as it should. But you can't bring yourself to touch it. "What if I break something?" you think. "What if I make it worse? Maybe I'm not smart enough to understand this code. Maybe I should just rewrite it from scratch." If this sounds familiar, you're not de

JavaScriptProgrammingProductivity
20 Nov 2026
Medium

15 Web APIs Already Hiding Inside Node 22

Node 22 quietly ships a large part of the browser platform, and most developers still reach for npm packages instead. Continue reading on JavaScript in Plain English »

JavaScriptProgrammingData science
20 Nov 2026
DEV Community

How I built a free roof calculator in Astro that scores 100 on Lighthouse

Roof quotes are written in "squares", and most homeowners have no easy way to check if 28 squares is right for their house. I went looking for a calculator. Most of the ones I found loaded a wall of ads, asked for an email before showing a number, or took five seconds to become usable on a phone. So I built my own. This post covers the math, the stack and a few small decisions that kept the site fast. A roof is mostly a tilted rectangle. If you know the footprint of the house and how steep the r

JavaScriptProgrammingWeb development
20 Nov 2026
DEV Community

The EN 16931 errors that reject most e-invoices, and how to fix them

If you generate Factur-X, ZUGFeRD, XRechnung or Peppol invoices, sooner or later a validator answers with something like [BR-CO-14] and a sentence full of BT numbers. These codes come from the European standard EN 16931, and a handful of them account for most rejections. Almost all are about arithmetic and rounding, not XML. Here are the ones I see most often, what they actually check, and how to fix the code that produces them. VAT category tax amount (BT-117) = VAT category taxable amount (BT-

JavaScriptProgrammingWeb development
19 Nov 2026
DEV Community

In What Order Does a JavaScript Expression Run? Watching It Turn into a Value

In this series, we use JSVisualizer, a free browser-based tool, to understand classic algorithms by watching them run. Last time we looked at functions. This time the topic is how expressions are evaluated (evaluating an expression just means working out its value), and the star of the show is the Expr view. What ends up in ok here? let a = 2; let b = 3; let c = 4; let d = true; let ok = a + b * c > 10 && d; console.log(ok); The answer is true. But faced with a line like line 5, it's easy to ge

JavaScriptProgrammingEducation
19 Nov 2026
DEV Community

Service Worker Keeps Stopping? That's the Contract, Not a Bug

The message in the console is not an error. Service worker registration successful followed by silence is the designed behavior of Manifest V3, and the sooner that stops feeling like a crash, the sooner the bugs get easier. These are the questions I answer most often, in the order they usually arrive. The short version The worker is supposed to stop when idle; that is not a failure. Logs vanish because each worker gets a fresh console, not because logging broke. Persist deadlines and job records

JavaScriptProgramming
19 Nov 2026
DEV Community

Your "49 KB" file is actually 50.5 KB. Blame the kilobyte.

A user picks a file. Their computer says 49 KB. Your form says "max 50 KB." The upload gets rejected anyway, and now there's a support ticket that says your site is broken. It isn't broken, exactly. You and the user just disagree about what a kilobyte is. And honestly? Both of you are right. There are two definitions in everyday use: KB (kilobyte), SI/decimal: 1,000 bytes KiB (kibibyte), IEC/binary: 1,024 bytes The IEC prefixes (KiB, MiB, GiB) exist precisely to separate the two. Almost nobody u

JavaScriptProgrammingWeb development
19 Nov 2026
DEV Community

The Complete CBT Mental Health Toolkit: Free Tools for Developers

title: "The Complete CBT Mental Health Toolkit: Free Tools for Developers" As a developer who struggled with anxiety, I built a comprehensive set of CBT (Cognitive Behavioral Therapy) tools. They're all free, open source, and privacy-first — no signup, no backend, no data collection. All tools run entirely in your browser. No accounts, no tracking, no paywalls. CBT Thought Record — The core CBT exercise. Catch, examine, and reframe anxious thoughts. Anxiety Grounding Kit — 5-4-3-2-1 sensory gr

JavaScriptProgrammingWeb development
19 Nov 2026
freeCodeCamp

How to Build a Browser-Based PDF Password Protector Using JavaScript

Contracts, invoices, medical reports, and scanned ID cards are often converted to PDF files. And if one of them ends up in the wrong inbox or on a shared drive, anyone can open it. Adding a password f

JavaScriptProgrammingCybersecurity
19 Nov 2026
DEV Community

MB vs MiB, Container Overhead and Headroom: Engineering a "Fits Under 20 MB" Guarantee

Disclosure: I work on CompressVid. The results and the bug below are from our own testing. Sizes are as displayed by our tool, which counts in binary megabytes (MiB). If you build a "compress for Discord" feature, the spec sounds trivial: output must be under 20 MB. In practice, three separate things try to push you over the line. Our Discord preset is 19 MB, not 20, and this post explains why that one megabyte exists, including the time it wasn't enough. const MB = 1_000_000; // SI megabyte

JavaScriptProgrammingWeb development
19 Nov 2026
Medium

How to Debug JavaScript Without Randomly Changing Code

A Practical, Step-by-Step Debugging Workflow to Find Bugs Faster, Understand What’s Breaking, and Fix Problems With Confidence Continue reading on JavaScript in Plain English »

JavaScriptProgrammingWeb development
19 Nov 2026
DEV Community

Why useReducer? Why do we need multiple functions to update a single state?

When working with React, we usually use useState() to manage state. For example, imagine building a counter application with three operations: Increment Decrement Reset Using useState(), we might write separate functions for each operation. const [count, setCount] = useState(0); function increment() { setCount(count + 1); } function decrement() { setCount(count - 1); } function reset() { setCount(0); } Here, we have three different functions to perform three operations on the sam

JavaScriptProgrammingReact
19 Nov 2026
DEV Community

Building a Multi-Step Form That Survives Page Refreshes

A three-step registration form where the user loses all input on a browser refresh is a conversion killer. The standard SPA approach — hold state in a React/Vue store — evaporates on reload. You need a persistence layer that the user never thinks about. Write each step's data to sessionStorage on every input change, and hydrate from it on mount: function usePersisted<T>(key: string, initial: T): [T, (v: T) => void] { const stored = sessionStorage.getItem(key); const [val, setVal] = useState<

JavaScriptProgrammingUX design
19 Nov 2026
Medium

Stop Watching JavaScript Tutorials. Build These 3 Projects Instead

Three practical JavaScript projects that will teach you more about real-world development than another 10-hour course. Continue reading on JavaScript in Plain English »

JavaScriptProgrammingWeb development
19 Nov 2026
DEV Community

How to update one dynamic zone block in Strapi 5 (without deleting the others)

You have a Strapi 5 page built from a dynamic zone: a hero, a feature grid and a call to action. You want to change the hero's heading and nothing else. So you send an update with the hero block, and the feature grid and the call to action are gone. That is how Strapi 5 writes lists. A dynamic zone, a repeatable component or a rich-text blocks field is replaced as a whole: the array you send becomes the new list, and anything you left out is deleted. The REST API works this way, and so does the

JavaScriptProgrammingAI
18 Nov 2026
Cloudflare Blog

How Cloudflare WAF helps protect against Java4Shell (CVE-2026-114938)

Java4Shell is a critical memory-corruption flaw in OpenJDK's Base64 decoder that can lead to remote code execution. Cloudflare has released six WAF managed rules for paid plans that logs matching requests by default. Patch your Java runtimes now.

JavaScriptProgrammingCybersecurity
18 Nov 2026
DEV Community

Signing lab reports with Ed25519: why we sign a canonical record, not the PDF

A lab report (a certificate of analysis, or COA) is a small document with a large trust problem. The lab issues a PDF. A seller posts it. A buyer reads it months later, on a page the lab does not control. A PDF can be edited in minutes, and a screenshot is easier still. We wanted a report that a stranger can check without trusting the page it sits on, and without trusting us to answer an email. This post covers the design we chose: an Ed25519 signature over a canonical data record, with the PDF

JavaScriptProgrammingCybersecurity
18 Nov 2026
DEV Community

An image compressor for strict KB ranges (like 20–50 KB) that runs in the tab

How do you compress an image under a strict KB cap? I built this because I got tired of upload forms rejecting my images. It works from a file size, not a quality slider: pick 50KB, 100KB, 200KB, 500KB or 1MB, or type your own number, and it aims under that cap at the best quality it can get away with. The end people forget is the other one. Plenty of forms want a range, 20KB to 50KB say, and an image that's too small gets rejected just as fast as one that's too big. So there's a minimum size

JavaScriptProgrammingWeb development
18 Nov 2026
Medium

TypeScript Is Growing Faster Than JavaScript. What Changed?

JavaScript still powers the web. But as applications become larger, teams become more distributed, and AI writes more code, TypeScript is… Continue reading on Skill Stuff »

JavaScriptProgrammingWeb development
17 Nov 2026
DEV Community

Most of My Users Couldn't Sign In With Google, and It Wasn't My Bug

On 3 November I looked at 14 days of visitor data for one form on my site. Five people had started filling it in and never finished. Four of them had pressed Continue with Google. Then nothing. They never came back. The button itself wasn't broken. So where did they go? My site is TrustCheck, and a lot of our visitors arrive from links shared on X, Instagram and Facebook. When you tap a link inside those apps, it doesn't open Chrome or Safari. It opens the app's own built-in browser. And Google

JavaScriptProgrammingWeb development
16 Nov 2026
DEV Community

The Background Timer That Survives Chrome's Reaper

A user sent a screenshot with two timestamps. At 14:02 they started a 25-minute focus session. At 14:27 they opened the popup and saw 25:00, as if the session had never begun. The badge had been counting down correctly for forty seconds. Then the worker died, and the only copy of the session state died with it. [14:02:10] worker boot [14:02:10] start(25m) -> interval 1000ms [14:02:11] tick remaining=1499s [14:02:12] tick remaining=1498s ... [14:02:41] tick remaining=1469s [14:02:41] service work

JavaScriptProgramming
16 Nov 2026
Medium

structuredClone vs JSON.parse(JSON.stringify): The Boundary Decides What Survives

I copied one snapshot both ways in Node 20. Each lost something different, and the place the data goes picks the copy for you. Continue reading on JavaScript in Plain English »

JavaScriptProgrammingWeb development
16 Nov 2026
DEV Community

Reading Workday and Rippling job boards without a scraper (and the pagination trap)

I added Workday and Rippling to my jobs monitor by reading their job-list responses directly. The useful discovery was not just the endpoints. It was a pagination detail that could make a working Workday integration stop early while reporting success. My saved second page contained twenty jobs and a total of zero. Treating that zero as the end of the board would have discarded valid results. Everything below is what I observed on real boards while building that integration. Neither endpoint is a

JavaScriptProgrammingWeb development
15 Nov 2026
DEV Community

I built 20 calculators that show their working. Here's the stack, the bugs and the SEO surprise

Most online calculators give you a number and expect you to trust it. I wanted the opposite: under every result, a line that prints the exact sum with your numbers in it, so you can check it by hand. That became EziSolutions, a free site with 20 calculators: Etsy, Mercari, Poshmark, Venmo, Stripe, Square and Fiverr fees, ROAS, customer LTV, CPM, BMI, TDEE, VAT, loans, freelance rates and a few more. No framework, no backend, no signup. Here's how it's built, the bugs that taught me something, an

JavaScriptProgrammingWeb development
15 Nov 2026
Medium

Learn to Create Long-Form Voiceovers with Python and JavaScript: Your Questions, Answered

Meta description: Turn a 10,000-word script into one smooth narration file with Python and JavaScript. Real questions, working code, and… Continue reading on Medium »

JavaScriptStartupsMachine learning
15 Nov 2026
Medium

How to Learn Programming for Free and Build Something in Your First Week

Where to start with freeCodeCamp, W3Schools, or Codédex, plus three small projects you can finish as a beginner. Continue reading on Medium »

JavaScriptProgrammingWeb development
15 Nov 2026
Medium

How Is a Notification System Designed with Python and JavaScript?

$DiligentGROUPs🚴 Continue reading on Medium »

JavaScriptProgrammingSoftware engineering
14 Nov 2026
DEV Community

Line-Item Forms with Inertia and React: Dynamic Rows, Nested Errors and Live Totals

Every business app has one form that is harder than all the others: the one with line items. A quote, a purchase order, an invoice, a stock transfer. The header is easy (customer, date, currency). The rows are where it gets messy: users add and remove lines, change a quantity and expect the total to update instantly, and then the server rejects line 3 and the error shows up next to line 4. I have rebuilt this form more times than I would like to admit. This post is the version I now start from,

JavaScriptProgrammingReact
14 Nov 2026

Related topics

ProgrammingWeb developmentCybersecuritySoftware engineeringReactTypeScriptArchitecturePython

Start with the tab you have open.

Free for your first hundred saves. No card needed.

tagit

Save it, describe it, find it again. Bookmarks that work the way remembering works.

Developed in Iceland
ProductFeaturesFor AI toolsFor teamsPricingChrome extension
ResourcesBlogGuidesTopicsWhy tagsTagging guideContact
CompanyTerms of servicePrivacy policyExtension privacyRefund policy
© bla ehf.support@tagit.io