Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
561 commits
Select commit Hold shift + click to select a range
6ee0d97
Fix a typo
zhang1pr Mar 11, 2020
6917305
fix: 2 lines of russian to english and a typo (mathces -> matches)
HynekS Mar 11, 2020
61bd2b3
fix: fix markdown highlight
Mar 11, 2020
8a13b9b
Create index.html
leviding Mar 12, 2020
be02f57
Update index.html
leviding Mar 12, 2020
4df68f5
Update index.html
leviding Mar 12, 2020
44e88b8
Update solution.md
leviding Mar 12, 2020
07bd724
Update article.md
leviding Mar 13, 2020
958cbe7
minor fixes
Violet-Bora-Lee Mar 13, 2020
c116813
Merge pull request #1800 from Violet-Bora-Lee/master
iliakan Mar 14, 2020
b93cf9d
Minor statement change
Etheraex Mar 14, 2020
bfe8e3f
Update article.md
leviding Mar 19, 2020
94b9c9d
minor fixes
iliakan Mar 21, 2020
fe5d6d9
Merge pull request #1765 from u-n-known/patch-3
iliakan Mar 21, 2020
63518dc
Merge pull request #1770 from jorishr/patch-1
iliakan Mar 21, 2020
58d4329
Merge pull request #1771 from detinsley1s/patch-1
iliakan Mar 21, 2020
d9d2127
Merge pull request #1774 from duongdominhchau/patch-1
iliakan Mar 21, 2020
0d0908f
Merge pull request #1776 from YRFT/patch-1
iliakan Mar 21, 2020
4939a18
Merge pull request #1779 from leviding/patch-3
iliakan Mar 21, 2020
cf851b0
Merge pull request #1780 from alexgalkin/master
iliakan Mar 21, 2020
8211dfd
Merge pull request #1781 from larryng/patch-1
iliakan Mar 21, 2020
4995823
Merge pull request #1787 from KuthumiPepple/patch-1
iliakan Mar 21, 2020
81e728c
Merge pull request #1789 from zeel/patch-1
iliakan Mar 21, 2020
b7dc89a
closes #1791
iliakan Mar 21, 2020
d19401e
Merge pull request #1792 from aniketkudale/master
iliakan Mar 21, 2020
3c2b027
Merge pull request #1795 from zhang1pr/master
iliakan Mar 21, 2020
3086efe
Merge pull request #1796 from HynekS/fix-lang-and-typo
iliakan Mar 21, 2020
2526d5c
Merge pull request #1797 from xin-nie/xnie-fix-markdown
lex111 Mar 21, 2020
60d2e2f
Merge pull request #1804 from leviding/patch-6
lex111 Mar 21, 2020
4357ba9
fixes #1794
iliakan Mar 21, 2020
cec58f4
Merge pull request #1802 from Etheraex/master
iliakan Mar 21, 2020
4084746
Merge pull request #1799 from leviding/patch-5
iliakan Mar 21, 2020
d2ac997
Merge pull request #1798 from leviding/patch-4
iliakan Mar 21, 2020
6ec3f34
closes #1794
iliakan Mar 22, 2020
c866c46
Update solution.md
leviding Mar 22, 2020
a11cc18
Merge pull request #1807 from leviding/patch-4
iliakan Mar 22, 2020
460e7a8
Update article.md
leviding Mar 23, 2020
6700835
closes #1808
iliakan Mar 23, 2020
fd81db7
closes #1812
iliakan Mar 24, 2020
162280b
minor fixes
iliakan Mar 24, 2020
9900be9
Edit sentance syntax in closure article
Mar 24, 2020
b38e243
Update solution.md
leviding Mar 24, 2020
ab1b6de
formatting
KennethKinLum Mar 25, 2020
03aa504
Update article.md
leviding Mar 26, 2020
304ae1c
Update article.md
leviding Mar 26, 2020
da3303b
Update article.md
leviding Mar 27, 2020
0903209
fix typo
wonderingabout Mar 27, 2020
14cd9ec
Update article.md
leviding Mar 27, 2020
2efef24
Update article.md
leviding Mar 27, 2020
ab7a186
Update article.md
leviding Mar 28, 2020
35ff499
fix typo
baooab Mar 29, 2020
063bb96
Merge pull request #1829 from baooab/patch-6
lex111 Mar 29, 2020
be80c33
Merge pull request #1827 from leviding/patch-12
lex111 Mar 29, 2020
6d81d3d
Merge pull request #1826 from leviding/patch-11
lex111 Mar 29, 2020
8cf89b3
Merge pull request #1825 from wonderingabout/fix-typos
lex111 Mar 29, 2020
0895276
Merge pull request #1824 from leviding/patch-10
lex111 Mar 29, 2020
0c5d5d2
Merge pull request #1821 from leviding/patch-8
lex111 Mar 29, 2020
d6ad00f
Merge pull request #1815 from leviding/patch-5
lex111 Mar 29, 2020
c41b8bd
Update article.md
lex111 Mar 29, 2020
20351cb
Merge pull request #1822 from leviding/patch-9
lex111 Mar 29, 2020
c1c5c73
Merge pull request #1748 from GeorgySerga/patch-6
lex111 Mar 29, 2020
09a11ab
Merge pull request #1744 from qdflavel/typos-fix
lex111 Mar 29, 2020
ac5fd8c
Merge pull request #1820 from KennethKinLum/patch-12
lex111 Mar 29, 2020
f4cb058
trick get a new copy of objects/arrays using the spread operator
wonderingabout Mar 29, 2020
c038ef4
Merge pull request #1823 from wonderingabout/trick-deep-copy-spread
paroche Mar 29, 2020
aad6f5e
fix missing js formatting
wonderingabout Mar 29, 2020
42eadf9
Merge pull request #1814 from michael-mcgee/closure-article-edit
iliakan Mar 29, 2020
adfb099
Update article.md
iliakan Mar 29, 2020
62299ed
do the same => do the same thing
paroche Mar 29, 2020
eb546f0
Fixing "sum(1)" instead of "curriedSum(1)" (l. 42)
Aakodal Mar 30, 2020
46b3bf6
Change 'brackets' to 'parentheses'
paroche Mar 31, 2020
2a6e87a
Change 'brackets' to 'parentheses'
paroche Mar 31, 2020
8e22d3f
Update article.md
leviding Apr 1, 2020
6b5a524
fix an anchor link error
Ahmed-Magdy-S Apr 1, 2020
a223336
Update article.md
leviding Apr 2, 2020
dd0c195
Merge pull request #1839 from leviding/patch-2
iliakan Apr 2, 2020
fde6d43
Merge pull request #1838 from Ahmed-Magdy-S/patch-1
iliakan Apr 2, 2020
368cc06
Merge pull request #1837 from leviding/patch-1
iliakan Apr 2, 2020
cd2d450
Merge pull request #1834 from Aakodal/patch-1
iliakan Apr 2, 2020
5049c0b
Merge pull request #1830 from wonderingabout/add-js-formatting
iliakan Apr 2, 2020
6f45ce7
Merge pull request #1809 from leviding/patch-4
iliakan Apr 2, 2020
a55b99c
fixes #1836
iliakan Apr 2, 2020
d84673a
closes #1810
iliakan Apr 2, 2020
81a63cf
fix minor typo
Ahmed-Magdy-S Apr 2, 2020
0287fbd
Change switch Grouping of "case" example
SambaLim Apr 2, 2020
f33dc7e
Merge pull request #1841 from SambaLim/master
iliakan Apr 3, 2020
09404a0
Merge pull request #1840 from Ahmed-Magdy-S/patch-2
iliakan Apr 3, 2020
b82443d
Update article.md
leviding Apr 4, 2020
5a9b8a4
up
iliakan Apr 4, 2020
2acd258
minor fixes
iliakan Apr 4, 2020
23ffde7
minor fixes
iliakan Apr 4, 2020
59d791b
fix typo
baooab Apr 5, 2020
c89ddc5
Merge pull request #1751 from u-n-known/patch-1
iliakan Apr 5, 2020
ee69981
Update article.md
leviding Apr 6, 2020
ec9c76c
Update article.md
leviding Apr 9, 2020
1e092a8
Update article.md
leviding Apr 9, 2020
8090aa6
Update article.md
leviding Apr 9, 2020
2a01424
chapter -> article (3x)
paroche Apr 10, 2020
0bf13ec
Update article.md
leviding Apr 10, 2020
3ffab46
Update article.md
leviding Apr 11, 2020
71120d5
Various small wording and punctuation changes
paroche Apr 12, 2020
e8dcfd1
Update article.md
leviding Apr 13, 2020
37107f7
Merge pull request #1845 from baooab/patch-7
lex111 Apr 18, 2020
641dd56
delete extra content
baooab Apr 21, 2020
d65141d
That's a getter/setter for it -> It's a getter/setter for it
paroche Apr 22, 2020
00cc802
Remove unnecessary "to"
bryik Apr 26, 2020
ec9ae12
add break to number case
janina213 Apr 29, 2020
f2a099b
Merge pull request #1877 from janina213/patch-1
iliakan Apr 29, 2020
8564508
Merge pull request #1874 from bryik/patch-1
iliakan Apr 29, 2020
6ead9af
Merge pull request #1868 from baooab/patch-8
iliakan Apr 29, 2020
fbd6c8a
Merge pull request #1750 from galunni/patch-1
iliakan Apr 29, 2020
649ecc5
closes #1864
iliakan Apr 29, 2020
1d10422
Merge pull request #1861 from leviding/patch-11
iliakan Apr 29, 2020
2ae8261
Merge pull request #1858 from leviding/patch-10
iliakan Apr 29, 2020
2f61147
Merge pull request #1857 from leviding/patch-9
iliakan Apr 29, 2020
839e375
Merge pull request #1856 from leviding/patch-8
iliakan Apr 29, 2020
3543d6d
Merge pull request #1855 from leviding/patch-7
iliakan Apr 29, 2020
f0bd80c
Merge pull request #1853 from leviding/patch-6
iliakan Apr 29, 2020
ba88b60
closes #1852
iliakan Apr 29, 2020
e1469e3
Merge pull request #1847 from leviding/patch-5
iliakan Apr 29, 2020
889913d
Merge pull request #1844 from leviding/patch-3
iliakan Apr 29, 2020
da16159
trick: use array destructuring to swap variables
wonderingabout Apr 29, 2020
ef71488
Merge pull request #1859 from wonderingabout/trick-swap-variables
iliakan Apr 29, 2020
3a3086b
minor fixes
iliakan Apr 29, 2020
175aefa
minor fixes
iliakan Apr 30, 2020
9c2cb1b
Fix minor typo error
leviding May 1, 2020
29ac929
Fix typo in css-animations
traxium May 1, 2020
5a6be36
Updated to show Edge now supports BigInt
RyanAmeri May 1, 2020
8a13c99
Add nullish coalescing to multiple articles, refactor operators, renu…
iliakan May 2, 2020
0835b11
Update article.md
thediveshsoni May 2, 2020
e111aa1
minor improvements
iliakan May 2, 2020
09a964e
'somewhy' -> 'for some reason it'
paroche May 2, 2020
b057341
refactor objects, add optional chaining
iliakan May 3, 2020
c2ce2d4
minor fixes
iliakan May 4, 2020
a5f6a98
small phrase change
matjax May 4, 2020
a211fc9
Update article.md
rjlardizabal May 5, 2020
6853f6a
remove duplicate words
shubham08gupta May 5, 2020
ea39704
small phrase change 1.1
matjax May 5, 2020
fd45b7f
apostrophe
matjax May 5, 2020
b491097
minor fixes
Violet-Bora-Lee May 5, 2020
ac03836
Merge pull request #1888 from Violet-Bora-Lee/master
iliakan May 5, 2020
2289134
Merge pull request #1884 from matjax/master
paroche May 5, 2020
b782700
minor fixes
Violet-Bora-Lee May 6, 2020
405032e
Merge pull request #1890 from Violet-Bora-Lee/master
iliakan May 6, 2020
ba2b7b0
minor
iliakan May 6, 2020
cd5a7e4
fix debounce
iliakan May 6, 2020
80f2bec
fix debounce
iliakan May 6, 2020
844b96a
fix debounce
iliakan May 6, 2020
4584937
minor fixes
iliakan May 6, 2020
0444de2
minor fixes
iliakan May 6, 2020
3440a4e
minor fixes
iliakan May 6, 2020
df6f6be
minor fixes
iliakan May 6, 2020
fc2ba21
minor fixes
iliakan May 6, 2020
9bd640c
minor fixes
iliakan May 6, 2020
6cf15b7
minor fixes
iliakan May 6, 2020
08309a0
minor fixes
iliakan May 6, 2020
83c07e1
minor fixes
iliakan May 6, 2020
c799f28
minor fixes
iliakan May 6, 2020
6b927fc
fixing a typo on line 7
vin18 May 7, 2020
fe78701
fixing a typo on line 431
vin18 May 7, 2020
24224dc
Merge pull request #1893 from vin18/patch-2
iliakan May 7, 2020
f9ad719
Fix Typo in logical operators
mkawi May 8, 2020
e20b1a4
Adding missing 'pattern:'
Aakodal May 8, 2020
0bc8ab6
Fix a small text typo
pedrogpimenta May 8, 2020
62edeb7
Merge pull request #1896 from pedrogpimenta/patch-1
lex111 May 9, 2020
2f400a5
Merge pull request #1887 from shubham08gupta/patch-1
lex111 May 9, 2020
2bd28fe
Merge pull request #1881 from thediveshsoni/patch-1
lex111 May 9, 2020
ebd9a2c
Merge pull request #1878 from leviding/patch-12
lex111 May 9, 2020
681b4fd
Merge pull request #1891 from vin18/patch-1
lex111 May 9, 2020
3cefe91
Merge pull request #1885 from rjlardizabal/patch-1
lex111 May 9, 2020
4927d7a
Merge pull request #1895 from Aakodal/patch-2
lex111 May 9, 2020
681ef7b
Merge pull request #1879 from traxium/steps
lex111 May 9, 2020
a9e5ed5
minor rephrasings
iliakan May 9, 2020
db789a0
minor
iliakan May 9, 2020
6e1e244
pointer api
iliakan May 9, 2020
5d3aa7f
event.button
iliakan May 9, 2020
cca469b
renumber
iliakan May 9, 2020
c056a19
minor fixes
iliakan May 9, 2020
aabbec1
minor fixes
iliakan May 11, 2020
d9d1cfe
Add additional error type-checking examples and use `instanceof` in l…
mattbaker-digital May 15, 2020
befe535
Update task.md
wnleao May 16, 2020
ec77f84
grammar fix: a plain object
wnleao May 16, 2020
c331e44
Merge pull request #1880 from RyanAmeri/master
iliakan May 17, 2020
8a0058d
closes #1882
iliakan May 17, 2020
9353a04
Merge pull request #1894 from mKawi/patch-1
iliakan May 17, 2020
b18ae20
closes #1897
iliakan May 17, 2020
7ef7c5e
Merge pull request #1903 from mattbaker-digital/master
iliakan May 17, 2020
da1d600
minor fixes
iliakan May 17, 2020
c9d84ac
Merge pull request #1905 from kiniggit/master
iliakan May 17, 2020
873e5f7
Merge pull request #1908 from kiniggit/map_set_grammar
iliakan May 17, 2020
fef45af
correct minor error
ZYinMD May 18, 2020
fc8efbf
closes #1909
iliakan May 18, 2020
6c6d5a4
minor fixes
iliakan May 18, 2020
14eb62c
minor fixes
iliakan May 18, 2020
7fc037f
minor fixes
iliakan May 18, 2020
787409b
correct minor error: "имя" is used in place of "name"
ZYinMD May 19, 2020
4e67c0f
Remove duplicate word "soon"
desevoker May 19, 2020
4267d22
minor fixes
iliakan May 21, 2020
77cb06d
Fixed a comment, to reflect changes in the task.
Logan-Schelly May 21, 2020
333cb9d
Fixed minor typos
Logan-Schelly May 21, 2020
bdd936f
fixed grammar
May 23, 2020
3889038
Merge pull request #1912 from ZYinMD/patch-1
iliakan May 23, 2020
43a2b02
Merge pull request #1914 from ZYinMD/patch-2
iliakan May 23, 2020
e7e0fc8
Merge pull request #1915 from desevoker/patch-1
iliakan May 23, 2020
3623cc2
Merge pull request #1917 from Logan-Schelly/master
iliakan May 23, 2020
0da5b2b
Merge pull request #1920 from ekira/patch-1
iliakan May 23, 2020
8613348
Fix typo
GabrieleC May 23, 2020
46daea1
Details on cross-origin requests & credentials
ironsoul0 May 25, 2020
4fe42dd
fixed typos
kumarvaibhav45 May 26, 2020
9141a27
Merge pull request #1922 from GabrieleC/master
iliakan May 27, 2020
e1b44e8
Merge pull request #1927 from kumarvaibhav45/patch-1
iliakan May 27, 2020
4a22c98
Merge pull request #1926 from ironsoul0/patch-1
iliakan May 27, 2020
8c5fa3a
minor fixes
iliakan May 27, 2020
d36675e
minor fixes
iliakan May 27, 2020
cd2c7ce
minor
iliakan May 28, 2020
fef7155
google js guide link
tiagocastro070 May 28, 2020
075266e
Update article.md
lex111 May 30, 2020
69e4450
minor fixes
iliakan May 31, 2020
ad0a5b3
Fix for Issue #1866
tmollov May 31, 2020
479c7f9
fixes #1935
iliakan Jun 1, 2020
8f2ae7e
fixes #1931
iliakan Jun 1, 2020
9cb597e
minor fixes
iliakan Jun 1, 2020
ab93cee
minor fixes
iliakan Jun 1, 2020
d6a3bd1
minor fixes
iliakan Jun 1, 2020
5cd1314
minor fixes
iliakan Jun 1, 2020
1b2a192
minor fixes
iliakan Jun 1, 2020
a701341
Merge pull request #1932 from tmollov/master
iliakan Jun 1, 2020
7b59734
typo
iliakan Jun 1, 2020
ecfcff2
Merge pull request #1928 from tiagocastro070/google-js-guide
iliakan Jun 1, 2020
65eefe0
fixed wrong formatting
damage92 Jun 2, 2020
15a20a6
Grammar fix: Missing "is" in websocket EN article
michaelborn Jun 3, 2020
a0383c0
Add test cases for 1-js/06-advanced-functions/03-closure/9-sort-by-field
Logan-Schelly Jun 5, 2020
76bc708
remove a stray 's' that caused an error in ball drag example
syncopika Jun 6, 2020
b8fbd23
Grammar and typo fix in pointer events
dharohar-rathore Jun 6, 2020
020f2ea
Merge pull request #1946 from syncopika/master
iliakan Jun 6, 2020
d5c3ac9
Match the solution with the question on task.md
diegotc86 Jun 7, 2020
d90b204
Update phrasing on "Comparison with ||"
diegotc86 Jun 7, 2020
d35baee
closes #1949
iliakan Jun 7, 2020
0e1cdaa
Merge pull request #1950 from diegotc86/patch-2
iliakan Jun 8, 2020
cea9d8c
minor fixes
iliakan Jun 8, 2020
30c9c32
minor fixes
iliakan Jun 8, 2020
344993d
Merge pull request #1941 from GabrieleC/master
iliakan Jun 8, 2020
bba7892
Merge pull request #1944 from michaelborn/patch-1
iliakan Jun 8, 2020
675861b
Merge pull request #1945 from Logan-Schelly/testcases/closure-9
iliakan Jun 8, 2020
c2c080e
minor fixes
iliakan Jun 8, 2020
f5a3f37
minor fixes
iliakan Jun 8, 2020
21115c8
Merge pull request #1948 from diegotc86/patch-1
iliakan Jun 8, 2020
cd9c81c
Merge pull request #1947 from dharohar-rathore/master
iliakan Jun 8, 2020
b52aa94
minor fixes
iliakan Jun 9, 2020
464d865
merging all conflicts
iliakan Jun 15, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions 1-js/01-getting-started/1-intro/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ Pažvelkime kuo įpatinga JavaScript kalba, ką mes galime su ja padaryti ir kok

