This is your first lab. You need only a chat tool. No installation.
The task is the same every time: write a function that formats a date for showing to a
user.
Run all three in separate, fresh chats. If you use the same chat, the earlier answers
will sit in the context window and change the later ones. That would ruin the experiment.
Prompt A — vague
Write a function that formats a date.
Prompt B — specific
Write a JavaScript function called formatDate.
It takes a JavaScript Date object and returns a string.
The format should be day-month-year, like 03-08-2026.
Use two digits for day and month.
Prompt C — specific, with examples and edge cases
Write a JavaScript function called formatDate.
It takes a JavaScript Date object and returns a string in day-month-year format.
Examples:
new Date(2026, 7, 3) should give "03-08-2026"
new Date(2026, 11, 25) should give "25-12-2026"
Handle these cases:
- If the input is not a Date object, return an empty string.
- If the date is invalid, return an empty string.
Do not use any external library.
Record what happened
Fill this in. Writing it down is the actual lesson.
| Prompt A | Prompt B | Prompt C | |
|---|---|---|---|
| Which language did it choose? | |||
| Which date format did it choose? | |||
| Did it handle bad input? | |||
| Did it use an outside library? | |||
| Would this work in your project without changes? |
What you should notice
Prompt A did not fail. It produced working code. It just produced working code for a
question you did not ask. It chose the language, the format and the rules on your behalf,
and it chose confidently.
Every choice you leave open, the model will make for you. It will not tell you it is
choosing. It will not ask.
That is the whole reason Module 2 exists.
One more run
Do Prompt A again in a fresh chat. Compare it with your first Prompt A answer.
They will probably differ. The same vague question does not give the same answer twice.
The same precise question mostly does. Precision does not only get you a better answer. It
gets you a repeatable one.