That You Need to Know
Generate Random Colors
Does your website need to generate random colors? The following line of code will do it.
Reordering the elements of an array is a very important trick, but it is not available in native Arrays.
Copy To Clipboard
Copy to clipboard is a very useful and user-friendly feature.
Scroll To Top
– The easiest way to scroll an element to the top is to use scrollIntoView.
– Set the block to
to scroll to the top.
– Set behavior to
to enable smooth scrolling.
Scroll To Bottom
Like scrolling to the top, scrolling to the bottom simply sets the block to
Use navigator.userAgent to detect which platform device the website is running on.
Get Parameters from the URL
Deep Copy Object
Deep copying of an object is very simple. First, convert the object to a string, and then convert it to an object.
I hope you like the story, if want to check the more common functions that would help you in the project.
Checkout below article link to get the detailed functions.