Member-only story
25 JavaScript Tricks You Need To Know About (Part 2)

You can read about part one of 25 Javascript tricks in another article where you can find equally awesome code solution snippets to improve your codebase with and learn more about Javascript by examples.
Code Source
These are code snippets you can use in your projects and evolve to become something bigger. They teach various lessons and reveal great features of Javascript and the Environment where it runs. All code links are below the images.
Check Also:
1 — Deep value retriever
This simple function leverages the power of the Array reduce method to allow you to retrieve the deep value in deeply nested objects, array, and Javascript Map. You can access value belonging to the object itself or its prototype, like accessing a string length or getting the size of a Map.

deepValue(obj, 'top.in.list.0'); // get list 1st item
deepValue(obj, 'top.in.list.length'); // get list length
deepValue(obj, 'top.in.noExistentKey'); // returns null
2 — Date Formatter
Javascript Date is already powerful if you take time to learn it a little. Combined with the Intl object it becomes limitless. This is a small sample of a date formatter that even handles Internationalization that can be extended and modified to fulfill the needs of your project.

formatDate(Date.now(), 'MM-DD-YYYY');
// "02-06-2021"
formatDate(Date.now());
// "February 06, 2021"
formatDate(Date.now(), 'D de MMMM de YYYY', 'pt');
// "6 de fevereiro de 2021"
formatDate(Date.now(), 'MMMM DD, YYYY', 'zh');
// "二月 06, 2021"
formatDate(Date.now(), 'MMM DD (DDD), YYYY');
// "Feb 06 (Sat), 2021"