Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
359 commits
Select commit Hold shift + click to select a range
b0c60e3
Remove possibly outdated comment
vsemozhetbyt Oct 20, 2020
ae72328
Merge pull request #2222 from vsemozhetbyt/patch-11
iliakan Oct 20, 2020
4a75ea4
Mention function declaration in 1.6.5 (global object)
vsemozhetbyt Oct 21, 2020
e8455bc
Fix a typo in 1.6.6 (function object, NFE)
vsemozhetbyt Oct 21, 2020
518daec
Fix possible typo in 1.6.7 ("new Function" syntax)
vsemozhetbyt Oct 22, 2020
ad49592
Fix typos, specify link in 1.6.8 (Scheduling)
vsemozhetbyt Oct 22, 2020
c8edd84
Merge pull request #2213 from leviding/patch-28
iliakan Oct 22, 2020
3897d24
Merge pull request #2214 from leviding/patch-29
iliakan Oct 22, 2020
a10d94d
Merge pull request #2218 from aruku/aruku-patch-1
iliakan Oct 22, 2020
bd0fbbe
Merge pull request #2219 from vsemozhetbyt/patch-9
iliakan Oct 22, 2020
7ddddd2
Merge pull request #2224 from vsemozhetbyt/patch-11
iliakan Oct 22, 2020
decb6a2
Merge pull request #2226 from vsemozhetbyt/patch-12
iliakan Oct 22, 2020
44252ad
Merge pull request #2228 from vsemozhetbyt/patch-13
iliakan Oct 22, 2020
2d5be7b
Merge pull request #2229 from vsemozhetbyt/patch-14
iliakan Oct 22, 2020
58ee49a
Update task.md
Herrera-pgoat Oct 22, 2020
567d911
Minor clarification on WeakMap and WeakSet
DawidKopys Oct 24, 2020
2e05706
Replace rules.indent array with number
mikemitchell574 Oct 24, 2020
901e5ef
Update topic sentence
mikemitchell574 Oct 25, 2020
7ee9c6a
Fix links in 1.8.4 (Prototype methods)
vsemozhetbyt Oct 25, 2020
ccfec1f
Add emphasis for clarity
mikemitchell574 Oct 25, 2020
980f487
Update article.md
plakxj Oct 27, 2020
0682ae7
Delete excess semicolon in 1.9.1 (Class basic syntax)
vsemozhetbyt Oct 27, 2020
9bf1489
Clarify task code place in 1.9.1 (Class basic syntax)
vsemozhetbyt Oct 27, 2020
9a35678
Add missing semicolons in 1.9.2 (Class inheritance)
vsemozhetbyt Oct 27, 2020
7aa2867
Include "object" in MDN link
mikemitchell574 Oct 28, 2020
98d1dc9
modify typo
Youngjin-KimY Oct 29, 2020
972c7ab
Fix possibly outdated note in 1.9.6 (instanceof)
vsemozhetbyt Oct 29, 2020
dc415a6
Merge pull request #2245 from vsemozhetbyt/patch-13
iliakan Oct 29, 2020
075e041
Merge pull request #2243 from Youngjin-KimY/patch-1
iliakan Oct 29, 2020
d1f4466
Merge pull request #2241 from mikemitchell574/patch-6
iliakan Oct 29, 2020
2a55b5b
Merge pull request #2230 from Herrera-pgoat/patch-1
iliakan Oct 29, 2020
0c760be
Update task.md
iliakan Oct 29, 2020
ca17a69
Merge pull request #2231 from Dewke/dewke-minor-fix
iliakan Oct 29, 2020
6a3835a
Merge pull request #2233 from mikemitchell574/patch-1
iliakan Oct 29, 2020
0da8037
Merge pull request #2234 from mikemitchell574/patch-3
iliakan Oct 29, 2020
4379770
Merge pull request #2235 from vsemozhetbyt/patch-9
iliakan Oct 29, 2020
879cfa0
Merge pull request #2236 from mikemitchell574/patch-4
iliakan Oct 29, 2020
1f2987d
Merge pull request #2237 from plakxj/patch-1
iliakan Oct 29, 2020
a6f101c
Merge pull request #2238 from vsemozhetbyt/patch-10
iliakan Oct 29, 2020
4741494
Merge pull request #2239 from vsemozhetbyt/patch-11
iliakan Oct 29, 2020
8c39566
Merge pull request #2240 from vsemozhetbyt/patch-12
iliakan Oct 29, 2020
f2078b1
Update article.md
iliakan Oct 29, 2020
2f822c8
Fix semicolons in 1.11.1 (Introduction: callbacks)
vsemozhetbyt Oct 30, 2020
c3979cd
Fix typo.
odsantos Oct 31, 2020
0b6cfc9
Update article.md
johnjacobkenny Oct 31, 2020
1236996
Fix a typo in 1.11.3 (Promises chaining)
vsemozhetbyt Oct 31, 2020
d5a88b6
Fix semicolons in 1.11.6 (Promisification)
vsemozhetbyt Oct 31, 2020
9a6a9fb
Update article.md
iliakan Oct 31, 2020
37c6a31
Fix semicolons, remove old note in 1.11.8
vsemozhetbyt Oct 31, 2020
58d9f75
Fix typo in 1.11.6 (Promisification)
vsemozhetbyt Nov 1, 2020
0e0f4e3
Update article.md
iliakan Nov 1, 2020
010bde1
Update article.md
iliakan Nov 1, 2020
dccca58
Update article.md
iliakan Nov 1, 2020
0bdf17e
Fix Optional chaining doc
satyambnsal Nov 1, 2020
05dfb56
Fix typo, add note in 1.12.2 (Async iteration)
vsemozhetbyt Nov 1, 2020
ec81513
Change `var` to `let` in 7.16 regexp-sticky
wam Nov 1, 2020
4e9a335
Correct comment in 1.13.1
vsemozhetbyt Nov 1, 2020
b83f2d7
Fix typos in 'Proxy and Reflect'
vsemozhetbyt Nov 4, 2020
422ef44
Fix outdated note in 1.99.04 (Reference Type)
vsemozhetbyt Nov 5, 2020
e25caae
Correct solution explanation in 1.99.04 (Reference Type)
vsemozhetbyt Nov 5, 2020
bf3c878
Fix link in 2.1.5 (Node properties...)
vsemozhetbyt Nov 5, 2020
b589f38
Merge pull request #2210 from leviding/patch-27
iliakan Nov 9, 2020
9e99c36
Merge pull request #2249 from vsemozhetbyt/patch-9
iliakan Nov 9, 2020
bd23930
Update article.md
leviding Nov 9, 2020
8f91294
Fix typos in 2.1.4 (Searching elements)
vsemozhetbyt Nov 9, 2020
a914bad
fix typo in 06-promisify article.md
ZhaoMuwei Nov 10, 2020
27f6935
Merge pull request #2250 from odsantos/fix-regexp-char-class-typo
iliakan Nov 10, 2020
fd6861e
Merge pull request #2251 from johnjacobkenny/patch-1
iliakan Nov 10, 2020
12a5cb0
Merge pull request #2252 from vsemozhetbyt/patch-10
iliakan Nov 10, 2020
ca9a022
Revert "Fix a typo in 1.11.3 (Promises chaining)"
iliakan Nov 10, 2020
032e18b
Merge pull request #2278 from javascript-tutorial/revert-2252-patch-10
iliakan Nov 10, 2020
2ff5eeb
Merge pull request #2255 from vsemozhetbyt/patch-11
iliakan Nov 10, 2020
48b111d
Merge pull request #2257 from vsemozhetbyt/1.11.8
iliakan Nov 10, 2020
96b9854
Merge pull request #2258 from vsemozhetbyt/patch-12
iliakan Nov 10, 2020
f782e9c
Merge pull request #2259 from satyambnsal/master
iliakan Nov 10, 2020
eba2280
Merge pull request #2260 from vsemozhetbyt/patch-13
iliakan Nov 10, 2020
21d44a0
Merge pull request #2261 from wam/change-var-to-let-in-regexp-sticky-…
iliakan Nov 10, 2020
e9a528f
Merge pull request #2262 from vsemozhetbyt/patch-14
iliakan Nov 10, 2020
bbe7e05
Merge pull request #2266 from vsemozhetbyt/1.99.1
iliakan Nov 10, 2020
876fded
Merge pull request #2270 from vsemozhetbyt/patch-15
iliakan Nov 10, 2020
2f4c29c
Merge pull request #2271 from vsemozhetbyt/patch-16
iliakan Nov 10, 2020
26b393a
Merge pull request #2272 from vsemozhetbyt/patch-17
iliakan Nov 10, 2020
a4194ce
look like ninja code
lumosmind Nov 10, 2020
211db88
Fix typo in 2.1.6 (Attributes and properties)
vsemozhetbyt Nov 10, 2020
59a2f34
Fix a typo in 1.11.3 (Promises chaining)
vsemozhetbyt Nov 10, 2020
7cb6387
Merge pull request #2281 from vsemozhetbyt/patch-10
iliakan Nov 11, 2020
29a7b66
Update article.md
iliakan Nov 11, 2020
fab613d
Merge pull request #2280 from vsemozhetbyt/patch-11
iliakan Nov 11, 2020
fd08e1c
Merge pull request #2279 from lumosmind/patch-53
iliakan Nov 11, 2020
22cf4b6
Merge pull request #2277 from ZhaoMuwei/patch-1
iliakan Nov 11, 2020
5607c77
Merge pull request #2276 from vsemozhetbyt/patch-18
iliakan Nov 11, 2020
5d7cba3
Merge pull request #2275 from leviding/patch-30
iliakan Nov 11, 2020
32d4f13
Merge pull request #2205 from vsemozhetbyt/patch-8
iliakan Nov 11, 2020
ad4bd59
Merge pull request #2204 from vsemozhetbyt/patch-7
iliakan Nov 11, 2020
611236f
Merge pull request #2203 from leviding/patch-25
iliakan Nov 11, 2020
331fafd
Merge pull request #2202 from leviding/patch-24
iliakan Nov 11, 2020
6df0982
FIX: minor typo error
leviding Nov 13, 2020
806e371
Update article.md
leviding Nov 13, 2020
fb43e39
Update article.md
leviding Nov 13, 2020
d977582
Update article.md
leviding Nov 13, 2020
ee2bc1c
Update article.md
leviding Nov 13, 2020
26d449c
Minor grammar alteration.
joneskj55 Nov 13, 2020
99e59ba
Update article.md
iliakan Nov 15, 2020
7a67741
Update article.md
leviding Nov 15, 2020
75e10e2
Update article.md
leviding Nov 15, 2020
cb62d6d
Update article.md
leviding Nov 15, 2020
a39f437
Update article.md
leviding Nov 15, 2020
5b63e81
Update article.md
leviding Nov 15, 2020
358c389
Update article.md
leviding Nov 15, 2020
80eb70f
Update article.md
leviding Nov 15, 2020
adf83c6
Update article.md
leviding Nov 15, 2020
9b3b10f
Update README.md
leviding Nov 16, 2020
6db57d9
Update article.md
leviding Nov 16, 2020
891495c
Promise.any
lumosmind Nov 17, 2020
15780b3
Update task.md
leviding Nov 17, 2020
a81bb4a
Fix typo in 2.2.5 (Dispatching custom events)
vsemozhetbyt Nov 17, 2020
149f63e
FIX: minor typo error, missing "alert( "
leviding Nov 18, 2020
1ba96d4
missssing
joaquinelio Nov 18, 2020
5aeb8fe
Update article.md
leviding Nov 18, 2020
ee8f6d1
Update article.md
joaquinelio Nov 18, 2020
3709b0b
Update article.md
leviding Nov 18, 2020
cd052d1
Update article.md
leviding Nov 18, 2020
0437d57
Fix typo in 2.3.3 (Moving the mouse...)
vsemozhetbyt Nov 18, 2020
5e9937a
Rephrase sentence.
odsantos Nov 18, 2020
0b401e6
Updated article.md
patrikbego Nov 19, 2020
565fef8
Include missing fileServer
manjufy Nov 19, 2020
fa4b19e
Rephrased for better clarity.
patrikbego Nov 19, 2020
1feed09
Rephrased for clarity.
patrikbego Nov 19, 2020
e289aba
Update 1-js/11-async/05-promise-api/article.md
lumosmind Nov 20, 2020
0bdacaf
Fis typo in 2.5.2 (Scripts: async, defer)
vsemozhetbyt Nov 22, 2020
2f0c37d
fixes
iliakan Nov 22, 2020
23da191
minor fixes
iliakan Nov 22, 2020
3cb134f
Merge pull request #2307 from vsemozhetbyt/patch-11
iliakan Nov 23, 2020
bd44850
fix nested markdown
joaquinelio Nov 24, 2020
1e590d6
Merge pull request #2310 from joaquinelio/patch-3
iliakan Nov 24, 2020
58136cb
Update article.md
paroche Nov 24, 2020
dcb3758
Merge pull request #2311 from javascript-tutorial/paroche-patch-20
paroche Nov 24, 2020
865c329
Further minor changes to punctuation and wording
paroche Nov 24, 2020
ac92672
And a little more
paroche Nov 24, 2020
54378cb
Correct subhead in 3.1 (Popups and window methods)
vsemozhetbyt Nov 24, 2020
246c6c4
Merge branch 'master' into patch-1
iliakan Nov 24, 2020
501adfd
Merge pull request #2187 from vsemozhetbyt/patch-1
iliakan Nov 24, 2020
c066fea
Merge pull request #2191 from vsemozhetbyt/patch-2
iliakan Nov 24, 2020
50a20d1
Merge pull request #2298 from manjufy/patch-1
iliakan Nov 24, 2020
f7b2208
Fix typo in 2.3.1 (Mouse events)
vsemozhetbyt Nov 17, 2020
b7a7e68
Fix typo in 2.99.2 (Selection and Range)
vsemozhetbyt Nov 23, 2020
a9d2363
Merge pull request #2296 from odsantos/update-strings
iliakan Nov 24, 2020
dd02130
Merge pull request #2295 from vsemozhetbyt/patch-10
iliakan Nov 24, 2020
aacdf01
Merge pull request #2192 from vsemozhetbyt/patch-3
iliakan Nov 24, 2020
7211729
Merge pull request #2193 from vsemozhetbyt/patch-4
iliakan Nov 24, 2020
445d2c8
minor fixes
iliakan Nov 24, 2020
79710c4
Update article.md
patrikbego Nov 24, 2020
50c3e3d
Merge pull request #2199 from vsemozhetbyt/patch-6
iliakan Nov 25, 2020
9700f82
Merge pull request #2283 from leviding/patch-31
iliakan Nov 25, 2020
47ca608
Update README.md
iliakan Nov 25, 2020
31d9441
Update README.md
iliakan Nov 25, 2020
865174e
Merge pull request #2285 from joneskj55/patch-1
iliakan Nov 25, 2020
b8fb9d4
Merge pull request #2300 from patrikbego/patch-1
iliakan Nov 25, 2020
a2494a7
Merge pull request #2290 from vsemozhetbyt/patch-7
iliakan Nov 25, 2020
fbe2050
Merge pull request #2291 from vsemozhetbyt/patch-8
iliakan Nov 25, 2020
ba277aa
Merge pull request #2292 from joaquinelio/patch-2
iliakan Nov 25, 2020
0e79e06
example is fixed and summary is extended
lumosmind Nov 25, 2020
5f04058
Summary section is fixed
lumosmind Nov 25, 2020
2554d3d
Merge pull request #2293 from leviding/patch-33
iliakan Nov 25, 2020
b73c2a4
typo
lumosmind Nov 25, 2020
947afdd
Merge pull request #2297 from patrikbego/patch-2
iliakan Nov 25, 2020
36c0702
Merge pull request #2309 from vsemozhetbyt/patch-11
iliakan Nov 25, 2020
b3974b3
Merge pull request #2313 from vsemozhetbyt/patch-12
iliakan Nov 25, 2020
193e174
Fix possible typos in 4.1 (ArrayBuffer, binary arrays)
vsemozhetbyt Nov 25, 2020
a0b0d43
Merge pull request #2315 from vsemozhetbyt/patch-1
iliakan Nov 25, 2020
0eef950
minor fixes
iliakan Nov 25, 2020
0ac7894
minor fixes
iliakan Nov 25, 2020
fee6657
minor fixes
iliakan Nov 25, 2020
6ec4c4f
minor fixes
iliakan Nov 25, 2020
91da65d
Fix typos in 4.3 (Blob)
vsemozhetbyt Nov 25, 2020
2793f33
Fix typo in 5.2 (FormData)
vsemozhetbyt Nov 26, 2020
ae6f990
Add missing parenthesis in 5.6 (Fetch API)
vsemozhetbyt Nov 27, 2020
b79964a
Fix typos in 5.8 (XMLHttpRequest)
vsemozhetbyt Nov 28, 2020
513d36e
Expand a note in 5.8 (XMLHttpRequest)
vsemozhetbyt Nov 28, 2020
0f0a0c5
Replace deprecated property in 5.9 (Resumable file upload)
vsemozhetbyt Nov 28, 2020
c828fe3
Fix typo in 5.11 (WebSocket)
vsemozhetbyt Nov 29, 2020
e558805
fixes #2326
iliakan Nov 29, 2020
d2ebb42
Merge pull request #2288 from lumosmind/patch-54
iliakan Nov 29, 2020
b852cfe
Update article.md
joaquinelio Nov 29, 2020
ebd774d
Update 7-animation/2-css-animations/article.md
iliakan Nov 29, 2020
00f138c
Merge pull request #2140 from peachesontour/patch-14
iliakan Nov 29, 2020
6f7d9cf
minor fixes
iliakan Nov 29, 2020
8e6ace0
Merge pull request #2325 from vsemozhetbyt/patch-7
iliakan Nov 29, 2020
59c5400
Merge pull request #2324 from vsemozhetbyt/p5.9
iliakan Nov 29, 2020
277374f
Merge pull request #2323 from vsemozhetbyt/patch-6
iliakan Nov 29, 2020
4697b7b
Merge pull request #2322 from vsemozhetbyt/patch-5
iliakan Nov 29, 2020
8b98721
Merge pull request #2321 from vsemozhetbyt/patch-4
iliakan Nov 29, 2020
d05bbe0
Merge pull request #2320 from vsemozhetbyt/patch-3
iliakan Nov 29, 2020
574dd84
closes #2319
iliakan Nov 29, 2020
361c702
Merge pull request #2316 from vsemozhetbyt/patch-2
iliakan Nov 29, 2020
9065fd3
Merge pull request #2302 from patrikbego/patch-3
iliakan Nov 29, 2020
e1a3f63
Merge pull request #2327 from joaquinelio/patch-4
iliakan Nov 29, 2020
b1bee55
Fix typo in 1.99.1 (Proxy and Reflect)
vsemozhetbyt Nov 29, 2020
34e711c
Fix typo, add info in 1.11.5 (Promise API)
vsemozhetbyt Nov 29, 2020
5aebb89
Fix typos in 1.5.8 (WeakMap and WeakSet)
vsemozhetbyt Nov 29, 2020
00d2f33
Fix typo and ambiguity in 5.12 (Server Sent Events)
vsemozhetbyt Nov 30, 2020
79f3caf
Fix for issue #2314
joneskj55 Dec 1, 2020
6abb98b
Fix possible typos in 6.1 (Cookies, document.cookie)
vsemozhetbyt Dec 1, 2020
7ffb6ce
fix typo "colector" => "collector"
FantasqueX Dec 2, 2020
fd85fc5
Fix possible typos in 6.3 (IndexedDB)
vsemozhetbyt Dec 2, 2020
21dc138
Fix typo in 7.1 (Bezier curve)
vsemozhetbyt Dec 3, 2020
0928178
Fix typo in 7.2 (CSS-animations)
vsemozhetbyt Dec 3, 2020
d4c23dc
Fix bug: Clock can't be stopped when 'Start' clicked while running
PGlivicky Dec 4, 2020
6118cc0
Add a missing bracket in the solution description
PGlivicky Dec 4, 2020
268159c
Fix typo.
odsantos Dec 4, 2020
44f4795
selection
iliakan Dec 4, 2020
e112b8b
Merge pull request #2349 from odsantos/fix-arrays-typos
iliakan Dec 5, 2020
f274f4d
Merge pull request #2347 from PGlivicky/fix-clock-setinterval-solution
iliakan Dec 5, 2020
b65c625
Merge pull request #2343 from vsemozhetbyt/patch-11
iliakan Dec 5, 2020
ff40f49
Merge pull request #2342 from vsemozhetbyt/patch-10
iliakan Dec 5, 2020
3d4a6e9
Fix typos in 7.3 (JavaScript animations)
vsemozhetbyt Dec 5, 2020
441e720
Fix typo in 6.2 (LocalStorage, sessionStorage)
vsemozhetbyt Dec 1, 2020
9fab25a
Merge pull request #2329 from vsemozhetbyt/patch-2
iliakan Dec 5, 2020
75302a6
Merge pull request #2330 from vsemozhetbyt/patch-3
iliakan Dec 5, 2020
386870d
minor fixes
iliakan Dec 5, 2020
38407b1
Merge pull request #2351 from vsemozhetbyt/7.3
iliakan Dec 5, 2020
b563d4d
Merge pull request #2331 from vsemozhetbyt/patch-4
iliakan Dec 5, 2020
528b7c5
Merge pull request #2332 from vsemozhetbyt/patch-5
iliakan Dec 5, 2020
762162f
Merge pull request #2334 from joneskj55/patch-1
iliakan Dec 5, 2020
ad1df4e
Merge pull request #2336 from vsemozhetbyt/patch-6
iliakan Dec 5, 2020
59acd01
Merge pull request #2337 from vsemozhetbyt/patch-7
iliakan Dec 5, 2020
0db83b2
Merge branch 'master' into patch-1
iliakan Dec 5, 2020
d319026
Merge pull request #2338 from FantasqueX/patch-1
iliakan Dec 5, 2020
2741d5e
Merge pull request #2340 from vsemozhetbyt/patch-8
iliakan Dec 5, 2020
5ce6ce9
minor fixes
iliakan Dec 5, 2020
6d9ab12
fixes #2333
iliakan Dec 5, 2020
75a56da
fixes #2318
iliakan Dec 5, 2020
a964025
closes #2317
iliakan Dec 5, 2020
08cc593
minor fixes
iliakan Dec 5, 2020
6daaaa2
Update article.md
iliakan Dec 5, 2020
63d0f05
closes #2244
iliakan Dec 5, 2020
ec4dcb2
closes #2353
iliakan Dec 5, 2020
0585eda
closes #2248
iliakan Dec 5, 2020
211e209
closes #2225
iliakan Dec 5, 2020
b55c226
Fix typo in 8.2 (Custom elements)
vsemozhetbyt Dec 5, 2020
e8d29cb
closes #2173
iliakan Dec 6, 2020
bb5c89a
Merge pull request #2354 from vsemozhetbyt/patch-1
iliakan Dec 6, 2020
e194ec2
Fix typo in 8.3 (Shadow DOM)
vsemozhetbyt Dec 6, 2020
433ef6d
Merge pull request #2355 from vsemozhetbyt/patch-1
iliakan Dec 6, 2020
eb81e52
Fix possible typos in 1.3.6 (Polyfills and transpilers)
vsemozhetbyt Dec 6, 2020
f30b4f2
Merge pull request #2356 from vsemozhetbyt/patch-1
iliakan Dec 6, 2020
68dfa95
minor fixes
iliakan Dec 6, 2020
59a579f
Sync examples from 2 commits in 8.5 (Shadow DOM slots...)
vsemozhetbyt Dec 6, 2020
c56e6a5
Merge pull request #2357 from vsemozhetbyt/patch-1
iliakan Dec 6, 2020
2873099
merging all conflicts
iliakan Dec 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions 1-js/01-getting-started/1-intro/article.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# An Introduction to JavaScript