## Kas yra JavaScript?

<<<<<<< HEAD
Iš pat pradžių *JavaScript* buvo sukurtas tam, kad *"padaryti tinklalapius gyvus"*.
=======
*JavaScript* was initially created to "make web pages alive".
>>>>>>> b52aa942a8e9b75ba8a65124c22593171e273bb6

Programos, parašytos šia kalba yra vadinamos *skriptais*. Jos gali būti parašytos tinklalapio HTML ir veikti automatiškai, kuomet tinklalapis kraunamas.

Expand Down Expand Up @@ -64,7 +68,11 @@ JavaScript'o galimybės naryklėje yra ribojamos dėl vartotojų saugumo. Tiksla
Ribojimų pavyzdžiai:
- JavaScript'as tinklalapyje negali skaityti/rašyti failus kietajame diske, juos kopijuoti arba vykdyti programas. JavaScript'as neturi tiesioginios prieigos prie operacinės sistemos funkcijų.

<<<<<<< HEAD
Modernios naršklės leidžia dirbti su failais, bet prieiga ribojama ir tai leidžiama tik jeigu vartotojas įvykdo kažką konkretaus. Pavyzdžiui, dragg'ina failą į naršklę arba pažymi failą per `<input>` tagą.
=======
- JavaScript on a webpage may not read/write arbitrary files on the hard disk, copy them or execute programs. It has no direct access to OS functions.
>>>>>>> b52aa942a8e9b75ba8a65124c22593171e273bb6

