Learn practical tips for working with JavaScript

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

Posted in Tools | 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= { 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 […]

Posted in Javascript Tips | Tagged | Leave a comment

How to solve the issue with Resize of TextArea in IE using JQUERY?

Requirement:- We need our TextArea should be flexible to be re-sized by user in Internet Explorer?Solution:-We followed the approach of JQuery to solve the problem.Method:-Resizable Working DemoCode:-CSS:- CSS part HTML:- HTML Code JavaScript:- JavaScript Result:- Resize the TextArea Note:–We can apply the above code on other HTML elements also like DIV.-We can also write the Directive in Angular to […]

Posted in Resize TextArea in IE | Tagged | 2 Comments