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 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.
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.
:: Copyright KIRUPA 2024 //--