This post shows you a simple way to allow users to scroll by dragging the element with vanilla JavaScript.
Determine if a string contains a substring
String.indexOf() returns the index of where the substring starts in the string, or -1 if the substring isn’t found.
Finding a specific object in an array of objects
Iterating through an array of objects to find a specific one.
Toggle a class for an HTML element
toggleClass toggles a class for an HTML element.
Drag and drop element in a list
Create a sortable list whose items can be dragged and dropped inside it.
Convert a string into an array
Convert a string into an array by splitting it after a specific character (or characters).
Check if the given string contains any whitespace characters
Use RegExp.prototype.test() with an appropriate regular expression to check if the given string contains any whitespace characters.
Create an image comparison slider
Create a slider for comparing two images visually. The slider has three elements.
Replace a portion of a string with something else
The replace() method accepts two arguments: the string to find, and the string to replace it with.
The Exponent Operator
Do you useMath.pow() to raise a number to a power? Did you know you can use the exponent operator ** as well?