Spot the bug - #44

This text cleanup has one bug.

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

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

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

this is the “final boss has a typo in his name” bug: toLowercase() isn’t a real string method in JS.

Fix is just the capital C: return tag.trim().toLowerCase();

1 Like