Maxim Melnic4,176 Points
className = "" Seriously? much better to use classList!
Hi, but if for example this list have other classes?? You simply delete them or delete them first. I don't know. But it's best to remove current class.
for this we can use classList method:
Steven Parker160,020 Points
I'd agree that's a "best practice" method for general purposes. In the video, they took advantage of the fact that no other classes are being used so just making the className empty is an effective shortcut.
But you make an excellent point about using shortcuts — in real-life projects, one must be extra careful not to "cut corners" where it might impact code that may be added later in the life of the software.