JS Tips – User friendly Tech help

Learn practical tips for working with JavaScript

n

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 the html and add latest flexbox or grid CSS to make your life hell easier. How i did re-structuring was appending new parent div, which […]

n

Posted in Javascript Tagged JS

n

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; striving for perfection is demoralizing.”  

n

Posted in Javascript Tagged JS

n

“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 standards, default formatting rules to achieve consistent code style. How to install prettier  in VS Code? Search > Prettier – Code formatter Note:- Incase you have […]

n

Posted in Javascript Tagged JS, vscode

n

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= { INBOX:`${REMINDER}_INBOX`, USERS:`${REMINDER}_USERS`, GROUPS:`${REMINDER}_GROUPS`, } Problem1: Now we want to check that our object have “INBOX” as key or not? Solution:-  Object.prototype.hasOwnProperty.call(reminderObj,”INBOX”); Note:- We could directly […]

n

Posted in Javascript Tagged JS

Was this article helpful?
YesNo

Similar Posts