JS Tips

Learn practical tips for working with JavaScript

Using JS to add div elements dynamically

Scenario:- Legacy code thrown at you with new UX design, and you cannot touch the original code. So doing latest UI changes is headache. Solution:- Play with the structure of […]

Posted in Javascript | Tagged | Leave a comment

Console.log trick for debugging

Why need see our debug messages bigger and brighter, simply use the below trick. console.log(‘%c This is my log for debugging’, ‘font-size: 40px; color: green;’); “Striving for excellence motivates you; […]

Posted in Javascript | Tagged | Leave a comment

Working with prettier in Visual studio code

“Whenever you are confronted with an opponent, conquer them with love.” What is prettier ? In layman terms its an handy tool that will format our code against some set […]

Posted in Javascript | Tagged , | Leave a comment

How to check that javascript object contains the given key?

A wet man does not fear the rain. Issue:-How do I check if an object has a key in JavaScript? Example:- // Sample Object const REMINDER = “REMIND_ME”; reminderObj= { […]

Posted in Javascript | Tagged | Leave a comment