Skip to content

Conversation

@odv
Copy link

@odv odv commented Apr 5, 2017

As suggested in the DISQUS comment section, the solution code doesn't follow the order of the initial task question which could make it a bit confusing for people that are just starting out so I've reordered the code lines. The discussion can be found at the bottom of this page: http://javascript.info/types

Task question:

`let name = "Ilya";

alert( hello ${1} ); // ?

alert( hello ${"name"} ); // ?

alert( hello ${name} ); // ?`

Current book solution:

`let name = "Ilya";

// the expression is a number 1
alert( hello ${1} ); // Hello, 1

// the expression is a variable, embed it
alert( hello ${name} ); // Hello, Ilya

// the expression is a string "name"
alert( hello ${"name"} ); // Hello, name`

Correct solution:

`let name = "Ilya";

// the expression is a number 1
alert( hello ${1} ); // Hello, 1

// the expression is a string "name"
alert( hello ${"name"} ); // Hello, name

// the expression is a variable, embed it
alert( hello ${name} ); // Hello, Ilya
`

@iliakan iliakan merged commit 5a1c12d into iliakan:en Apr 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants