A technique you can use to get all query string parameters and push them into an object of key/value pairs.
Check if touch events are supported
Check if ‘ontouchstart’ exists in window.
Remove a Class from an Element
To remove a class from an element, you use the remove() method of the classList property of the element.
Create a one time event handler
When attaching a handler to a given event, you can pass { once: true } to the last parameter of the addEventListener method.
Get the value of a query string from a URL
Here’s a simple method you can use to get the value of a query string with native JavaScript.
Check if the given argument is a string
Use typeof to check if a value is classified as a string primitive.
Add a Class to an Element
To add a class to an element, you use the classList property of the element.
Detect Internet Explorer browser
Check if the current browser is Internet Explorer (IE).
Get all of an element’s parent elements up the DOM tree
Let’s look at how to get all parent elements of a specific element.
Check if the given number falls within the given range
Use arithmetic comparison to check if the given number is in the specified range.