A robust way to compare two arrays (or objects) and check if they’re equal to each other.
Use the preventDefault() method. This method works with inline attribute.
To set or get the scroll position of an element, you use the properties scrollTop and scrollLeft of the element.
Use the greater than (>) and less than (<) operators to check if date is between dateStart and dateEnd.
To get the children of an element, you use the childNodes property of the element.
This snippet produces a smooth scrolling implementation which also allows us to customize the animation effect and duration.
Utilizing this snippet, you can add a button at the bottom of page that allows user to scroll to the top quickly.
Use the Document.hidden property, introduced by the Page Visibility API to check if the browser tab of the page is visible or hidden.
This snippet gets the next sibling and previous sibling of an element, using the element.nextSibling and element. previousSibling properties.
In this snippet, look at how to get a random integer between two numbers.