JS reusable and useful bits of code