Yra būdų komunikuoti su kamera/mikrofonu ir kitais įrenginiais, bet tai reikalauja išreikštinio vartotojo leidimo. Taigi, JavaScript'inis tinklalapis negali suktai įjungti web kamerą, stebėti aplinką ir siųsti informaciją į [NSA](https://en.wikipedia.org/wiki/National_Security_Agency).
- Skirtingi tabai dažniausiai nežino vienas apie kitą. Tačiau kartais vienas tab'as naudoja JavaScript'ą tam, kad atidarytų kitą tab'ą, bet netgi tokiu atveju, JavaScript'as viename tab'e negali pasiekti kito tab'o, jeigu jie ateina iš skirtingų tinklalapių (skirtingas domenas, protokolas arba portas).
Expand Down
13 changes: 13 additions & 0 deletions 1-js/01-getting-started/4-devtools/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,19 @@ Konkretus vaizdas priklauso nuo Chrome versijos, kurią naudoji. Kartais atsiran
- Čia mes galim pamatyt raudoną error message. Šiuo atveju skriptas turi nežinomą "lalala" komandą.
- Dešinėje yra clickable link'as į `bug.html:12` su skaičiumi eilutės, kurioje yra error'as.

<<<<<<< HEAD
Žemiau error message'o yra mėlynas `>` simbolis. Jis parodo "command line", kuriame mes galime rašyti JavaScript komandas. Spausk `key:Enter` kad jas paleisti (`key:Shift+Enter` kad rašyti komandas per daugiau nei vieną eilutę).
=======
Below the error message, there is a blue `>` symbol. It marks a "command line" where we can type JavaScript commands. Press `key:Enter` to run them.
>>>>>>> b52aa942a8e9b75ba8a65124c22593171e273bb6

