Skip to content

[sicpjs/1.1.6] Incorrect Solutions to Exercise 1.1 (const examples) #1072

Open
@jdfm

Description

@jdfm

Both when running the example code in the inline IDE and also in the browser's console, the following expressions result in undefined being printed:

// exercise 1.1.6
const a = 3; // prints undefined

// exercise 1.1.7
const b = a + 1; // prints undefined

In the solutions, the values listed are 3 and 4 respectively. Which, given the results above, is incorrect.

The expressions that do result in 3 and 4 would be:

a = 3; // prints 3
b = a + 1; // prints 4

See attached screenshots for proof.

inline IDE results

inline-ide--1 1 6 inline-ide--1 1 7

console results

console--1 1 6-1 1 7

console corrected results

console--corrected-1 1 6-1 1 7

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions