Ask HN: What are some useful little js methods?
Actual little bits of js you've written/used over the years to do useful things. Example: convert an rgb color to hex equivalent. Not looking for libraries. Just ideas of little helper methods we've written or utilized time and again.