Dabar mes galime matyti error'us. Kaip pradžiai, to pakanka. Vėliau mes grįšim į developer tools'us ir kalbėsim apie debugginimą chapteryje <info:debugging-chrome>.

```smart header="Multi-line input"
Usually, when we put a line of code into the console, and then press `key:Enter`, it executes.

To insert multiple lines, press `key:Shift+Enter`. This way one can enter long fragments of JavaScript code.
```

## Firefox, Edge ir kiti

Expand All @@ -50,13 +59,17 @@ Atidaryk Preferences ir eik į "Advanced". Apačioj bus checkbox'as:

Dabar `key:Cmd+Opt+C` įjungs konsolę. Taip pat turėk omeny, kad naujas item'as "Develop" atsirado viršutiniam meniu. Jame yra daug komandų ir nustatymų.

<<<<<<< HEAD
```smart header="Kelių eilučių komandos"
Dažniausiai, jeigu konsolėje parašome vieną eilutę kodo ir paspaudžiame `key:Enter`, ji suveikia.

Tam, kad parašyti kelias eilutes, spausk `key:Shift+Enter`. Tokiu būdu mes galime parašyti ilgesnius fragmentus JavaScript kodo.
```

## Reziumė
=======
## Summary
>>>>>>> b52aa942a8e9b75ba8a65124c22593171e273bb6

