Creating a custom message for variables and functions in my code editor

Creating a custom message for variables and functions in my code editor

So I was just playing with my code on vs code some time ago and then I discovered I could create a message of what every variable and function declared does in my code. Let’s break it down.

To create an array variable named devNames that stores the usernames of a few of the various JS developers on Twitter, I want to display a message whenever I hover on the variable 'devNames'. Then I begin by writing a comment in this form

/**
 * The below variable is an array variable and what's the essence?
 * It stores the usernames of a few of the various JS developers on Twitter
 */
const devNames = ["@hackSultan", "@sarah_edo", "@codebeast"];

Hover on the variable devNames to see a message on the editor as shown in the image below.

Screenshot from 2019-07-28 19-53-47.png

PS: The comment message works only for the immediate declaration after the comment line.

Thanks and don’t forget to hit the like button 😉.