Permalink
Browse files

Grammar fixes

* added missing 'one' to sentence
* removed unneccessary comma
  • Loading branch information...
dsaw committed Aug 15, 2018
1 parent f0d591b commit 8539d66c518266c9ccdb61bd73dd46bc0ec72a1e
Showing with 2 additions and 2 deletions.
  1. +2 −2 up & going/ch2.md
View
@@ -266,7 +266,7 @@ We're not going to cover all the nitty-gritty details of how the coercion in `==
To boil down a whole lot of details to a few simple takeaways, and help you know whether to use `==` or `===` in various situations, here are my simple rules:
* If either value (aka side) in a comparison could be the `true` or `false` value, avoid `==` and use `===`.
* If either value in a comparison could be of these specific values (`0`, `""`, or `[]` -- empty array), avoid `==` and use `===`.
* If either value in a comparison could be one of these specific values (`0`, `""`, or `[]` -- empty array), avoid `==` and use `===`.
* In *all* other cases, you're safe to use `==`. Not only is it safe, but in many cases it simplifies your code in a way that improves readability.
What these rules boil down to is requiring you to think critically about your code and about what kinds of values can come through variables that get compared for equality. If you can be certain about the values, and `==` is safe, use it! If you can't be certain about the values, use `===`. It's that simple.
@@ -329,7 +329,7 @@ The `==` comparison fails for a different reason. `a == b` could fail if it's in
## Variables
In JavaScript, variable names (including function names) must be valid *identifiers*. The strict and complete rules for valid characters in identifiers are a little complex when you consider nontraditional characters such as Unicode. If you only consider typical ASCII alphanumeric characters, though, the rules are simple.
In JavaScript, variable names (including function names) must be valid *identifiers*. The strict and complete rules for valid characters in identifiers are a little complex when you consider nontraditional characters such as Unicode. If you only consider typical ASCII alphanumeric characters though, the rules are simple.
An identifier must start with `a`-`z`, `A`-`Z`, `$`, or `_`. It can then contain any of those characters plus the numerals `0`-`9`.

0 comments on commit 8539d66

Please sign in to comment.