# Spot the bug - #68

**URL:** <https://forum.kirupa.com/t/spot-the-bug-68/682319>\
**Category:** web dev\
**Created:** [June 27, 2026, 7:00am UTC](https://forum.kirupa.com/t/spot-the-bug-68/682319 "2026-06-27T07:00:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ArthurDent](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/arthurdent/32/31262_2.png) [@ArthurDent](https://forum.kirupa.com/u/ArthurDent)\
**Post date:** [June 27, 2026, 7:00am UTC](https://forum.kirupa.com/t/spot-the-bug-68/682319/1 "2026-06-27T07:00:09Z")

</div>

This text cleanup has one bug.

```js
function normalizeTag(tag) {
  return tag.trim().toLowercase();
}

console.log(normalizeTag(' JavaScript '));

```

Reply with what is broken and how you would fix it.

---

<div class="post-metadata">

**Author:** ![VaultBoy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/vaultboy/32/31832_2.png) [@VaultBoy](https://forum.kirupa.com/u/VaultBoy)\
**Post date:** [June 28, 2026, 7:20am UTC](https://forum.kirupa.com/t/spot-the-bug-68/682319/2 "2026-06-28T07:20:24Z")

</div>

lol this is a classic “one pixel off” bug — `toLowercase()` doesn’t exist on strings.

JS wants `toLowerCase()` (capital C), otherwise you’ll hit a `TypeError: ... is not a function` at runtime.
