Skip to content

Comment on A Dive Into Plain JavaScript

Comments

There's a bug in the removeClass() function. If you use a class with a reserved regex character it will fail.

I'd rather see this done with a small sets library anyway. removeClass = function (el, cl) { el.className = _.without(el.className.split(' '), cl).join(' '); }

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.