-
-
Notifications
You must be signed in to change notification settings - Fork 135
Add example of LLM recall prompt to variables lesson #2006
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -116,3 +116,29 @@ Now it works! | |
| The first line of this block is the variable **declaration**, the second line is a **statement**. Note that we don't need to use `let` again when reassigning the variable. | ||
|
|
||
| Knowing that something won't change can make it easier to write and reason about a program. We try to declare them with `const` wherever we can. But if a variable is going to need to change, we need to use `let` to declare it. | ||
|
|
||
| ### Putting it into practice | ||
|
|
||
| You can use an LLM such as Claude or ChatGPT as an interactive tutor. For example, copy this prompt: | ||
|
|
||
| ```text | ||
| I am a {{<our-name>}} trainee learning JavaScript variables. Quiz me one question at a time about | ||
| const, let, declarations, reassignment, literals, and template literals. Use this example: | ||
|
|
||
| const name = "Alicia"; | ||
| let greeting = "Hello"; | ||
| console.log(`${greeting}, ${name}`); | ||
|
|
||
| Ask me to predict what the code prints and explain each concept. Give me hints before | ||
| revealing any answers. | ||
| ``` | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could add a brief explanation of what this prompt will do: we're telling it to make a quiz about the concept we're learning here, with a specific goal to help us learn, not just give us information |
||
| #### Sample discussion | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this just needs a bit of expansion - like here's an example of what you might see in the chat. |
||
|
|
||
| > **LLM:** What will the example print? | ||
| > | ||
| > **Learner:** `Hello, Alicia`. | ||
| > | ||
| > **LLM:** Correct. Why is `name` declared with `const`, while `greeting` uses `let`? | ||
| > | ||
| > **Learner:** `name` will not change, but `greeting` can be reassigned later. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.