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.
PS: The comment message works only for the immediate declaration after the comment line.
Thanks and don’t forget to hit the like button 😉.