- Developer tools'ai leidžia mum pamatyti errorus, paleisti komandas, analizuoti kintamuosiuos ir daugiau.
- Juos paleisti galime su `key:F12` dauguma naršklių Windows'uose. Chrome, jeigu naudojame Mac, reikaluaja `key:Cmd+Opt+J`, Safari: `key:Cmd+Opt+C` (iš pradžių reikia aktyvuoti).
Expand Down
12 changes: 12 additions & 0 deletions 1-js/02-first-steps/01-hello-world/1-hello-alert/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>

<body>

<script>
alert( "I'm JavaScript!" );
</script>

</body>

</html>
2 changes: 2 additions & 0 deletions 1-js/02-first-steps/01-hello-world/1-hello-alert/solution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

[html src="index.html"]
4 changes: 2 additions & 2 deletions 1-js/02-first-steps/01-hello-world/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ The `<script>` tag contains JavaScript code which is automatically executed when
The `<script>` tag has a few attributes that are rarely used nowadays but can still be found in old code:

The `type` attribute: <code>&lt;script <u>type</u>=...&gt;</code>
: The old HTML standard, HTML4, required a script to have a `type`. Usually it was `type="text/javascript"`. It's not required anymore. Also, the modern HTML standard totally changed the meaning of this attribute. Now, it can be used for JavaScript modules. But that's an advanced topic; we'll talk about modules in another part of the tutorial.
: The old HTML standard, HTML4, required a script to have a `type`. Usually it was `type="text/javascript"`. It's not required anymore. Also, the modern HTML standard totally changed the meaning of this attribute. Now, it can be used for JavaScript modules. But that's an advanced topic, we'll talk about modules in another part of the tutorial.

