Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1241 commits
Select commit Hold shift + click to select a range
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
f20fb43
Add test case/sandbox for 1-js/06-advanced-functions/06-function-obje…
Logan-Schelly Jun 10, 2020
e5fe4a0
Got rid of excessive newlines in task/sum-many-brackets sandbox code.
Logan-Schelly Jun 10, 2020
8e86159
Merge branch 'master' of https://github.com/javascript-tutorial/en.ja…
Logan-Schelly Jun 10, 2020
1358b5e
Add bottom and right properties for getCoords()
Jun 13, 2020
d3ef0d5
Fixed Wikipedia link and list markdown
LuiGeeDev Jun 15, 2020
42b0220
minor fixes
iliakan Jun 15, 2020
64b0ff3
Merge pull request #1958 from LuiGee3471/unicode-property
iliakan Jun 15, 2020
a9925f4
minor fixes
iliakan Jun 15, 2020
c13f21d
Fixed onupgradeneeded handling
xehpuk Jun 15, 2020
2e575af
Merge pull request #1959 from xehpuk/patch-1
iliakan Jun 15, 2020
267e825
Made the test cases easier to read.
Logan-Schelly Jun 15, 2020
0ef2dd3
Merge pull request #1956 from Logan-Schelly/testcases/function-object-5
iliakan Jun 16, 2020
393f1ce
Set fake timers after calling throttle
aadijoshi Jun 16, 2020
f1da3ee
Merge pull request #1962 from aadijoshi/patch-1
iliakan Jun 16, 2020
531864a
Merge pull request #1957 from chanjsq/patch-1
iliakan Jun 16, 2020
15d638e
Fix typo
rizkyzhang Jun 20, 2020
2f80cb7
Merge pull request #1964 from rizkyzhang/patch-4
iliakan Jun 20, 2020
a45788b
Correct misspelling retarteted -> retargeted
joachimklug Jun 21, 2020
c75f66a
Merge pull request #1967 from joachimklug/issue/#1966
iliakan Jun 21, 2020
1f7b137
'since this moment' -> 'from this point forward'
paroche Jun 21, 2020
e4e6a50
'where finds it and changes' -> 'where it finds and changes it'
paroche Jun 21, 2020
dde5fed
minor fixes
iliakan Jun 22, 2020
ef2760e
minor fixes
iliakan Jun 22, 2020
7b42ecc
minor fixes
iliakan Jun 27, 2020
b3fbb9c
minor fixes
iliakan Jun 27, 2020
340ce43
minor fixes
iliakan Jun 27, 2020
db102cb
Fix minor typo error: delete blank
leviding Jul 1, 2020
da9849d
fixes #1979
iliakan Jul 1, 2020
ea3d179
Merge pull request #1981 from leviding/patch-13
iliakan Jul 1, 2020
94c8fcb
minor fixes
iliakan Jul 2, 2020
26bf51a
minor fixes
iliakan Jul 2, 2020
0edc651
minor fixes
iliakan Jul 5, 2020
445bda3
minor fixes
iliakan Jul 5, 2020
2e27e2f
merging all conflicts
iliakan Jul 6, 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
  •  
  •  
  •  
17 changes: 17 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,16 +4,25 @@ Hãy cùng xem Javascript có gì đặc biệt, chúng ta có thể hoàn thàn

## JavaScript là gì?

<<<<<<< HEAD
*JavaScript* ban đầu được tạo ra để *"make web pages alive"*.
=======
*JavaScript* was initially created to "make web pages alive".
>>>>>>> 445bda39806050acd96f87166a7c97533a0c67e9

Các chương trình trong ngôn ngữ này được gọi là *kịch bản (scripts)*. Chúng có thể được viết ngay trong HTML của trang web và chạy khi tải trang.

Các tập lệnh (scripts) được cung cấp và thực thi dưới dạng văn bản thuần túy. Chúng không cần chuẩn bị hay biên dịch để có thể chạy được.

