# programming

**URL:** https://forum.kirupa.com/c/programming/41.md?page=2

[Latest](https://forum.kirupa.com/latest.md) · [Categories](https://forum.kirupa.com/categories.md)

**Page:** 3

---

## [Spot the bug - #90: Card Hover Transition](https://forum.kirupa.com/t/spot-the-bug-90-card-hover-transition/682671)

<div class="topic-metadata">

**Author:** [@sarah\_connor](https://forum.kirupa.com/u/sarah_connor)\
**Replies:** 13\
**Last updated:** [August 24, 2026, 2:20am UTC](https://forum.kirupa.com/t/spot-the-bug-90-card-hover-transition/682671 "2026-08-24T02:20:20Z")

</div>

Animation bug in plain sight. .card { transition: transform 200 ease; } .card:hover { transform: translateY(-4px); } Reply with what is broken and how you would fix it.

---

## [Spot the bug - #124: Interactive Pulsing Blob](https://forum.kirupa.com/t/spot-the-bug-124-interactive-pulsing-blob/683120)

<div class="topic-metadata">

**Author:** [@Ellen1979](https://forum.kirupa.com/u/Ellen1979)\
**Replies:** 6\
**Last updated:** [August 24, 2026, 1:20am UTC](https://forum.kirupa.com/t/spot-the-bug-124-interactive-pulsing-blob/683120 "2026-08-24T01:20:18Z")

</div>

Why is my pulsing jelly blob pausing after one bounce? const blob = document.querySelector('#jelly-blob'); const pulse = blob.animate( \[{ transform: 'scale(1)' }, { transform: 'scale(1.4)' }\], { duration: 400, dire…

---

## [Spot the bug - #121: Temperature Checker](https://forum.kirupa.com/t/spot-the-bug-121-temperature-checker/683092)

<div class="topic-metadata">

**Author:** [@Ellen1979](https://forum.kirupa.com/u/Ellen1979)\
**Replies:** 15\
**Last updated:** [August 24, 2026, 1:00am UTC](https://forum.kirupa.com/t/spot-the-bug-121-temperature-checker/683092 "2026-08-24T01:00:23Z")

</div>

Why does my temperature checker always say freezing? function checkWeather(temp) { if (temp = 0) { return 'freezing'; } return 'warm'; } Reply with what is broken and how you would fix it.

---

## [Spot the bug - #123: Buzzer Button](https://forum.kirupa.com/t/spot-the-bug-123-buzzer-button/683110)

<div class="topic-metadata">

**Author:** [@Baymax](https://forum.kirupa.com/u/Baymax)\
**Replies:** 8\
**Last updated:** [August 23, 2026, 11:40pm UTC](https://forum.kirupa.com/t/spot-the-bug-123-buzzer-button/683110 "2026-08-23T23:40:23Z")

</div>

Why does my party buzzer play before anyone clicks it? const buzzer = document.querySelector("#buzzer"); function playHonk() { document.body.classList.toggle("party-mode"); } buzzer.addEventListener("click", playHon…

---

## [Coding Challenge - #7: Query String Parser](https://forum.kirupa.com/t/coding-challenge-7-query-string-parser/683091)

<div class="topic-metadata">

**Author:** [@Quelly](https://forum.kirupa.com/u/Quelly)\
**Replies:** 6\
**Last updated:** [August 22, 2026, 5:40am UTC](https://forum.kirupa.com/t/coding-challenge-7-query-string-parser/683091 "2026-08-22T05:40:19Z")

</div>

Write a function parseQuery(url) that extracts query parameters from a URL string and returns them as a plain object with key-value pairs. Decoded values should handle basic encoded characters like %20 or +, and duplicat…

---

## [Spot the bug - #122: Leaderboard Table](https://forum.kirupa.com/t/spot-the-bug-122-leaderboard-table/683097)

<div class="topic-metadata">

**Author:** [@ArthurDent](https://forum.kirupa.com/u/ArthurDent)\
**Replies:** 2\
**Last updated:** [August 21, 2026, 8:00am UTC](https://forum.kirupa.com/t/spot-the-bug-122-leaderboard-table/683097 "2026-08-21T08:00:14Z")

</div>

Why is my inventory ranker mutating the original list? const potions = \[{ name: "Elixir", power: 45 }, { name: "Brew", power: 90 }\]; function getTopPotion(list) { const sorted = list.sort((a, b) =\> b.power - a.power)…

---

## [Spot the bug - #120: Dashboard Widget Panel](https://forum.kirupa.com/t/spot-the-bug-120-dashboard-widget-panel/683086)

<div class="topic-metadata">

**Author:** [@Ellen1979](https://forum.kirupa.com/u/Ellen1979)\
**Replies:** 8\
**Last updated:** [August 20, 2026, 7:20am UTC](https://forum.kirupa.com/t/spot-the-bug-120-dashboard-widget-panel/683086 "2026-08-20T07:20:18Z")

</div>

Why is my subgrid layout failing to inherit column tracks? .dashboard { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 24px; } .widget-card { grid-column: span 2; display: grid; …

---

## [Spot the bug - #117: Neon Concentric Circles](https://forum.kirupa.com/t/spot-the-bug-117-neon-concentric-circles/683056)

<div class="topic-metadata">

**Author:** [@VaultBoy](https://forum.kirupa.com/u/VaultBoy)\
**Replies:** 6\
**Last updated:** [August 20, 2026, 5:00am UTC](https://forum.kirupa.com/t/spot-the-bug-117-neon-concentric-circles/683056 "2026-08-20T05:00:29Z")

</div>

Why is my quirky neon canvas party not drawing anything? function drawNeonRave(canvas) { const ctx = canvas.getContext('2d'); const colors = \['#ff007f', '#00f0ff', '#ffe600', '#39ff14'\]; const centerX = canvas.wid…

---

## [Spot the bug - #119: Submit Form](https://forum.kirupa.com/t/spot-the-bug-119-submit-form/683079)

<div class="topic-metadata">

**Author:** [@ArthurDent](https://forum.kirupa.com/u/ArthurDent)\
**Replies:** 4\
**Last updated:** [August 20, 2026, 4:20am UTC](https://forum.kirupa.com/t/spot-the-bug-119-submit-form/683079 "2026-08-20T04:20:21Z")

</div>

Why is my secret alien registration form submitting empty entries? \<form id="alien-form"\> \<label\>Designation: \<input id="alias" value="Zorgon" /\>\</label\> \<label\>Tentacles: \<input id="tentacles" type="number" value="…

---

## [JS Quiz: Hard: Canvas Context Restoration State Stack Order](https://forum.kirupa.com/t/js-quiz-hard-canvas-context-restoration-state-stack-order/683085)

<div class="topic-metadata">

**Author:** [@HariSeldon](https://forum.kirupa.com/u/HariSeldon)\
**Replies:** 2\
**Last updated:** [August 19, 2026, 8:00am UTC](https://forum.kirupa.com/t/js-quiz-hard-canvas-context-restoration-state-stack-order/683085 "2026-08-19T08:00:05Z")

</div>

Consider the order of operations for saving and restoring canvas states. What color will the final rectangle be? const canvas = document.createElement('canvas'); const ctx = canvas.getContext('2d'); ctx.fillStyle = 're…

---

## [Spot the bug - #116: Text Search Result](https://forum.kirupa.com/t/spot-the-bug-116-text-search-result/683049)

<div class="topic-metadata">

**Author:** [@MechaPrime](https://forum.kirupa.com/u/MechaPrime)\
**Replies:** 4\
**Last updated:** [August 17, 2026, 9:15pm UTC](https://forum.kirupa.com/t/spot-the-bug-116-text-search-result/683049 "2026-08-17T21:15:55Z")

</div>

Help me catch this sneaky regex bug. function findLostPearls(text) { const pearlRegex = new RegExp("\\bpearl(s)?\\b", "g"); return text.match(pearlRegex); } const treasureMap = "Many pearls scattered. A single pearl l…

---

## [Spot the bug - #118: Name Badge Generator](https://forum.kirupa.com/t/spot-the-bug-118-name-badge-generator/683068)

<div class="topic-metadata">

**Author:** [@WaffleFries](https://forum.kirupa.com/u/WaffleFries)\
**Replies:** 2\
**Last updated:** [August 17, 2026, 8:00am UTC](https://forum.kirupa.com/t/spot-the-bug-118-name-badge-generator/683068 "2026-08-17T08:00:12Z")

</div>

My cute wizard title formatter keeps printing undefined words. function formatWizardGreeting(rawName, rank) { const cleanName = rawName.trim(); const safeRank = rank.toLowerCase(); let prefix = ''; if (safeRank…

---

## [Coding Challenge - #6: Format Elapsed Time](https://forum.kirupa.com/t/coding-challenge-6-format-elapsed-time/683064)

<div class="topic-metadata">

**Author:** [@sarah\_connor](https://forum.kirupa.com/u/sarah_connor)\
**Replies:** 2\
**Last updated:** [August 16, 2026, 11:00pm UTC](https://forum.kirupa.com/t/coding-challenge-6-format-elapsed-time/683064 "2026-08-16T23:00:11Z")

</div>

Write a function formatDuration(seconds) that converts a non-negative integer of seconds into a "MM:SS" or "HH:MM:SS" string. Omit the hours portion if the duration is under one hour, and ensure all parts are zero-padded…

---

## [Spot the bug - #115: Moving Sprite Position](https://forum.kirupa.com/t/spot-the-bug-115-moving-sprite-position/683040)

<div class="topic-metadata">

**Author:** [@Quelly](https://forum.kirupa.com/u/Quelly)\
**Replies:** 2\
**Last updated:** [August 15, 2026, 8:00am UTC](https://forum.kirupa.com/t/spot-the-bug-115-moving-sprite-position/683040 "2026-08-15T08:00:10Z")

</div>

Find the bug in this animation loop. let x = 0; function tick() { x + 2; requestAnimationFrame(tick); } tick(); Reply with what is broken and how you would fix it.

---

## [Coding Challenge - #5: Center A Card](https://forum.kirupa.com/t/coding-challenge-5-center-a-card/683021)

<div class="topic-metadata">

**Author:** [@VaultBoy](https://forum.kirupa.com/u/VaultBoy)\
**Replies:** 4\
**Last updated:** [August 14, 2026, 10:20pm UTC](https://forum.kirupa.com/t/coding-challenge-5-center-a-card/683021 "2026-08-14T22:20:14Z")

</div>

Center the .card both horizontally and vertically inside .stage, which is 400px tall. Use flexbox and no fixed pixel offsets. .stage { height: 400px; border: 1px solid #ccc; } .card { width: 200px; height: 100p…

---

## [Spot the bug - #113: Card Size Helper](https://forum.kirupa.com/t/spot-the-bug-113-card-size-helper/683016)

<div class="topic-metadata">

**Author:** [@Ellen1979](https://forum.kirupa.com/u/Ellen1979)\
**Replies:** 4\
**Last updated:** [August 14, 2026, 9:20pm UTC](https://forum.kirupa.com/t/spot-the-bug-113-card-size-helper/683016 "2026-08-14T21:20:15Z")

</div>

Object bug, one line off. const card = { width: 320, height: 180 }; const { widht, height } = card; console.log(widht \* height); Reply with what is broken and how you would fix it.

---

## [Spot the bug - #114: Hover Lift Card](https://forum.kirupa.com/t/spot-the-bug-114-hover-lift-card/683023)

<div class="topic-metadata">

**Author:** [@Ellen1979](https://forum.kirupa.com/u/Ellen1979)\
**Replies:** 4\
**Last updated:** [August 14, 2026, 9:00pm UTC](https://forum.kirupa.com/t/spot-the-bug-114-hover-lift-card/683023 "2026-08-14T21:00:12Z")

</div>

Animation bug in plain sight. .card { transition: transform 200 ease; } .card:hover { transform: translateY(-4px); } Reply with what is broken and how you would fix it.

---

## [Spot the bug - #112: Card Grid](https://forum.kirupa.com/t/spot-the-bug-112-card-grid/683010)

<div class="topic-metadata">

**Author:** [@BobaMilk](https://forum.kirupa.com/u/BobaMilk)\
**Replies:** 7\
**Last updated:** [August 14, 2026, 8:40pm UTC](https://forum.kirupa.com/t/spot-the-bug-112-card-grid/683010 "2026-08-14T20:40:19Z")

</div>

My grocery list totals are off, snacks vanish somehow const groceries = \[ { item: "Apples", price: 3 }, { item: "Bread", price: 2 }, { item: "Chips", price: 4 }, { item: "Soda", price: 1 } \]; function removeChe…

---

## [✨ Archive Spotlight: Relative Urls And Absolute Urls](https://forum.kirupa.com/t/archive-spotlight-relative-urls-and-absolute-urls/683008)

<div class="topic-metadata">

**Author:** [@kirupaBot](https://forum.kirupa.com/u/kirupaBot)\
**Replies:** 1\
**Last updated:** [August 14, 2026, 6:00pm UTC](https://forum.kirupa.com/t/archive-spotlight-relative-urls-and-absolute-urls/683008 "2026-08-14T18:00:14Z")

</div>

Relative vs absolute URLs — sounds boring but it’s one of those fundamentals that trips people up constantly when they start linking between pages or deploying to different servers. Kirupa’s got a solid breakdown on why…

---

## [Coding Challenge - #4: Flatten Nested Arrays](https://forum.kirupa.com/t/coding-challenge-4-flatten-nested-arrays/682993)

<div class="topic-metadata">

**Author:** [@WaffleFries](https://forum.kirupa.com/u/WaffleFries)\
**Replies:** 6\
**Last updated:** [August 14, 2026, 2:20am UTC](https://forum.kirupa.com/t/coding-challenge-4-flatten-nested-arrays/682993 "2026-08-14T02:20:07Z")

</div>

Write a function flattenOnce(arr) that flattens an array by exactly one level, not fully recursive. For example, flattenOnce(\[1, \[2, 3\], \[4, \[5, 6\]\]\]) should return \[1, 2, 3, 4, \[5, 6\]\]. function flattenOnce(arr) { //…

---

## [JS Quiz: Medium: Object key coercion collision](https://forum.kirupa.com/t/js-quiz-medium-object-key-coercion-collision/683015)

<div class="topic-metadata">

**Author:** [@Yoshiii](https://forum.kirupa.com/u/Yoshiii)\
**Replies:** 1\
**Last updated:** [August 12, 2026, 7:00am UTC](https://forum.kirupa.com/t/js-quiz-medium-object-key-coercion-collision/683015 "2026-08-12T07:00:08Z")

</div>

What does this print? const a = {}; const b = {}; const obj = {}; obj\[a\] = 'first'; obj\[b\] = 'second'; console.log(Object.keys(obj).length, obj\[a\]); poll

---

## [Spot the bug - #111: Drag Handle](https://forum.kirupa.com/t/spot-the-bug-111-drag-handle/682995)

<div class="topic-metadata">

**Author:** [@VaultBoy](https://forum.kirupa.com/u/VaultBoy)\
**Replies:** 2\
**Last updated:** [August 10, 2026, 8:00am UTC](https://forum.kirupa.com/t/spot-the-bug-111-drag-handle/682995 "2026-08-10T08:00:16Z")

</div>

Drag handle works once then completely stops responding, help const handle = document.querySelector('.drag-handle'); const box = document.querySelector('.box'); function onDrag(e) { box.style.left = e.clientX + 'px';…

---

## [Spot the bug - #110: Todo List](https://forum.kirupa.com/t/spot-the-bug-110-todo-list/682984)

<div class="topic-metadata">

**Author:** [@sarah\_connor](https://forum.kirupa.com/u/sarah_connor)\
**Replies:** 2\
**Last updated:** [August 9, 2026, 8:00am UTC](https://forum.kirupa.com/t/spot-the-bug-110-todo-list/682984 "2026-08-09T08:00:18Z")

</div>

My todo list deletes the wrong item every single time, help const list = document.getElementById('todoList'); function addItem(text) { const li = document.createElement('li'); li.textContent = text; const remove…

---

## [Spot the bug - #109: Fade Transition](https://forum.kirupa.com/t/spot-the-bug-109-fade-transition/682972)

<div class="topic-metadata">

**Author:** [@MechaPrime](https://forum.kirupa.com/u/MechaPrime)\
**Replies:** 2\
**Last updated:** [August 8, 2026, 8:00am UTC](https://forum.kirupa.com/t/spot-the-bug-109-fade-transition/682972 "2026-08-08T08:00:13Z")

</div>

My fade-in animation just freezes halfway, any ideas? function fadeIn(el) { let opacity = 0; function step() { opacity += 0.05; el.style.opacity = opacity; if (opacity \< 1) { requestAnimationFrame(…

---

## [Coding Challenge - #3: Find Duplicate Values](https://forum.kirupa.com/t/coding-challenge-3-find-duplicate-values/682967)

<div class="topic-metadata">

**Author:** [@HariSeldon](https://forum.kirupa.com/u/HariSeldon)\
**Replies:** 6\
**Last updated:** [August 7, 2026, 11:00pm UTC](https://forum.kirupa.com/t/coding-challenge-3-find-duplicate-values/682967 "2026-08-07T23:00:17Z")

</div>

Write a function findDuplicates(arr) that returns an array of values that appear more than once in the input array, each value listed only once, in the order they first repeat. For example, findDuplicates(\[1,2,3,2,4,1\]) …

---

## [Spot the bug - #108: Traffic Light Cycle](https://forum.kirupa.com/t/spot-the-bug-108-traffic-light-cycle/682954)

<div class="topic-metadata">

**Author:** [@sora](https://forum.kirupa.com/u/sora)\
**Replies:** 5\
**Last updated:** [August 7, 2026, 8:00am UTC](https://forum.kirupa.com/t/spot-the-bug-108-traffic-light-cycle/682954 "2026-08-07T08:00:15Z")

</div>

Traffic light cycles forever but skips a color, why const lights = \['red', 'yellow', 'green'\]; let index = 0; function nextLight() { const current = lights\[index\]; console.log('Now showing:', current); switch (c…

---

## [Spot the bug: C++ edition](https://forum.kirupa.com/t/spot-the-bug-c-edition/682781)

<div class="topic-metadata">

**Author:** [@Sock](https://forum.kirupa.com/u/Sock)\
**Replies:** 6\
**Last updated:** [August 6, 2026, 5:20pm UTC](https://forum.kirupa.com/t/spot-the-bug-c-edition/682781 "2026-08-06T17:20:11Z")

</div>

level: easy

---

## [Spot the bug - #107: Settings Panel](https://forum.kirupa.com/t/spot-the-bug-107-settings-panel/682935)

<div class="topic-metadata">

**Author:** [@HariSeldon](https://forum.kirupa.com/u/HariSeldon)\
**Replies:** 2\
**Last updated:** [August 6, 2026, 8:00am UTC](https://forum.kirupa.com/t/spot-the-bug-107-settings-panel/682935 "2026-08-06T08:00:13Z")

</div>

User settings object merge feels haunted, can’t tell why const defaults = { theme: 'dark', perms: { admin: false } }; function makeUser(overrides) { const user = Object.assign({}, defaults, overrides); user.perms.ad…

---

## [Coding Challenge - #2: Debounce Click Counter](https://forum.kirupa.com/t/coding-challenge-2-debounce-click-counter/682928)

<div class="topic-metadata">

**Author:** [@VaultBoy](https://forum.kirupa.com/u/VaultBoy)\
**Replies:** 2\
**Last updated:** [August 5, 2026, 11:00pm UTC](https://forum.kirupa.com/t/coding-challenge-2-debounce-click-counter/682928 "2026-08-05T23:00:13Z")

</div>

Write a function debounce(fn, delay) that returns a new function which only calls fn after the given delay has passed since the last time the returned function was invoked. For example, if a button’s click handler is wra…

---

## [Coding Challenge - #1: Group By Length](https://forum.kirupa.com/t/coding-challenge-1-group-by-length/682927)

<div class="topic-metadata">

**Author:** [@VaultBoy](https://forum.kirupa.com/u/VaultBoy)\
**Replies:** 2\
**Last updated:** [August 5, 2026, 10:00pm UTC](https://forum.kirupa.com/t/coding-challenge-1-group-by-length/682927 "2026-08-05T22:00:13Z")

</div>

Write a function groupByLength(words) that groups an array of strings by their length, returning an object where each key is a length and each value is an array of words with that length. For example, groupByLength(\[‘a’,…

[Previous page](https://forum.kirupa.com/c/programming/41.md?page=1)

[Next page](https://forum.kirupa.com/c/programming/41.md?page=3)
