curriculum icon indicating copy to clipboard operation
curriculum copied to clipboard

Content: Add exercise addressing misconceptions around repl output

Open Dedekind561 opened this issue 2 years ago • 2 comments

          I would include a screenshot here of evaluating these two lines:
> 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:

> 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

Dedekind561 avatar Aug 07 '23 16:08 Dedekind561

I'm going to record a quick video on this for milestone clearance as it's had no movement. Anything extra will also be welcome.

SallyMcGrath avatar Dec 30 '24 13:12 SallyMcGrath

@SallyMcGrath has recorded a video, but needs to tweak it - will do it tomorrow.

40thieves avatar Jan 14 '25 18:01 40thieves