JS Docs
JS Docs are a way for us to document portions of our code to make it quicker and easier for us and others to understand. It's the information that appears in a tooltip when you hover over a variable or function.

In addition to this:
- JS Docs can be automatically turned into TypeScript types
- JS Docs can automatically generate documentation for your JS Docs documented code.
[JS Docs video]
Basics
JS Docs works by enclosing the information with opening /** and closing */ tags. That information is then displayed in a tooltip when hovering over a function or variable.
In this example, we have a function that adds two numbers. We add a basic description between the /** and */ tags. We can then see a tooltip containing this description when hovering over the function call.
/** Adds two numbers together and returns the results */function addNumbers(a, b) { return a + b;}
Exercises
Exercise 1:
Additional resources
Lesson Complete!
Great job! You've finished this lesson. Ready to continue?