Let's see what's so special about JavaScript, what we can achieve with it, and which other technologies play well with it.
Let's see what's so special about JavaScript, what we can achieve with it, and what other technologies play well with it.

## What is JavaScript?

Expand Down Expand Up @@ -110,12 +110,12 @@ Examples of such languages:
- [TypeScript](http://www.typescriptlang.org/) is concentrated on adding "strict data typing" to simplify the development and support of complex systems. It is developed by Microsoft.
- [Flow](http://flow.org/) also adds data typing, but in a different way. Developed by Facebook.
- [Dart](https://www.dartlang.org/) is a standalone language that has its own engine that runs in non-browser environments (like mobile apps), but also can be transpiled to JavaScript. Developed by Google.
- [Brython](https://brython.info/) is a Python transpiler to JavaScript that allow to write application in pure Python without JavaScript.
- [Brython](https://brython.info/) is a Python transpiler to JavaScript that enables the writing of applications in pure Python without JavaScript.

There are more. Of course, even if we use one of transpiled languages, we should also know JavaScript to really understand what we're doing.

## Summary

- JavaScript was initially created as a browser-only language, but is now used in many other environments as well.
- Today, JavaScript has a unique position as the most widely-adopted browser language with full integration with HTML/CSS.
- JavaScript was initially created as a browser-only language, but it is now used in many other environments as well.
- Today, JavaScript has a unique position as the most widely-adopted browser language with full integration in HTML/CSS.
- There are many languages that get "transpiled" to JavaScript and provide certain features. It is recommended to take a look at them, at least briefly, after mastering JavaScript.
2 changes: 1 addition & 1 deletion 1-js/01-getting-started/4-devtools/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ To see errors and get a lot of other useful information about scripts, "develope

Most developers lean towards Chrome or Firefox for development because those browsers have the best developer tools. Other browsers also provide developer tools, sometimes with special features, but are usually playing "catch-up" to Chrome or Firefox. So most developers have a "favorite" browser and switch to others if a problem is browser-specific.

Developer tools are potent; they have many features. To start, we'll learn how to open them, look at errors, and run JavaScript commands.
Developer tools are potent, they have many features. To start, we'll learn how to open them, look at errors, and run JavaScript commands.

## Google Chrome

Expand Down
2 changes: 1 addition & 1 deletion 1-js/02-first-steps/01-hello-world/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ So first, let's see how we attach a script to a webpage. For server-side environ

## The "script" tag

JavaScript programs can be inserted into any part of an HTML document with the help of the `<script>` tag.
JavaScript programs can be inserted almost anywhere into an HTML document using the `<script>` tag.

For instance:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ That's simple:
let ourPlanetName = "Earth";
```

Note, we could use a shorter name `planet`, but it might be not obvious what planet it refers to. It's nice to be more verbose. At least until the variable isNotTooLong.
Note, we could use a shorter name `planet`, but it might not be obvious what planet it refers to. It's nice to be more verbose. At least until the variable isNotTooLong.

## The name of the current visitor

Expand Down
2 changes: 1 addition & 1 deletion 1-js/02-first-steps/18-javascript-specials/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ Assignments
: There is a simple assignment: `a = b` and combined ones like `a *= 2`.

Bitwise
: Bitwise operators work with 32-bit integers at the lowest, bit-level: see the [docs](mdn:/JavaScript/Reference/Operators/Bitwise_Operators) when they are needed.
: Bitwise operators work with 32-bit integers at the lowest, bit-level: see the [docs](mdn:/JavaScript/Guide/Expressions_and_Operators#Bitwise) when they are needed.

Conditional
: The only operator with three parameters: `cond ? resultA : resultB`. If `cond` is truthy, returns `resultA`, otherwise `resultB`.
Expand Down
2 changes: 1 addition & 1 deletion 1-js/03-code-quality/02-coding-style/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ Here's an example of an `.eslintrc` file:
},
"rules": {
"no-console": 0,
"indent": ["warning", 2]
"indent": 2
}
}
```
Expand Down
90 changes: 64 additions & 26 deletions 1-js/03-code-quality/06-polyfills/article.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# Polyfills
# Polyfills and transpilers

The JavaScript language steadily evolves. New proposals to the language appear regularly, they are analyzed and, if considered worthy, are appended to the list at <https://tc39.github.io/ecma262/> and then progress to the [specification](http://www.ecma-international.org/publications/standards/Ecma-262.htm).

Expand All @@ -9,46 +9,84 @@ So it's quite common for an engine to implement only the part of the standard.

A good page to see the current state of support for language features is <https://kangax.github.io/compat-table/es6/> (it's big, we have a lot to study yet).

## Babel
As programmers, we'd like to use most recent features. The more good stuff - the better!

When we use modern features of the language, some engines may fail to support such code. Just as said, not all features are implemented everywhere.
From the other hand, how to make out modern code work on older engines that don't understand recent features yet?

Here Babel comes to the rescue.
There are two tools for that:

[Babel](https://babeljs.io) is a [transpiler](https://en.wikipedia.org/wiki/Source-to-source_compiler). It rewrites modern JavaScript code into the previous standard.
1. Transpilers.
2. Polyfills.

Actually, there are two parts in Babel:
Here, in this chapter, our purpose is to get the gist of how they work, and their place in web development.

1. First, the transpiler program, which rewrites the code. The developer runs it on their own computer. It rewrites the code into the older standard. And then the code is delivered to the website for users. Modern project build systems like [webpack](http://webpack.github.io/) provide means to run transpiler automatically on every code change, so that it's very easy to integrate into development process.
## Transpilers

2. Second, the polyfill.
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.

New language features may include new built-in functions and syntax constructs.
The transpiler rewrites the code, transforming syntax constructs into older ones. But as for new built-in functions, we need to implement them. JavaScript is a highly dynamic language, scripts may add/modify any functions, so that they behave according to the modern standard.
E.g. JavaScript before year 2020 didn't have the "nullish coalescing operator" `??`. So, if a visitor uses an outdated browser, it may fail to understand the code like `height = height ?? 100`.

A script that updates/adds new functions is called "polyfill". It "fills in" the gap and adds missing implementations.
A transpiler would analyze our code and rewrite `height ?? 100` into `(height !== undefined && height !== null) ? height : 100`.

Two interesting polyfills are:
- [core js](https://github.com/zloirock/core-js) that supports a lot, allows to include only needed features.
- [polyfill.io](http://polyfill.io) service that provides a script with polyfills, depending on the features and user's browser.
```js
// before running the transpiler
height = height ?? 100;

So, if we're going to use modern language features, a transpiler and a polyfill are necessary.
// after running the transpiler
height = (height !== undefined && height !== null) ? height : 100;
```

## Examples in the tutorial
Now the rewritten code is suitable for older JavaScript engines.

Usually, a developer runs the transpiler on their own computer, and then deploys the transpiled code to the server.

````online
Most examples are runnable at-place, like this:
Speaking of names, [Babel](https://babeljs.io) is one of the most prominent transpilers out there.

```js run
alert('Press the "Play" button in the upper-right corner to run');
```
Modern project build systems, such as [webpack](http://webpack.github.io/), provide means to run transpiler automatically on every code change, so it's very easy to integrate into development process.

## Polyfills

New language features may include not only syntax constructs and operators, but also built-in functions.

For example, `Math.trunc(n)` is a function that "cuts off" the decimal part of a number, e.g `Math.trunc(1.23) = 1`.

Examples that use modern JS will work only if your browser supports it.
````
In some (very outdated) JavaScript engines, there's no `Math.trunc`, so such code will fail.

```offline
As you're reading the offline version, in PDF examples are not runnable. In EPUB some of them can run.
As we're talking about new functions, not syntax changes, there's no need to transpile anything here. We just need to declare the missing function.

A script that updates/adds new functions is called "polyfill". It "fills in" the gap and adds missing implementations.

For this particular case, the polyfill for `Math.trunc` is a script that implements it, like this:

```js
if (!Math.trunc) { // if no such function
// implement it
Math.trunc = function(number) {
// Math.ceil and Math.floor exist even in ancient JavaScript engines
// they are covered later in the tutorial
return number < 0 ? Math.ceil(number) : Math.floor(number);
};
}
```

Google Chrome is usually the most up-to-date with language features, good to run bleeding-edge demos without any transpilers, but other modern browsers also work fine.
JavaScript is a highly dynamic language, scripts may add/modify any functions, even including built-in ones.

Two interesting libraries of polyfills are:
- [core js](https://github.com/zloirock/core-js) that supports a lot, allows to include only needed features.
- [polyfill.io](http://polyfill.io) service that provides a script with polyfills, depending on the features and user's browser.


## Summary

In this chapter we'd like to motivate you to study modern and even "bleeding-edge" langauge features, even if they aren't yet well-supported by JavaScript engines.

Just don't forget to use transpiler (if using modern syntax or operators) and polyfills (to add functions that may be missing). And they'll ensure that the code works.

For example, later when you're familiar with JavaScript, you can setup a code build system based on [webpack](http://webpack.github.io/) with [babel-loader](https://github.com/babel/babel-loader) plugin.

Good resources that show the current state of support for various features:
- <https://kangax.github.io/compat-table/es6/> - for pure JavaScript.
- <https://caniuse.com/> - for browser-related functions.

P.S. Google Chrome is usually the most up-to-date with language features, try it if a tutorial demo fails. Most tutorial demos work with any modern browser though.

4 changes: 2 additions & 2 deletions 1-js/04-object-basics/01-object/8-multiply-numeric/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ importance: 3

---

# Multiply numeric properties by 2
# Multiply numeric property values by 2

Create a function `multiplyNumeric(obj)` that multiplies all numeric properties of `obj` by `2`.
Create a function `multiplyNumeric(obj)` that multiplies all numeric property values of `obj` by `2`.

For instance:

Expand Down
24 changes: 0 additions & 24 deletions 1-js/04-object-basics/01-object/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,30 +92,6 @@ let user = {
```
That is called a "trailing" or "hanging" comma. Makes it easier to add/remove/move around properties, because all lines become alike.

````smart header="Object with const can be changed"
Please note: an object declared as `const` *can* be modified.

For instance:

```js run
const user = {
name: "John"
};

*!*
user.name = "Pete"; // (*)
*/!*

alert(user.name); // Pete
```

It might seem that the line `(*)` would cause an error, but no. The `const` fixes the value of `user`, but not its contents.

The `const` would give an error only if we try to set `user=...` as a whole.

There's another way to make constant object properties, we'll cover it later in the chapter <info:property-descriptors>.
````

## Square brackets

For multiword properties, the dot access doesn't work:
Expand Down
80 changes: 58 additions & 22 deletions 1-js/04-object-basics/02-object-copy/article.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,49 @@
# Object copying, references
# Object references and copying

One of the fundamental differences of objects vs primitives is that they are stored and copied "by reference".
One of the fundamental differences of objects versus primitives is that objects are stored and copied "by reference", whereas primitive values: strings, numbers, booleans, etc -- are always copied "as a whole value".

Primitive values: strings, numbers, booleans -- are assigned/copied "as a whole value".
That's easy to understand if we look a bit under the hood of what happens when we copy a value.

For instance:
Let's start with a primitive, such as a string.

Here we put a copy of `message` into `phrase`:

```js
let message = "Hello!";
let phrase = message;
```

As a result we have two independent variables, each one is storing the string `"Hello!"`.
As a result we have two independent variables, each one storing the string `"Hello!"`.

![](variable-copy-value.svg)

Quite an obvious result, right?

Objects are not like that.

**A variable stores not the object itself, but its "address in memory", in other words "a reference" to it.**
**A variable assigned to an object stores not the object itself, but its "address in memory" -- in other words "a reference" to it.**

Here's the picture for the object:
Let's look at an example of such a variable:

```js
let user = {
name: "John"
};
```

And here's how it's actually stored in memory:

![](variable-contains-reference.svg)

Here, the object is stored somewhere in memory. And the variable `user` has a "reference" to it.
The object is stored somewhere in memory (at the right of the picture), while the `user` variable (at the left) has a "reference" to it.

We may think of an object variable, such as `user`, as like a sheet of paper with the address of the object on it.

When we perform actions with the object, e.g. take a property `user.name`, the JavaScript engine looks at what's at that address and performs the operation on the actual object.

**When an object variable is copied -- the reference is copied, the object is not duplicated.**
Now here's why it's important.

**When an object variable is copied, the reference is copied, but the object itself is not duplicated.**

For instance:

Expand All @@ -41,11 +53,13 @@ let user = { name: "John" };
let admin = user; // copy the reference
```

Now we have two variables, each one with the reference to the same object:
Now we have two variables, each storing a reference to the same object:

![](variable-copy-reference.svg)

We can use any variable to access the object and modify its contents:
As you can see, there's still one object, but now with two variables that reference it.

We can use either variable to access the object and modify its contents:

```js run
let user = { name: 'John' };
Expand All @@ -59,15 +73,13 @@ admin.name = 'Pete'; // changed by the "admin" reference
alert(*!*user.name*/!*); // 'Pete', changes are seen from the "user" reference
```

The example above demonstrates that there is only one object. As if we had a cabinet with two keys and used one of them (`admin`) to get into it. Then, if we later use another key (`user`) we can see changes.
It's as if we had a cabinet with two keys and used one of them (`admin`) to get into it and make changes. Then, if we later use another key (`user`), we are still opening the same cabinet and can access the changed contents.

## Comparison by reference

The equality `==` and strict equality `===` operators for objects work exactly the same.

**Two objects are equal only if they are the same object.**
Two objects are equal only if they are the same object.

Here two variables reference the same object, thus they are equal:
For instance, here `a` and `b` reference the same object, thus they are equal:

```js run
let a = {};
Expand All @@ -77,7 +89,7 @@ alert( a == b ); // true, both variables reference the same object
alert( a === b ); // true
```

And here two independent objects are not equal, even though both are empty:
And here two independent objects are not equal, even though they look alike (both are empty):

```js run
let a = {};
Expand All @@ -86,15 +98,15 @@ let b = {}; // two independent objects
alert( a == b ); // false
```

For comparisons like `obj1 > obj2` or for a comparison against a primitive `obj == 5`, objects are converted to primitives. We'll study how object conversions work very soon, but to tell the truth, such comparisons occur very rarely, usually as a result of a coding mistake.
For comparisons like `obj1 > obj2` or for a comparison against a primitive `obj == 5`, objects are converted to primitives. We'll study how object conversions work very soon, but to tell the truth, such comparisons are needed very rarely -- usually they appear as a result of a programming mistake.

## Cloning and merging, Object.assign

So, copying an object variable creates one more reference to the same object.

But what if we need to duplicate an object? Create an independent copy, a clone?

That's also doable, but a little bit more difficult, because there's no built-in method for that in JavaScript. Actually, that's rarely needed. Copying by reference is good most of the time.
That's also doable, but a little bit more difficult, because there's no built-in method for that in JavaScript. But there is rarely a need -- copying by reference is good most of the time.

But if we really want that, then we need to create a new object and replicate the structure of the existing one by iterating over its properties and copying them on the primitive level.

Expand Down Expand Up @@ -213,13 +225,37 @@ user.sizes.width++; // change a property from one place
alert(clone.sizes.width); // 51, see the result from the other one
```

To fix that, we should use the cloning loop that examines each value of `user[key]` and, if it's an object, then replicate its structure as well. That is called a "deep cloning".
To fix that, we should use a cloning loop that examines each value of `user[key]` and, if it's an object, then replicate its structure as well. That is called a "deep cloning".

We can use recursion to implement it. Or, to not reinvent the wheel, take an existing implementation, for instance [_.cloneDeep(obj)](https://lodash.com/docs#cloneDeep) from the JavaScript library [lodash](https://lodash.com).

````smart header="Const objects can be modified"
An important side effect of storing objects as references is that an object declared as `const` *can* be modified.

For instance:

```js run
const user = {
name: "John"
};

*!*
user.name = "Pete"; // (*)
*/!*

alert(user.name); // Pete
```

It might seem that the line `(*)` would cause an error, but it does not. The value of `user` is constant, it must always reference the same object, but properties of that object are free to change.

In other words, the `const user` gives an error only if we try to set `user=...` as a whole.

We can use recursion to implement it. Or, not to reinvent the wheel, take an existing implementation, for instance [_.cloneDeep(obj)](https://lodash.com/docs#cloneDeep) from the JavaScript library [lodash](https://lodash.com).
That said, if we really need to make constant object properties, it's also possible, but using totally different methods. We'll mention that in the chapter <info:property-descriptors>.
````

## Summary

Objects are assigned and copied by reference. In other words, a variable stores not the "object value", but a "reference" (address in memory) for the value. So copying such a variable or passing it as a function argument copies that reference, not the object.
Objects are assigned and copied by reference. In other words, a variable stores not the "object value", but a "reference" (address in memory) for the value. So copying such a variable or passing it as a function argument copies that reference, not the object itself.

All operations via copied references (like adding/removing properties) are performed on the same single object.

Expand Down
Loading