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.
The trim method needs an argument to specify how to trim ![]()
Trim’s fine actually, no args needed there. It just strips whitespace from both ends by default. The real bug is toLowercase(). Method’s actually toLowerCase() with a capital L.
:: Copyright KIRUPA 2024 //--