Making function parameters required
Regular JavaScript has no concept of required parameters. We can use default parameter values to emulate this feature.
Read fire tipWant to create state-prefixed CSS classes that only apply on hover, focus, or other states? Repeat that same pseudo-selector at the end of your selector.
<style>
.focus\:yellow:focus {
background: yellow;
}
.hover\:orange:hover {
background: orange;
}
</style>
<button class="focus:yellow hover:orange">
Yellow on focus, orange on hover
</button>
Regular JavaScript has no concept of required parameters. We can use default parameter values to emulate this feature.
Read fire tip