Use typeof to check if a value is classified as a string primitive.
Check if the current browser is Internet Explorer (IE).
Use arithmetic comparison to check if the given number is in the specified range.
A simplified approach using some ES6 methods.
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.
This snippet gets the next sibling and previous sibling of an element, using the element.nextSibling and element. previousSibling properties.
This snippet can be used to validate a file’s size and display it, for instance when a file is being submitted for upload.
This snippet gets the height of an iframe’s content and then sets the height of the iframe to match.