The `language` attribute: <code>&lt;script <u>language</u>=...&gt;</code>
: This attribute was meant to show the language of the script. This attribute no longer makes sense because JavaScript is the default language. There is no need to use it.
Expand Down Expand Up @@ -78,7 +78,7 @@ Here, `/path/to/script.js` is an absolute path to the script from the site root.
We can give a full URL as well. For instance:

```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.2.0/lodash.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.js"></script>
```

To attach several scripts, use multiple tags:
Expand Down
4 changes: 2 additions & 2 deletions 1-js/02-first-steps/02-structure/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ But it should be two separate statements, not one. Such a merging in this case i

We recommend putting semicolons between statements even if they are separated by newlines. This rule is widely adopted by the community. Let's note once again -- *it is possible* to leave out semicolons most of the time. But it's safer -- especially for a beginner -- to use them.

## Comments
## Comments [#code-comments]

As time goes on, programs become more and more complex. It becomes necessary to add *comments* which describe what the code does and why.

Expand Down Expand Up @@ -136,7 +136,7 @@ alert('World');
```

```smart header="Use hotkeys!"
In most editors, a line of code can be commented out by pressing the `key:Ctrl+/` hotkey for a single-line comment and something like `key:Ctrl+Shift+/` -- for multiline comments (select a piece of code and press the hotkey). For Mac, try `key:Cmd` instead of `key:Ctrl`.
In most editors, a line of code can be commented out by pressing the `key:Ctrl+/` hotkey for a single-line comment and something like `key:Ctrl+Shift+/` -- for multiline comments (select a piece of code and press the hotkey). For Mac, try `key:Cmd` instead of `key:Ctrl` and `key:Option` instead of `key:Shift`.
```

````warn header="Nested comments are not supported!"
Expand Down
34 changes: 19 additions & 15 deletions 1-js/02-first-steps/03-strict-mode/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ For example:
...
```

