Files
JavaScript-from-Beginner-to…/errata.md
T
2022-01-03 17:57:58 +05:30

28 lines
1.0 KiB
Markdown

# Errata, Corrections and Improvements
----------------------------------------------------
If you find any mistakes in the second edition of JavaScript from Beginner to Professional, or if you have suggestions for improvements, then please [raise an issue in this repository](https://github.com/PacktPublishing/JavaScript-from-Beginner-to-Professional/issues), or email to us.
## Chapter 04, Page 2 - Fixing the equals syntax in an `if` statement
The example of an `if` statement here explains how a single `=` sign is true. It should be `if(hobby = "coding")`
Incorrect code is:
```
if(hobby == "coding"){
console.log("** I love coding too! **");
} else {
console.log("** Can you teach me that? **");
}
```
Correct code is:
```
if(hobby = "coding"){
console.log("** I love coding too! **");
} else {
console.log("** Can you teach me that? **");
}
```
## Chapter 14, Page 379 - Replaced `Exercise 14.4` with correct solution, and the same is in the Appendix of the book on page #492
Solution for Exercise 14.4 is now fixed.