20 Best JavScript Snippets.
- Get current date and time.
- Check if a variable is an array.
- Merge two arrays.
- Remove duplicates from an array.
- Sort an array in ascending order.
- Reverse an array.
- Convert string to number.
- Generate a random number between two values.
- Check if a string contains a substring.
- Get the length of an object.
- Convert object to array.
- Check if an object is empty.
- Get current URL.
- Redirect to a new URL.
- Set a cookie.
- Get a cookie.
- Check if a cookie exists.
- Remove a cookie.
- Get the current viewport dimensions.
- Copy text to clipboard.
Like, Share and Subscribe #DevTools99 for more useful videos, tools info and #tutorials . Thank you!