We will learn functions (a way to group commands) soon. Looking ahead, let's note that `"use strict"` can be put at the beginning of the function body instead of the whole script. Doing that enables strict mode in that function only. But usually, people use it for the whole script.

Quite soon we're going to learn functions (a way to group commands), so let's note in advance that `"use strict"` can be put at the beginning of a function. Doing that enables strict mode in that function only. But usually people use it for the whole script.

````warn header="Ensure that \"use strict\" is at the top"
Please make sure that `"use strict"` is at the top of your scripts, otherwise strict mode may not be enabled.
Expand All @@ -42,16 +41,18 @@ Only comments may appear above `"use strict"`.
```warn header="There's no way to cancel `use strict`"
There is no directive like `"no use strict"` that reverts the engine to old behavior.

Once we enter strict mode, there's no return.
Once we enter strict mode, there's no going back.
```

## Browser console

For the future, when you use a browser console to test features, please note that it doesn't `use strict` by default.
When you use a [developer console](info:devtools) to run code, please note that it doesn't `use strict` by default.

Sometimes, when `use strict` makes a difference, you'll get incorrect results.

You can try to press `key:Shift+Enter` to input multiple lines, and put `use strict` on top, like this:
So, how to actually `use strict` in the console?

First, you can try to press `key:Shift+Enter` to input multiple lines, and put `use strict` on top, like this:

