CodeYourFuture / CodeYourFuture/curriculum
Content: Add exercise addressing misconceptions around repl output
- Dominant language
- HTML
- Stars
- 76
- Forks
- 135
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 20
Description
I would include a screenshot here of evaluating these two lines:
```console
> const result = console.log("hello world");
hello world
undefined
> result
undefined
> console.log(result)
undefined
undefined
```
and highlighting that the first and last evaluates result in _two_ lines of different colours, the side-effect print and the value evaluated to.
I'd maybe also go back to where we were introducing the REPL and include a similar screenshot just showing:
```console
> 5 + 10
15
```
and highlighting that `15` is the value evaluated by the expression, and maybe even reprise it here, so we have a consistent frame of reference to show the "there's an extra console.log output line" point.
I find that our trainees frequently get very confused between "what the REPL says a value evaluated to" and "what was console.log'd" because the difference is super subtle.
_Originally posted by @illicitonion in https://github.com/CodeYourFuture/curriculum/pull/18#discussion_r1248159339_
Contributor guide
Assessment
This issue has not been assessed yet.