Please open Telegram to view this post
VIEW IN TELEGRAM
⚡11👍7🏆4🤔2 1
DRY - Don't Repeat Yourself
WET - Write Everything Twice
Design patterns for developers.
🦥 @LazyFrontender
WET - Write Everything Twice
Design patterns for developers.
Please open Telegram to view this post
VIEW IN TELEGRAM
👍19😁3🔥2 1
What's the point of the second argument in element.classList.toggle?
The toggle method has an optional second argument that will force the class name to be added or removed based on the truthiness of the second argument. For example, to remove a class (if it exists or not) you can call element.classList.toggle('classToBeRemoved', false); and to add a class (if it exists or not) you can call element.classList.toggle('classToBeAdded', true);
The toggle method has an optional second argument that will force the class name to be added or removed based on the truthiness of the second argument. For example, to remove a class (if it exists or not) you can call element.classList.toggle('classToBeRemoved', false); and to add a class (if it exists or not) you can call element.classList.toggle('classToBeAdded', true);
👍9🔥7👏2❤1 1 1
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
⚡16😁3🐳2❤1 1 1