```js
'use strict'; <Shift+Enter for a newline>
Expand All @@ -61,25 +62,28 @@ You can try to press `key:Shift+Enter` to input multiple lines, and put `use str

It works in most browsers, namely Firefox and Chrome.

If it doesn't, the most reliable way to ensure `use strict` would be to input the code into console like this:
If it doesn't, e.g. in an old browser, there's an ugly, but reliable way to ensure `use strict`. Put it inside this kind of wrapper:

```js
(function() {
'use strict';

// ...your code...
// ...your code here...
})()
```

## Always "use strict"
## Should we "use strict"?

The question may sound obvious, but it's not so.

One could recommend to start scripts with `"use strict"`... But you know what's cool?

Modern JavaScript supports "classes" and "modules" - advanced language structures (we'll surely get to them), that enable `use strict` automatically. So we don't need to add the `"use strict"` directive, if we use them.

We have yet to cover the differences between strict mode and the "default" mode.
**So, for now `"use strict";` is a welcome guest at the top of your scripts. Later, when your code is all in classes and modules, you may omit it.**

In the next chapters, as we learn language features, we'll note the differences between the strict and default modes. Luckily, there aren't many and they actually make our lives better.
As of now, we've got to know about `use strict` in general.

For now, it's enough to know about it in general:
In the next chapters, as we learn language features, we'll see the differences between the strict and old modes. Luckily, there aren't many and they actually make our lives better.

1. The `"use strict"` directive switches the engine to the "modern" mode, changing the behavior of some built-in features. We'll see the details later in the tutorial.
2. Strict mode is enabled by placing `"use strict"` at the top of a script or function. Several language features, like "classes" and "modules", enable strict mode automatically.
3. Strict mode is supported by all modern browsers.
4. We recommended always starting scripts with `"use strict"`. All examples in this tutorial assume strict mode unless (very rarely) specified otherwise.
All examples in this tutorial assume strict mode unless (very rarely) specified otherwise.
17 changes: 15 additions & 2 deletions 1-js/02-first-steps/04-variables/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ let user = 'John'

Technically, all these variants do the same thing. So, it's a matter of personal taste and aesthetics.


````smart header="`var` instead of `let`"
In older scripts, you may also find another keyword: `var` instead of `let`:

Expand Down Expand Up @@ -135,6 +134,20 @@ alert(hello); // Hello world!
alert(message); // Hello world!
```

````warn header="Declaring twice triggers an error"
A variable should be declared only once.

A repeated declaration of the same variable is an error:

```js run
let message = "This";

// repeated 'let' leads to an error
let message = "That"; // SyntaxError: 'message' has already been declared
```
So, we should declare a variable once and then refer to it without `let`.
````

```smart header="Functional languages"
It's interesting to note that there exist [functional](https://en.wikipedia.org/wiki/Functional_programming) programming languages, like [Scala](http://www.scala-lang.org/) or [Erlang](http://www.erlang.org/) that forbid changing variable values.

Expand Down Expand Up @@ -190,7 +203,7 @@ let имя = '...';
let 我 = '...';
```

Technically, there is no error here, such names are allowed, but there is an international tradition to use English in variable names. Even if we're writing a small script, it may have a long life ahead. People from other countries may need to read it some time.
Technically, there is no error here. Such names are allowed, but there is an international convention to use English in variable names. Even if we're writing a small script, it may have a long life ahead. People from other countries may need to read it some time.
````

````warn header="Reserved names"
Expand Down
Loading