← Text prompts
Text & chatExplain

Explain code, execution flow and side effects

Understand what existing code accepts, returns and changes, without asking for an unnecessary rewrite.

What to provide

  • The code, its language and relevant runtime or library versions.
  • Enough surrounding context to understand referenced functions and values.
Make it yours

Fill in what you know. Empty fields stay as placeholders.

Describe your experience and how much detail you need.

Paste the code and name the language, runtime and relevant dependencies.

Optional instructions
1 input to replace

Example Illustrative example

Input

Illustrative editorial example — not a recorded model test. JavaScript: const doubled = [1, 2, 3].map(n => n * 2); Detail level: beginner.

Output

The array contains 1, 2 and 3. map calls the supplied function for each value and creates a new array from the returned values. Multiplication by 2 produces doubled = [2, 4, 6]. The expression does not perform network or file operations. This explanation assumes standard JavaScript Array.map behaviour.

Improve the result

  • List what cannot be determined from this snippet and suggest small checks to confirm its behaviour.

Reading code is not the same as executing it. Hidden dependencies, runtime state and omitted configuration can change behaviour. This example is illustrative and has not been tested in a named AI model.

Revision 1.0

How to use this prompt

Include the call site and relevant types when the snippet relies on outside values. Ask for unknown dependencies to be listed rather than guessed.

What to check in the result

Reading code is not the same as executing it. Hidden dependencies, runtime state and omitted configuration can change behaviour.