Skip to content

Content: Add exercise addressing misconceptions around repl output #231

@Dedekind561

Description

@Dedekind561
          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 #18 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    🧠 Prep workPrep material to be completed before Saturday's sessionITPWork belongs to or is needed for ITP🎯 Topic Programming FundamentalsLearning syntax: data types, functions, loops, expressions, etc

    Type

    No type

    Projects

    Status

    🔖 Ready

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions