Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
289 commits
Select commit Hold shift + click to select a range
1310d54
fix typo
KennethKinLum Oct 23, 2021
4c2658d
Fixed a grammatical error
zaibugemi Oct 24, 2021
6250c91
Merge pull request #1 from zaibugemi/zaibugemi-patch-1
zaibugemi Oct 24, 2021
3699f73
async-await on top
iliakan Oct 25, 2021
277fbd2
Merge pull request #2762 from zaibugemi/master
iliakan Oct 25, 2021
2a5c881
minor fixes
iliakan Oct 25, 2021
e95cab9
Merge pull request #2741 from joneskj55/patch-1
iliakan Oct 25, 2021
51be747
Merge pull request #2744 from LexaWin/patch-1
iliakan Oct 25, 2021
aed8070
Merge pull request #2750 from Jiapan-Yu/master
iliakan Oct 25, 2021
20da240
Merge pull request #2751 from mahdiHashemi14/master
iliakan Oct 25, 2021
3c62ecc
Merge pull request #2753 from vigu86/patch-1
iliakan Oct 25, 2021
676319d
Merge pull request #2755 from dneey/patch-2
iliakan Oct 25, 2021
3efe4cf
Merge pull request #2759 from KennethKinLum/patch-14
iliakan Oct 25, 2021
9dc5f3e
minor fixes
iliakan Oct 25, 2021
91e9b9c
minor fixes
iliakan Oct 25, 2021
6be354d
minor fixes
iliakan Oct 25, 2021
2ac7526
minor fixes
iliakan Oct 25, 2021
8308537
closes #2757
iliakan Oct 25, 2021
6989312
closes #2752
iliakan Oct 25, 2021
f9f77a1
Highlighting opening braces for IIFEs
VamsiDevalla Oct 30, 2021
cc18823
minor fixes
iliakan Nov 1, 2021
be69f34
minor fixes
iliakan Nov 1, 2021
9fcffe1
minor fixes
iliakan Nov 1, 2021
15f7acf
minor fixes
iliakan Nov 1, 2021
f8782ac
Update article.md
itaileshem Nov 2, 2021
e431006
Update article.md
itaileshem Nov 2, 2021
d4ee188
Update article.md
itaileshem Nov 2, 2021
e4c5707
Update article.md
itaileshem Nov 2, 2021
4541b7a
minor fixes
iliakan Nov 3, 2021
a829155
minor fixes
iliakan Nov 12, 2021
3d9f1c9
Update script.js
LexaWin Nov 15, 2021
83d2003
added showStep method to our chain in the task
Tofpu Nov 16, 2021
690c223
added showStep to our chain in the solution
Tofpu Nov 16, 2021
caf1a65
fix the broken RFC link
Dec 2, 2021
762d0e5
Added reference link to mdn docs for Object.keys(user)
akxavier Dec 6, 2021
c574391
Update article.md
yangsong97 Dec 11, 2021
64da7ff
minor fixes
iliakan Dec 12, 2021
df72ada
Merge pull request #2789 from yangsong97/patch-1
iliakan Dec 12, 2021
153fd11
Merge pull request #2783 from akxavier/master
iliakan Dec 12, 2021
a521d20
minor fixes
iliakan Dec 12, 2021
3a34345
Merge pull request #2767 from VamsiDevalla/patch-1
iliakan Dec 12, 2021
fe63de8
Merge pull request #2776 from LexaWin/patch-2
iliakan Dec 12, 2021
747fc37
Merge pull request #2771 from itaileshem/fix-typo
iliakan Dec 12, 2021
2d80f86
Merge pull request #2770 from itaileshem/master
iliakan Dec 12, 2021
e6512a3
Merge pull request #2781 from chanjsq/patch-1
iliakan Dec 12, 2021
c5358c5
themable pictures
iliakan Dec 12, 2021
cf2ce5e
Type: touch-events should be touch-action
justforuse Dec 13, 2021
7e575de
Merge pull request #2792 from justforuse/patch-1
iliakan Dec 13, 2021
cbdb218
Merge pull request #2777 from Tofpu/missing-showstep-patch
iliakan Dec 13, 2021
92a8a40
addition-of-third-header-in-list
Manik2375 Dec 13, 2021
353c87d
typo
Manik2375 Dec 13, 2021
974073b
typeof
iliakan Dec 13, 2021
9a42577
minor fixes
iliakan Dec 13, 2021
b0e46f4
minor fixes
iliakan Dec 13, 2021
80148c0
minor fixes
iliakan Dec 13, 2021
233d63c
minor fixes
iliakan Dec 13, 2021
4bd4a74
minor fixes
iliakan Dec 13, 2021
98d590b
minor fixes
iliakan Dec 13, 2021
8d04d0d
minor fixes
iliakan Dec 13, 2021
e7c5d13
typo
joaquinelio Dec 13, 2021
dc6be3a
Update article.md
joaquinelio Dec 13, 2021
e715c5a
transl: easier to change where mdn: dsnt work
joaquinelio Dec 14, 2021
6fe40fc
Changed a word in article.md
yasledesma Dec 15, 2021
e9e06a5
Fix: Rewrite sentence in line 121
yasledesma Dec 16, 2021
8536bca
fix the broken RFC link in the JSON article
tburette Dec 20, 2021
53488ee
Replace 'mdn' link
odsantos Dec 20, 2021
1ee53e6
Merge pull request #2802 from odsantos/inheritance-fix-link
iliakan Dec 21, 2021
05336f1
Merge pull request #2794 from Manik2375/master
iliakan Dec 21, 2021
96bd8cf
Merge pull request #2795 from joaquinelio/patch-5
iliakan Dec 21, 2021
affee18
Merge pull request #2796 from joaquinelio/patch-8
iliakan Dec 21, 2021
ad70374
Merge pull request #2798 from HiddenOgre28/patch-1
iliakan Dec 21, 2021
3ee59f0
Merge pull request #2801 from tburette/master
iliakan Dec 21, 2021
25d51b1
Merge pull request #2800 from HiddenOgre28/patch-2
iliakan Dec 21, 2021
199e412
Fix sentence
tathienphuoc Dec 21, 2021
ad0df99
Update article.md
joaquinelio Dec 24, 2021
0cd40ae
Merge pull request #2564 from joaquinelio/patch-10
iliakan Dec 24, 2021
3c934b5
minor fixes
Dec 24, 2021
180cb44
Update article.md
rankanin Jan 3, 2022
3cf2212
Update article.md
kk-source Jan 7, 2022
ecbb2b8
redundant
joaquinelio Jan 8, 2022
3aaa6fc
foolproof
joaquinelio Jan 9, 2022
246c600
Merge pull request #2819 from joaquinelio/patch-12
iliakan Jan 9, 2022
435265e
Update article.md
joaquinelio Jan 9, 2022
de83e74
Update article.md
NickFallman Jan 10, 2022
610fb93
Merge pull request #2820 from NickFallman/patch-1
iliakan Jan 10, 2022
a960e3e
Added 'the' to first sentence
chrisbarbas Jan 13, 2022
cc74ccc
Update article.md
bookchiq Jan 13, 2022
421bbe5
Update article.md
11201010 Jan 15, 2022
ffcd381
Merge pull request #2803 from tathienphuoc/master
iliakan Jan 16, 2022
a6fdfda
Merge pull request #2828 from 11201010/master
iliakan Jan 16, 2022
e7b524c
Merge pull request #2825 from bookchiq/master
iliakan Jan 21, 2022
00237ef
Merge pull request #2824 from chrisbarbas/patch-1
iliakan Jan 21, 2022
eb23b2d
Merge pull request #2814 from kk-source/patch-1
iliakan Jan 21, 2022
d512818
minor fixes
iliakan Jan 21, 2022
62b3b9a
Update article.md
joaquinelio Jan 21, 2022
8b1d32d
added missing "the"
ArSn Jan 21, 2022
bd0921b
Merge pull request #2833 from ArSn/ArSn-add-the-1
iliakan Jan 21, 2022
34ab022
minor fixes
iliakan Jan 21, 2022
d7f7998
Merge pull request #2816 from joaquinelio/patch-9
iliakan Jan 21, 2022
d5f1b4a
Merge pull request #2810 from lankerened/master
iliakan Jan 21, 2022
36788a5
Merge pull request #2758 from KennethKinLum/patch-13
iliakan Jan 21, 2022
1dc6dfb
Merge pull request #2614 from jonathanlu31/patch-1
iliakan Jan 21, 2022
674a9a4
Correction to precedence levels
erolaliyev Jan 22, 2022
82e5d13
fix:Add missing test #2826 & fix related solution
Omid-Heydarzadeh Jan 22, 2022
025f588
Merge pull request #2837 from Omid-Heidarzadeh/bugfix-2826-add-missin…
iliakan Jan 22, 2022
bae0ef4
Merge pull request #2836 from erolaliyev/patch-1
iliakan Jan 24, 2022
804b6b0
fix formatting, change wording for clarity
robertmcabee Jan 24, 2022
779aad7
fixes operator precedence
ruslauz Jan 25, 2022
5d832d9
Fixes localStorage spec link
ruslauz Jan 25, 2022
824bc96
Include "us" in article sentence
Jan 26, 2022
69cd457
minor fix
Omid-Heydarzadeh Jan 28, 2022
639229e
Updated unary operator precedence explanation
jovton Jan 28, 2022
041bbb2
Update article.md
ruslauz Jan 28, 2022
0f74827
minor fixes
iliakan Jan 29, 2022
dd3c7a4
doc-fix: Modified a misplaced comma
Sen-442b Jan 29, 2022
a678674
images
iliakan Feb 3, 2022
9fce97b
minor fixes
iliakan Feb 3, 2022
31d2b33
Merge pull request #2838 from robertmcabee/master
iliakan Feb 3, 2022
e9caaab
Merge pull request #2847 from Sen-442b/patch-1
iliakan Feb 3, 2022
3ce3f3d
Merge pull request #2846 from jovton/master
iliakan Feb 3, 2022
cf49dd9
Merge pull request #2845 from Omid-Heidarzadeh/minorfix
iliakan Feb 3, 2022
d92b1a0
Merge pull request #2841 from justinpage/update-constructor-new-article
iliakan Feb 3, 2022
00bfa6d
Merge pull request #2840 from ruslauz/fix/local-storage-spec-link
iliakan Feb 3, 2022
ab0f35b
Merge branch 'master' into fix/operator-precedence
iliakan Feb 3, 2022
843f945
Merge pull request #2839 from ruslauz/fix/operator-precedence
iliakan Feb 3, 2022
9c74908
minor fixes
iliakan Feb 3, 2022
fc7bfbb
Update article.md
leviding Feb 4, 2022
e1be207
Update article.md
rankanin Feb 4, 2022
4db69b4
minor fixes
iliakan Feb 4, 2022
1f92729
minor fixes
iliakan Feb 4, 2022
f2e4db7
minor fixes
iliakan Feb 4, 2022
fb07094
Update blob article.md
buynao Feb 5, 2022
7647ab9
minor fixes
iliakan Feb 6, 2022
533d54d
Merge pull request #2853 from leviding/patch-39
iliakan Feb 6, 2022
d159503
Merge pull request #2854 from lankerened/patch-1
iliakan Feb 6, 2022
c9063dc
Merge pull request #2857 from buynao/master
iliakan Feb 6, 2022
9a2981c
minor fixes
iliakan Feb 6, 2022
f95671c
minor fixes
iliakan Feb 6, 2022
71da17e
minor fixes
iliakan Feb 6, 2022
8d7a9dd
update webpack url
Feb 6, 2022
5315ba5
docs: minor grammar fix and link update
huyenltnguyen Feb 7, 2022
9628391
Update article.md
leviding Feb 7, 2022
1e1f04f
Merge pull request #2864 from leviding/patch-40
iliakan Feb 7, 2022
bf7eb93
GB unit symbol
joaquinelio Feb 7, 2022
d7c8c75
Merge pull request #2866 from joaquinelio/patch-9
iliakan Feb 8, 2022
efbe490
Add mention of radio buttons
vabushkevich Feb 9, 2022
d5cce94
[Fix] Convert message from Buffer to String
umakantv Feb 10, 2022
2921673
minor fixes
iliakan Feb 12, 2022
c68cb11
Update test.js
skaunov Feb 15, 2022
79a1b92
Update article.md
leviding Feb 16, 2022
6eba062
Merge pull request #2872 from umakantv/patch-1
iliakan Feb 17, 2022
883bd60
Merge pull request #2881 from leviding/patch-42
iliakan Feb 18, 2022
d3bfbe3
Merge pull request #2880 from skaunov/patch-1
iliakan Feb 18, 2022
54bc577
Merge pull request #2868 from vabushkevich/patch-1
iliakan Feb 18, 2022
39da5f8
Merge pull request #2862 from huyenltnguyen/docs/link
iliakan Feb 18, 2022
e2f9e58
Merge pull request #2861 from marahmanjs/patch-1
iliakan Feb 18, 2022
16ace5a
Fix LI content numbers
Vitruvius21 Feb 18, 2022
e1db5dc
Missed exclamation mark
Rnbsov Feb 20, 2022
bb41c39
Merge pull request #2883 from Vitruvius21/patch-1
iliakan Feb 21, 2022
2cca9a9
Merge pull request #2885 from Rnbsov/patch-2
iliakan Feb 21, 2022
bfffb32
Update task.md
QiyanYu Feb 24, 2022
74563ba
added a link to wikipedia
Rnbsov Feb 24, 2022
22c30fe
mdn link
joaquinelio Feb 26, 2022
8e48598
added a possibly missing exclamation mark
Rnbsov Feb 28, 2022
21d5bc7
fix: replace `form/multipart` with `multipart/form-data`
vabushkevich Mar 4, 2022
3a98822
Perhaps it would be more correct
Rnbsov Mar 6, 2022
fbe6e30
missing a dot
Rnbsov Mar 6, 2022
d8ba31d
Delete ; after function declaration
Rnbsov Mar 11, 2022
da9c76f
add missed ;
Rnbsov Mar 11, 2022
11e8294
Update article.md
joaquinelio Mar 13, 2022
ae0a73f
Bugfix:binary-arrays/concat/solution
Omid-Heydarzadeh Mar 15, 2022
fe23339
Update article.md
guneethind Mar 17, 2022
6eff54a
Update article.md
apoorvachikara Mar 20, 2022
f613e03
Maybe it should be marked as code
Rnbsov Mar 21, 2022
bf6d3c9
minor fixes
iliakan Mar 22, 2022
6e51574
Fixed the display on the site
Rnbsov Mar 22, 2022
39aca70
fix missed line breaks
Rnbsov Mar 22, 2022
9e210b7
minor fixes
iliakan Mar 24, 2022
bf510dc
minor fixes
iliakan Mar 24, 2022
6d29218
minor fixes
iliakan Mar 24, 2022
7ae1e57
minor fixes
iliakan Mar 24, 2022
f3aeacc
minor fixes
iliakan Mar 24, 2022
7809168
minor fixes
iliakan Mar 24, 2022
d07d5df
minor fixes
iliakan Mar 24, 2022
6edb240
minor fixes
iliakan Mar 24, 2022
741d90c
minor fixes
iliakan Mar 25, 2022
ed6bf65
fix units
Rnbsov Mar 28, 2022
413def7
fix typo in the summary section
gnopor Mar 29, 2022
4585dbb
minor fixes
iliakan Mar 30, 2022
f89bbc0
minor fixes
iliakan Mar 30, 2022
72e958b
minor fixes
iliakan Mar 30, 2022
de4f81e
Update optional-chaining/article.md
glebmikulko Mar 30, 2022
63ca152
clientTop image
iliakan Mar 30, 2022
b1607f5
typo
joaquinelio Mar 31, 2022
45934de
Merge pull request #2938 from joaquinelio/patch-10
iliakan Mar 31, 2022
e1b3dfa
minor fixes
iliakan Apr 6, 2022
ac7daa5
minor fixes
iliakan Apr 6, 2022
cb2d511
Docs: minor grammer fix
sanketshah19 Apr 9, 2022
10fd8be
add comma
Rnbsov Apr 10, 2022
de9fcf8
just add comma
Rnbsov Apr 11, 2022
2c8e9e2
fix bitwise hyperlink to mdn
pzolo85 Apr 12, 2022
6af9a2e
Correct mis-use of "it's"
fredden Apr 13, 2022
6b5749b
closes #2951
iliakan Apr 14, 2022
0cda49b
Merge pull request #2909 from Rnbsov/patch-10
iliakan Apr 14, 2022
58ef96a
Merge pull request #2950 from fredden/its
iliakan Apr 14, 2022
61f79f4
at method
iliakan Apr 14, 2022
2f194b2
Merge pull request #2947 from pzolo85/patch-1
iliakan Apr 14, 2022
78d5a1b
Merge pull request #2945 from Rnbsov/patch-24
iliakan Apr 14, 2022
a3273fb
Merge pull request #2942 from Rnbsov/patch-22
iliakan Apr 14, 2022
68dea68
Merge pull request #2913 from Rnbsov/patch-12
iliakan Apr 14, 2022
85d07ab
Merge pull request #2914 from Rnbsov/patch-13
iliakan Apr 14, 2022
ddb2b10
Merge pull request #2917 from Omid-Heidarzadeh/bugfix
iliakan Apr 14, 2022
bb0e360
Merge pull request #2922 from guneethind/patch-1
iliakan Apr 14, 2022
1d22a35
Merge pull request #2926 from apoorvachikara/master
iliakan Apr 14, 2022
613e921
closes #2910
iliakan Apr 14, 2022
246156d
minor fixes
iliakan Apr 14, 2022
ed664f8
minor fixes
iliakan Apr 14, 2022
3c5cc8e
Merge pull request #2929 from Rnbsov/patch-18
iliakan Apr 14, 2022
a5e34ba
Merge pull request #2930 from Rnbsov/patch-21
iliakan Apr 14, 2022
aac4d48
Merge pull request #2933 from Rnbsov/patch-19
iliakan Apr 14, 2022
ff2bbc8
Merge pull request #2935 from gnopor/patch-1
iliakan Apr 14, 2022
094b15b
Merge pull request #2936 from glebmikulko/patch-4
iliakan Apr 14, 2022
c49b104
closes #2937
iliakan Apr 14, 2022
319f77d
Merge pull request #2941 from sanketshah19/master
iliakan Apr 14, 2022
d41fcbf
minor fixes
iliakan Apr 14, 2022
8831603
minor fixes
iliakan Apr 14, 2022
7959adf
minor fixes
iliakan Apr 14, 2022
ed8e41a
Merge pull request #2908 from Rnbsov/patch-9
iliakan Apr 14, 2022
06b8b1d
Merge pull request #2906 from vabushkevich/form-multipart-fix
iliakan Apr 14, 2022
98b840e
minor fixes
iliakan Apr 14, 2022
603170b
Merge pull request #2899 from Rnbsov/patch-8
iliakan Apr 14, 2022
7826e83
Merge pull request #2897 from joaquinelio/patch-9
iliakan Apr 14, 2022
2c44dfb
minor fixes
iliakan Apr 14, 2022
cd4a72f
Merge pull request #2892 from Rnbsov/patch-5
iliakan Apr 14, 2022
837fbba
Merge pull request #2891 from QiyanYu/patch-1
iliakan Apr 14, 2022
6bf135a
closes #2931
iliakan Apr 15, 2022
0305a0b
minor fixes
iliakan Apr 15, 2022
7dc2a3c
minor fixes
iliakan Apr 15, 2022
afbd71d
minor fixes
iliakan Apr 15, 2022
4695216
minor fixes
iliakan Apr 15, 2022
9b95054
minor fixes
iliakan Apr 15, 2022
344c36f
minor fixes
iliakan Apr 15, 2022
c37c564
minor fixes
iliakan Apr 15, 2022
df822da
minor fixes
iliakan Apr 15, 2022
f7266b1
closes #2952
iliakan Apr 15, 2022
75f5b8a
minor fixes
iliakan Apr 15, 2022
c714756
minor fixes
iliakan Apr 15, 2022
291b5c0
minor fixes
iliakan Apr 16, 2022
06f3a41
merging all conflicts
iliakan Apr 18, 2022
4100907
Merge branch 'master' into sync-291b5c05
niemenjoki Apr 19, 2022
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
Expand Up @@ -24,11 +24,11 @@ Selaimeen on upotettu moottori, jota kutsutaan joskus "JavaScript-virtuaalikonee

Eri moottoreilla on omia kutsumanimiä. Esimerkiksi:

- [V8](https://fi.wikipedia.org/wiki/V8_(JavaScript-moottori)) -- Chromessa ja Operassa.
- [V8](https://fi.wikipedia.org/wiki/V8_(JavaScript-moottori)) -- Chromessa, Operassa ja Edgessä.
- [SpiderMonkey](https://en.wikipedia.org/wiki/SpiderMonkey) -- Firefoxissa.
- ...Lisäksi on muitakin kutsumanimiä kuten "Chakra" IE:lle, "JavaScriptCore", "Nitro" ja "SquirrelFish" Safarille, jne.

Yllä luetellut termit on hyvä muistaa, koska niitä käytetään internetin sovelluskehitykseen liittyvissä artikkeleissa. Me tulemme myös käyttämään niitä. Jos esimerkiksi "V8 tukee toimintoa X", se todennäköisesti toimii Chromessa ja Operassa.
Yllä luetellut termit on hyvä muistaa, koska niitä käytetään internetin sovelluskehitykseen liittyvissä artikkeleissa. Me tulemme myös käyttämään niitä. Jos esimerkiksi "V8 tukee toimintoa X", se todennäköisesti toimii Chromessa, Operassa ja Edgessä.

```smart header="Miten moottorit toimivat?"

Expand Down Expand Up @@ -59,7 +59,7 @@ Selaimessa JavaScript voi esimerkiksi:

## Mitä JavaScript EI VOI tehdä selaimessa?

JavaScriptin kyvyt selaimessa on rajoitettu käyttäjän turvallisuuden vuoksi. Tavoitteena on estää pahaa nettisivua pääsemästä käsiksi yksityisiin tietoihin tai vahingoittamasta käyttäjän tietoja.
JavaScriptin kykyjä selaimessa on rajoitettu käyttäjän turvallisuuden vuoksi. Tavoitteena on estää pahaa nettisivua pääsemästä käsiksi yksityisiin tietoihin tai vahingoittamasta käyttäjän tietoja.

Esimerkkejä tällaisista rajoituksista ovat:

Expand Down Expand Up @@ -117,6 +117,6 @@ Lisääkin esimerkkejä löytyy. Silti, vaikka käytämme jotain muunnettavaa ki

## Yhteenveto

- JavaScript suunniteltiin alunperin vain selaimeen, mutta sitä käytetään nykyisin myös monissa muissa ympäristöissä.
- JavaScript suunniteltiin alunperin vain selaimessa käytettäväksi kieleksi, mutta sitä käytetään nykyisin myös monissa muissa ympäristöissä.
- JavaScriptillä on nykyisin uniikki asema laajimmin käytettynä selainkielenä, joka integroituu täysin HTML:ään ja CSS:ään.
- Monet JavaScriptiksi "muunnettavat" kielet tuovat mukanaan tiettyjä toimintoja. On suositeltavaa tutustua niihin, ainakin lyhyesti, kun JavaScript on hallussa.
7 changes: 7 additions & 0 deletions 1-js/01-getting-started/3-code-editors/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,18 @@ Käytännössä kevyihin editoreihin voi olla saatavilla monia lisäosia mukaan

Seuraavat vaihtoehdot ansaitsevat huomiosi:

<<<<<<< HEAD
- [Atom](https://atom.io/) (järjestelmäriippumaton, ilmainen).
- [Visual Studio Code](https://code.visualstudio.com/) (järjestelmäriippumaton, ilmainen).
- [Sublime Text](http://www.sublimetext.com) (järjestelmäriippumaton, shareware).
- [Notepad++](https://notepad-plus-plus.org/) (Windows, ilmainen).
- [Vim](http://www.vim.org/) ja [Emacs](https://www.gnu.org/software/emacs/) ovat myös siistejä, jos tiedät, miten niitä käytetään.
=======
- [Atom](https://atom.io/) (cross-platform, free).
- [Sublime Text](http://www.sublimetext.com) (cross-platform, shareware).
- [Notepad++](https://notepad-plus-plus.org/) (Windows, free).
- [Vim](http://www.vim.org/) and [Emacs](https://www.gnu.org/software/emacs/) are also cool if you know how to use them.
>>>>>>> 291b5c05b99452cf8a0d32bd32426926dbcc0ce0

## Ei riidellä

Expand Down
4 changes: 4 additions & 0 deletions 1-js/02-first-steps/01-hello-world/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ Skriptitiedostot liitetään HTML:ään `src` (suom. lähde) attribuutilla:
<script src="/polku/tiedostoon/script.js"></script>
```

<<<<<<< HEAD
Yllä, `/polku/tiedostoon/script.js` tarkoittaa absoluuttista tiedostopolkua skriptiin sivuston juuresta (root). Polun voi kirjoittaa myös nykyisen sivun suhteen. Esimerkiksi `src="script.js"` tarkoittaisi tiedostoa nimeltä `"script.js"` nykyisessä kansiossa.
=======
Here, `/path/to/script.js` is an absolute path to the script from the site root. One can also provide a relative path from the current page. For instance, `src="script.js"`, just like `src="./script.js"`, would mean a file `"script.js"` in the current folder.
>>>>>>> 291b5c05b99452cf8a0d32bd32426926dbcc0ce0

Voimme kirjoittaa myös koko URL-osoitteen. Esimerkiksi:

Expand Down
31 changes: 18 additions & 13 deletions 1-js/02-first-steps/05-types/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,15 @@ Besides regular numbers, there are so-called "special numeric values" which also
alert( "not a number" / 2 ); // NaN, such division is erroneous
```

`NaN` is sticky. Any further operation on `NaN` returns `NaN`:
`NaN` is sticky. Any further mathematical operation on `NaN` returns `NaN`:

```js run
alert( "not a number" / 2 + 5 ); // NaN
alert( NaN + 1 ); // NaN
alert( 3 * NaN ); // NaN
alert( "not a number" / 2 - 1 ); // NaN
```

So, if there's a `NaN` somewhere in a mathematical expression, it propagates to the whole result.
So, if there's a `NaN` somewhere in a mathematical expression, it propagates to the whole result (there's only one exception to that: `NaN ** 0` is `1`).

```smart header="Mathematical operations are safe"
Doing maths is "safe" in JavaScript. We can do anything: divide by zero, treat non-numeric strings as numbers, etc.
Expand Down Expand Up @@ -213,14 +215,7 @@ The `symbol` type is used to create unique identifiers for objects. We have to m

The `typeof` operator returns the type of the argument. It's useful when we want to process values of different types differently or just want to do a quick check.

It supports two forms of syntax:

1. As an operator: `typeof x`.
2. As a function: `typeof(x)`.

In other words, it works with parentheses or without them. The result is the same.

The call to `typeof x` returns a string with the type name:
A call to `typeof x` returns a string with the type name:

```js
typeof undefined // "undefined"
Expand Down Expand Up @@ -251,9 +246,19 @@ typeof alert // "function" (3)
The last three lines may need additional explanation:

1. `Math` is a built-in object that provides mathematical operations. We will learn it in the chapter <info:number>. Here, it serves just as an example of an object.
2. The result of `typeof null` is `"object"`. That's an officially recognized error in `typeof` behavior, coming from the early days of JavaScript and kept for compatibility. Definitely, `null` is not an object. It is a special value with a separate type of its own.
2. The result of `typeof null` is `"object"`. That's an officially recognized error in `typeof`, coming from very early days of JavaScript and kept for compatibility. Definitely, `null` is not an object. It is a special value with a separate type of its own. The behavior of `typeof` is wrong here.
3. The result of `typeof alert` is `"function"`, because `alert` is a function. We'll study functions in the next chapters where we'll also see that there's no special "function" type in JavaScript. Functions belong to the object type. But `typeof` treats them differently, returning `"function"`. That also comes from the early days of JavaScript. Technically, such behavior isn't correct, but can be convenient in practice.

```smart header="The `typeof(x)` syntax"
You may also come across another syntax: `typeof(x)`. It's the same as `typeof x`.

To put it clear: `typeof` is an operator, not a function. The parentheses here aren't a part of `typeof`. It's the kind of parentheses used for mathematical grouping.

Usually, such parentheses contain a mathematical expression, such as `(2 + 2)`, but here they contain only one argument `(x)`. Syntactically, they allow to avoid a space between the `typeof` operator and its argument, and some people like it.

Some people prefer `typeof(x)`, although the `typeof x` syntax is much more common.
```

## Summary

There are 8 basic data types in JavaScript.
Expand All @@ -269,7 +274,7 @@ There are 8 basic data types in JavaScript.

The `typeof` operator allows us to see which type is stored in a variable.

- Two forms: `typeof x` or `typeof(x)`.
- Usually used as `typeof x`, but `typeof(x)` is also possible.
- Returns a string with the name of the type, like `"string"`.
- For `null` returns `"object"` -- this is an error in the language, it's not actually an object.

Expand Down
2 changes: 1 addition & 1 deletion 1-js/02-first-steps/07-type-conversions/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ For example, `alert` automatically converts any value to a string to show it. Ma
There are also cases when we need to explicitly convert a value to the expected type.

```smart header="Not talking about objects yet"
In this chapter, we won't cover objects. For now we'll just be talking about primitives.
In this chapter, we won't cover objects. For now, we'll just be talking about primitives.

Later, after we learn about objects, in the chapter <info:object-toprimitive> we'll see how objects fit in.
```
Expand Down
22 changes: 11 additions & 11 deletions 1-js/02-first-steps/08-operators/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,22 +194,22 @@ Here's an extract from the [precedence table](https://developer.mozilla.org/en-U
| Precedence | Name | Sign |
|------------|------|------|
| ... | ... | ... |
| 17 | unary plus | `+` |
| 17 | unary negation | `-` |
| 16 | exponentiation | `**` |
| 15 | multiplication | `*` |
| 15 | division | `/` |
| 13 | addition | `+` |
| 13 | subtraction | `-` |
| 15 | unary plus | `+` |
| 15 | unary negation | `-` |
| 14 | exponentiation | `**` |
| 13 | multiplication | `*` |
| 13 | division | `/` |
| 12 | addition | `+` |
| 12 | subtraction | `-` |
| ... | ... | ... |
| 3 | assignment | `=` |
| 2 | assignment | `=` |
| ... | ... | ... |

As we can see, the "unary plus" has a priority of `17` which is higher than the `13` of "addition" (binary plus). That's why, in the expression `"+apples + +oranges"`, unary pluses work before the addition.
As we can see, the "unary plus" has a priority of `15` which is higher than the `12` of "addition" (binary plus). That's why, in the expression `"+apples + +oranges"`, unary pluses work before the addition.

## Assignment

Let's note that an assignment `=` is also an operator. It is listed in the precedence table with the very low priority of `3`.
Let's note that an assignment `=` is also an operator. It is listed in the precedence table with the very low priority of `2`.

That's why, when we assign a variable, like `x = 2 * 2 + 1`, the calculations are done first and then the `=` is evaluated, storing the result in `x`.

Expand Down Expand Up @@ -437,7 +437,7 @@ The list of operators:
- RIGHT SHIFT ( `>>` )
- ZERO-FILL RIGHT SHIFT ( `>>>` )

These operators are used very rarely, when we need to fiddle with numbers on the very lowest (bitwise) level. We won't need these operators any time soon, as web development has little use of them, but in some special areas, such as cryptography, they are useful. You can read the [Bitwise Operators](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators#Bitwise) chapter on MDN when a need arises.
These operators are used very rarely, when we need to fiddle with numbers on the very lowest (bitwise) level. We won't need these operators any time soon, as web development has little use of them, but in some special areas, such as cryptography, they are useful. You can read the [Bitwise Operators](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators#bitwise_operators) chapter on MDN when a need arises.

## Comma

Expand Down
2 changes: 1 addition & 1 deletion 1-js/02-first-steps/09-comparison/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ In JavaScript they are written like this:
- Greater/less than: <code>a &gt; b</code>, <code>a &lt; b</code>.
- Greater/less than or equals: <code>a &gt;= b</code>, <code>a &lt;= b</code>.
- Equals: `a == b`, please note the double equality sign `==` means the equality test, while a single one `a = b` means an assignment.
- Not equals. In maths the notation is <code>&ne;</code>, but in JavaScript it's written as <code>a != b</code>.
- Not equals: In maths the notation is <code>&ne;</code>, but in JavaScript it's written as <code>a != b</code>.

In this article we'll learn more about different types of comparisons, how JavaScript makes them, including important peculiarities.

Expand Down
2 changes: 1 addition & 1 deletion 1-js/02-first-steps/11-logical-operators/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ This leads to some interesting usage compared to a "pure, classical, boolean-onl

It means that `||` processes its arguments until the first truthy value is reached, and then the value is returned immediately, without even touching the other argument.

That importance of this feature becomes obvious if an operand isn't just a value, but an expression with a side effect, such as a variable assignment or a function call.
The importance of this feature becomes obvious if an operand isn't just a value, but an expression with a side effect, such as a variable assignment or a function call.

In the example below, only the second message is printed:

Expand Down
16 changes: 8 additions & 8 deletions 1-js/02-first-steps/12-nullish-coalescing-operator/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

The nullish coalescing operator is written as two question marks `??`.

As it treats `null` and `undefined` similarly, we'll use a special term here, in this article. We'll say that an expression is "defined" when it's neither `null` nor `undefined`.
As it treats `null` and `undefined` similarly, we'll use a special term here, in this article. For brevity, we'll say that a value is "defined" when it's neither `null` nor `undefined`.

The result of `a ?? b` is:
- if `a` is defined, then `a`,
Expand All @@ -22,9 +22,9 @@ result = (a !== null && a !== undefined) ? a : b;

Now it should be absolutely clear what `??` does. Let's see where it helps.

The common use case for `??` is to provide a default value for a potentially undefined variable.
The common use case for `??` is to provide a default value.

For example, here we show `user` if defined, otherwise `Anonymous`:
For example, here we show `user` if its value isn't `null/undefined`, otherwise `Anonymous`:

```js run
let user;
Expand All @@ -42,9 +42,9 @@ alert(user ?? "Anonymous"); // John (user defined)

We can also use a sequence of `??` to select the first value from a list that isn't `null/undefined`.

Let's say we have a user's data in variables `firstName`, `lastName` or `nickName`. All of them may be not defined, if the user decided not to enter a value.
Let's say we have a user's data in variables `firstName`, `lastName` or `nickName`. All of them may be not defined, if the user decided not to fill in the corresponding values.

We'd like to display the user name using one of these variables, or show "Anonymous" if all of them aren't defined.
We'd like to display the user name using one of these variables, or show "Anonymous" if all of them are `null/undefined`.

Let's use the `??` operator for that:

Expand Down Expand Up @@ -106,11 +106,11 @@ In practice, the zero height is often a valid value, that shouldn't be replaced

## Precedence

The precedence of the `??` operator is about the same as `||`, just a bit lower. It equals `5` in the [MDN table](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence#Table), while `||` is `6`.
The precedence of the `??` operator is the same as `||`. They both equal `4` in the [MDN table](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence#Table).

That means that, just like `||`, the nullish coalescing operator `??` is evaluated before `=` and `?`, but after most other operations, such as `+`, `*`.

So if we'd like to choose a value with `??` in an expression with other operators, consider adding parentheses:
So we may need to add parentheses in expressions like this:

```js run
let height = null;
Expand All @@ -128,7 +128,7 @@ Otherwise, if we omit parentheses, then as `*` has the higher precedence than `?
// without parentheses
let area = height ?? 100 * width ?? 50;

// ...works the same as this (probably not what we want):
// ...works this way (not what we want):
let area = height ?? (100 * width) ?? 50;
```

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
No difference.
No difference!

In both cases, `return confirm('Did parents allow you?')` executes exactly when the `if` condition is falsy.
34 changes: 33 additions & 1 deletion 1-js/02-first-steps/15-function-basics/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ When a value is passed as a function parameter, it's also called an *argument*.

In other words, to put these terms straight:

- A parameter is the variable listed inside the parentheses in the function declaration (it's a declaration time term)
- A parameter is the variable listed inside the parentheses in the function declaration (it's a declaration time term).
- An argument is the value that is passed to the function when it is called (it's a call time term).

We declare functions listing their parameters, then call them passing arguments.
Expand Down Expand Up @@ -225,6 +225,38 @@ In the example above, `anotherFunction()` isn't called at all, if the `text` par
On the other hand, it's independently called every time when `text` is missing.
```

````smart header="Default parameters in old JavaScript code"
Several years ago, JavaScript didn't support the syntax for default parameters. So people used other ways to specify them.

Nowadays, we can come across them in old scripts.

For example, an explicit check for `undefined`:

```js
function showMessage(from, text) {
*!*
if (text === undefined) {
text = 'no text given';
}
*/!*

alert( from + ": " + text );
}
```

...Or using the `||` operator:

```js
function showMessage(from, text) {
// If the value of text is falsy, assign the default value
// this assumes that text == "" is the same as no text at all
text = text || 'no text given';
...
}
```
````


### Alternative default parameters

Sometimes it makes sense to assign default values for parameters not in the function declaration, but at a later stage.
Expand Down
Loading