Ở khía cạnh này, JavaScript rất khác với ngôn ngữ lập trình có tên là [Java](https://en.wikipedia.org/wiki/Java_(programming_language)).

<<<<<<< HEAD
```smart header="Vì sao lại gọi là <u>Java</u>Script?"
Khi Javascript được tạo ra, ban đầu nó có một cái tên khác: "LiveScript". Nhưng lúc này Java đang rất phổ biến, vì vậy người ta đã quyết định rằng đặt một ngôn ngữ mới là "em trai" của Java sẽ có ích.
=======
```smart header="Why is it called <u>Java</u>Script?"
When JavaScript was created, it initially had another name: "LiveScript". But Java was very popular at that time, so it was decided that positioning a new language as a "younger brother" of Java would help.
>>>>>>> 445bda39806050acd96f87166a7c97533a0c67e9

Nhưng với sự phát triển của mình, JavaScript đã trở thành một ngôn ngữ hoàn toàn độc lập, với những đặc điểm kỹ thuật riêng của mình được gọi là [ECMAScript](http://en.wikipedia.org/wiki/ECMAScript), và bây giờ nó chẳng liên quan gì đến Java cả.
```
Expand All @@ -38,7 +47,11 @@ Engine khá phức tạp, tuy nhiên có thể hiểu đơn giản như sau:
2. Tiếp theo nó chuyển đổi ("biên dịch") tập lệnh sang mã máy.
3. Và sau đó mã máy chạy, khá nhanh.

<<<<<<< HEAD
Engine đều áp dụng tối ưu hóa ở các quy trình. Nó thậm chí còn xem tập lệnh được biên dịch khi đang chạy, phân tích dữ liệu chảy qua nó và áp dụng tối ưu hóa cho mã máy. Vì vậy tập lệnh có tốc độ khá nhanh sau khi được hoàn tất.
=======
The engine applies optimizations at each step of the process. It even watches the compiled script as it runs, analyzes the data that flows through it, and further optimizes the machine code based on that knowledge.
>>>>>>> 445bda39806050acd96f87166a7c97533a0c67e9
```

## JavaScript có thể làm gì trong trình duyệt?
Expand All @@ -63,7 +76,11 @@ Nhiều tính năng của Javascript trong trình duyệt bị giới hạn vì

Một số hạn chế có thể kể là:

<<<<<<< HEAD
- Javascript trên trang web không thể đọc/ghi các tập tin tùy ý, sao chép hoặc thực thi một chương trình. Nó cũng không có cách nào trực tiếp truy cập vào các hàm hệ thống của Hệ điều hành.
=======
- 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.
>>>>>>> 445bda39806050acd96f87166a7c97533a0c67e9

Nhiều trình duyệt hiện đại cho phép làm việc với tập tin, nhưng bị giới hạn và chỉ được truy cập nếu như người dùng thực hiện một hành động nhất định nào đó, ví dụ như "thả" các tập tin vào cửa sổ trình duyệt hoặc chọn chúng qua thẻ `<input>`.

Expand Down
8 changes: 8 additions & 0 deletions 1-js/01-getting-started/2-manuals-specifications/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,19 @@ Nhưng với việc được chính thức hóa, ban đầu nó khá là khó hi

Dự thảo mới nhất: <https://tc39.es/ecma262/>.

<<<<<<< HEAD
Để đọc về những tính năng mới nhất, bao gồm cả các tính năng gần như tiêu chuẩn (được gọi là "stage-3") xem tại: <https://github.com/tc39/proposals>.
=======
[The ECMA-262 specification](https://www.ecma-international.org/publications/standards/Ecma-262.htm) contains the most in-depth, detailed and formalized information about JavaScript. It defines the language.
>>>>>>> 445bda39806050acd96f87166a7c97533a0c67e9

Ngoài ra, nếu bạn đang phát triển cho trình duyệt, thì có các thông số kỹ thuật khác được đề cập trong [phần thứ hai](info:browser-environment) của hướng dẫn.

<<<<<<< HEAD
## Cẩm nang
=======
A new specification version is released every year. In-between these releases, the latest specification draft is at <https://tc39.es/ecma262/>.
>>>>>>> 445bda39806050acd96f87166a7c97533a0c67e9

- **Tài liệu tham khảo Javascript MDN (Mozilla)** là một tài liệu hướng dẫn với các ví dụ và thông tin khác gồm những thông tin chuyên sâu khá bổ ích về các hàm, phương thức (methods) etc.

Expand Down
1 change: 1 addition & 0 deletions 1-js/01-getting-started/3-code-editors/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ In practice, lightweight editors may have a lot of plugins including directory-l
The following options deserve your attention:

- [Atom](https://atom.io/) (cross-platform, free).
- [Visual Studio Code](https://code.visualstudio.com/) (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.
Expand Down
13 changes: 6 additions & 7 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,15 @@ The exact look of developer tools depends on your version of Chrome. It changes
- Here we can see the red-colored error message. In this case, the script contains an unknown "lalala" command.
- On the right, there is a clickable link to the source `bug.html:12` with the line number where the error has occurred.

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 (`key:Shift+Enter` to input multi-line commands).
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.

Now we can see errors, and that's enough for a start. We'll come back to developer tools later and cover debugging more in-depth in the chapter <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, and others

Expand All @@ -50,12 +55,6 @@ Open Preferences and go to the "Advanced" pane. There's a checkbox at the bottom

Now `key:Cmd+Opt+C` can toggle the console. Also, note that the new top menu item named "Develop" has appeared. It has many commands and options.

```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.
```

## Summary

- Developer tools allow us to see errors, run commands, examine variables, and much more.
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"]
10 changes: 9 additions & 1 deletion 1-js/02-first-steps/01-hello-world/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ Thuộc tính `type`: <code>&lt;script <u>type</u>=...&gt;</code>
: Chuẩn HTML4 cũ yêu cầu mỗi script phải có một `type`. Thường là `type="text/javascript"`. Nhưng hiện nay nó không còn cần thiết nữa. Chuẩn HTML5 hiện đại vẫn sử dụng thuộc tính `type` nhưng với mục đích hoàn toàn khác. Bây giờ `type` được dùng cho các JavaScript module. Nhưng nó là một chủ đề nâng cao sẽ được nói đến trong một phần khác của loạt bài hướng dẫn này.
=======
The `type` attribute: <code>&lt;script <u>type</u>=...&gt;</code>
<<<<<<< HEAD
: 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.
>>>>>>> 34e9cdca3642882bd36c6733433a503a40c6da74
=======
: 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.
>>>>>>> 445bda39806050acd96f87166a7c97533a0c67e9

Thuộc tính `language`: <code>&lt;script <u>language</u>=...&gt;</code>
: Thuộc tính này cho biết script được viết bằng ngôn ngữ nào. Ngày nay JavaScript trở thành ngôn ngữ script mặc định, thuộc tính này không còn cần thiết nữa.
Expand All @@ -69,7 +73,11 @@ Các chú thích trước và sau script.
//--></script>
```

<<<<<<< HEAD
Mẹo này không được sử dụng trong JavaScript hiện đại. Mục đích của chú thích là ẩn đi mã JavaScript trong các trình duyệt cũ không hỗ trợ thẻ `<script>`. Các trình duyệt phát hành trong 15 năm gần đây không gặp phải vấn đề này, kiểu đặt chú thích như thế này chỉ gặp trong nhưng đoạn mã rất cũ.
=======
This trick isn't used in modern JavaScript. These comments hide JavaScript code from old browsers that didn't know how to process the `<script>` tag. Since browsers released in the last 15 years don't have this issue, this kind of comment can help you identify really old code.
>>>>>>> 445bda39806050acd96f87166a7c97533a0c67e9


## Các script ngoài
Expand All @@ -93,7 +101,7 @@ Here, `/path/to/script.js` is an absolute path to the script from the site root.
Một địa chỉ URL cũng được cho phép, ví dụ:

```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>
```

Để thêm nhiều script, sử dụng nhiều thẻ:
Expand Down
9 changes: 9 additions & 0 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,11 @@ Cách thấy này hiển nhiên sai vì thực ra đó là hai câu lệnh, đó

Chúng tôi khuyên bạn nên đặt dấu chấm phảy giữa các câu lệnh ngay cả khi mỗi lệnh viết trên một dòng. Quy tắc này được cộng đồng áp dụng rộng rãi. Cùng nhắc lại một lần nữa -- *có thể* bỏ qua dấu chấm phảy trong hầu hết trường hợp. Nhưng để an toàn -- đặc biệt cho những người mới -- hãy luôn sử dụng chúng.

<<<<<<< HEAD
## Các chú thích
=======
## Comments [#code-comments]
>>>>>>> 445bda39806050acd96f87166a7c97533a0c67e9

Theo thời gian, chương trình ngày càng phức tạp. Trong chương trình ta cần bổ sung thêm các "chú thích" để diễn giải hoạt động của mã trong chương trình.

Expand Down Expand Up @@ -135,8 +139,13 @@ alert('Chào');
alert('thế giới!');
```

<<<<<<< HEAD
```smart header="Dùng phím tắt!"
Trong hầu hết các trình soạn thảo mã, có thể chú thích hóa một dòng mã bằng tổ hợp phím `key:Ctrl+/`, nhiều dòng mã bằng tổ hợp phím `key:Ctrl+Shift+/`. Trên máy Mac, dùng `key:Cmd` thay cho `key:Ctrl`.
=======
```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` and `key:Option` instead of `key:Shift`.
>>>>>>> 445bda39806050acd96f87166a7c97533a0c67e9
```

````warn header="Không được phép đặt một chú thích trong một chú thích khác (nested comment)!"
Expand Down
44 changes: 44 additions & 0 deletions 1-js/02-first-steps/03-strict-mode/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Ví dụ:
...
```

<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
Chúng ta sẽ học về các hàm (là cách nhóm các lệnh) ở một bài học gần đây.
Expand All @@ -35,6 +36,9 @@ We will learn functions (a way to group commands) soon. Looking ahead, let's not
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.
>>>>>>> 5cb9760abb8499bf1e99042d866c3c1db8cd61ca

=======
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.
>>>>>>> 445bda39806050acd96f87166a7c97533a0c67e9

````warn header="Phải chắc chắn rằng đặt \"use strict\" ở đầu"
Bạn phải chắc chắn rằng đặt `"use strict"` ở đầu script, nếu không chế độ "strict" không được bật.
Expand All @@ -56,16 +60,30 @@ Chỉ các chú thích được phép xuất hiện trước `"use strict"`.
```warn header="Không có cách hủy `use strict`"
Không có chỉ dẫn nào kiểu như `"no use strict"` để tắt chế độ strict sau khi đã bật.

<<<<<<< HEAD
Một khi đã vào chế độ strict, không còn đường quay lại.
=======
Once we enter strict mode, there's no going back.
>>>>>>> 445bda39806050acd96f87166a7c97533a0c67e9
```

## Console của trình duyệt

<<<<<<< HEAD
Cho tương lai khi bạn sử dụng console của trình duyệt để kiểm tra các tính năng mới của JavaScript, hãy chú ý rằng mặc định `use strict` không được sử dụng.
=======
When you use a [developer console](info:devtools) to run code, please note that it doesn't `use strict` by default.
>>>>>>> 445bda39806050acd96f87166a7c97533a0c67e9

Thỉnh thoảng, khi `use strict` tạo ra sự khác biệt, bạn sẽ nhận được các kết quả không đúng.

<<<<<<< HEAD
Bạn có thể thử bấm tổ hợp phím `key:Shift+Enter` để nhập mã trên nhiều dòng và đặt `use strict` ở đầu, như sau:
=======
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:
>>>>>>> 445bda39806050acd96f87166a7c97533a0c67e9

```js
'use strict'; <Shift+Enter để xuống dòng>
Expand All @@ -75,12 +93,17 @@ Bạn có thể thử bấm tổ hợp phím `key:Shift+Enter` để nhập mã

Nó làm việc trong hầu hết trình duyệt, như Firefox và Chrome.

<<<<<<< HEAD
Nếu không làm việc, cách tin cậy nhất để chắc chắn `use strict` chạy được là viết như sau:
=======
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:
>>>>>>> 445bda39806050acd96f87166a7c97533a0c67e9

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

<<<<<<< HEAD
// ...mã của bạn...
})()
```
Expand All @@ -97,3 +120,24 @@ Hiện tại, chúng ta chỉ cân biết những điểm tổng quát như sau:
2. Chế độ strict được bật bằng cách đặt `"use strict"` ở đầu script hoặc hàm. Vài tính năng của ngôn ngữ như "class" và "module" tự động bật chế độ strict khi được sử dụng.
3. Chế độ strict được hỗ trợ bởi hầu hết trình duyệt.
4. Chúng tôi khuyến khích bạn luôn bắt đầu script với `"use strict"`. Tất cả các ví dụ trong loạt bài hướng dẫn này để mặc định sử dụng chế độ strict (trừ vài trường hợp hiếm).
=======
// ...your code here...
})()
```

## 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.

**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.**

As of now, we've got to know about `use strict` 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.

All examples in this tutorial assume strict mode unless (very rarely) specified otherwise.
>>>>>>> 445bda39806050acd96f87166a7c97533a0c67e9
Loading