🕸️Go to Definition
Also known as Jump to Definition, Go to Declaration, F12 (Go to Definition)
An editor command. It jumps from a name to the place where it is made.
Think of it like
It is like tapping a word in a book. You land on the page that says what it means.
Example
In Visual Studio Code, Jack puts his cursor on sendInvoice and presses F12. The editor opens billing.ts at the line that defines it.
Why it matters
It turns reading a new codebase from a hunt into a walk. One key press replaces a search.
Definition
Common mistake
Key takeaways
- 1From use to source. Jump to where it is made.
- 2Needs an index. A server or index gives the answer.
- 3Works both ways. Pair it with find all references.