Skip to content

Commit f30b4f2

Browse files
authored
Merge pull request #2356 from vsemozhetbyt/patch-1
Fix possible typos in 1.3.6 (Polyfills and transpilers)
2 parents 433ef6d + eb81e52 commit f30b4f2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

1-js/03-code-quality/06-polyfills/article.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ Here, in this chapter, our purpose is to get the gist of how they work, and thei
2424

2525
A [transpiler](https://en.wikipedia.org/wiki/Source-to-source_compiler) is a special piece of software that can parse ("read and understand") modern code, and rewrite it using older syntax constructs, so that the result would be the same.
2626

27-
E.g. JavaScript before year 2020 didn't have the "nullish coalescing operator" `??`. So, if the visitor uses an outdated browser, it may fail understand the code like `height = height ?? 100`.
27+
E.g. JavaScript before year 2020 didn't have the "nullish coalescing operator" `??`. So, if the visitor uses an outdated browser, it may fail to understand the code like `height = height ?? 100`.
2828

29-
A transpiler would analyze our code and rewrite `height ?? 100` as `(height !== undefined && height !== null) ? height: 100`.
29+
A transpiler would analyze our code and rewrite `height ?? 100` as `(height !== undefined && height !== null) ? height : 100`.
3030

3131
```js
3232
// before running the transpiler
3333
height = height ?? 100;
3434

3535
// after running the transpiler
36-
height = (height !== undefined && height != null) ? height : 100;
36+
height = (height !== undefined && height !== null) ? height : 100;
3737
```
3838
3939
Now the rewritten code is suitable for older JavaScript engines.

0 commit comments

Comments
 (0)