Skip to content

Commit 4167292

Browse files
committed
merging all conflicts
2 parents d378839 + 035c526 commit 4167292

File tree

220 files changed

+3754
-1232
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

220 files changed

+3754
-1232
lines changed

.github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: iliakan

1-js/01-getting-started/1-intro/article.md

+47
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Browser တွင် သူ့ရဲ့ ကိုယ်ပိုင် ထည့
5555

5656
အပေါ်က Engine နာမည်တွေဟာ Online စာမျက်နှာတွေ မှာ မကြာမဏ တွေ့မြင်နိုင်ပြီး ကျွန်တော် တို့လည်း ကျွန်တော်တို့လည်း ရှေ့ဆက် သင်ခန်းစာများတွင် အသုံးပြုသွားပါမယ်။ ဥပမာအားဖြင့် X ဆိုသော feature ကို V8 တွင် အလုပ်လုပ်သည်ဆိုလျှင် ထို feature သည် Chrome, Opera and Edge မှာ အလုပ်လုပ်သည်ဟု ယူဆနိုင်ပါသည်။
5757

58+
<<<<<<< HEAD
5859
```smart header="Engine တွေက ဘယ်လိုအလုပ်လုပ်လည်း?"
5960
<!-- Engines are complicated. But the basics are easy. -->
6061
Engines တွေက ရှုပ်ထွေးပါတယ် ဒါပေမယ့် အခြေခံကတော့ ရိုးရှင်းပါတယ်။
@@ -64,14 +65,23 @@ Engines တွေက ရှုပ်ထွေးပါတယ် ဒါပေမ
6465
1. Engine (Browser ဆိုလျှင် ကိုယ်ပိုင်ရှိပြီးသား) က Script တွေ ကို ဖတ်တယ်။
6566
2. ဖတ်ထားတဲ့ Script တွေကို machine langulage ကို ပြောင်းပေးတယ်။
6667
3. ပြောင်းထားတဲ့ machine codes တွေကို အလွန်လျင်မြန်စွာ run ပေးတယ်။
68+
=======
69+
1. The engine (embedded if it's a browser) reads ("parses") the script.
70+
2. Then it converts ("compiles") the script to machine code.
71+
3. And then the machine code runs, pretty fast.
72+
>>>>>>> 035c5267ba80fa7b55878f7213cbde449b4092d9
6773
6874
<!-- 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. -->
6975
Engine တွေဟာ အလုပ်လုပ်သည့် အဆင့်တိုင်းတွင် ပိုမိုကောင်းမွန်စွာ အလုပ်လုပ်ပေးပါသည်။ ထို့အပြင် Script တွေကို run နေသည့် အဆင့်တိုင်းမှာလည်း ခွဲခြမ်းစိတ်ဖြာပေးပြီး နောက်လာမယ့် machine code တွေမှာ ပိုမိုကောင်းမွန်အောင် ထိုအချက်အလက်တွေကို အသုံးပြုပါသည်။
7076
```
7177

7278
<!-- ## What can in-browser JavaScript do? -->
7379

80+
<<<<<<< HEAD
7481
## Browser မှာပါတဲ့ JavaScript တွေက ဘာတွေလုပ်နိုင်လည်း?
82+
=======
83+
Modern JavaScript is a "safe" programming language. It does not provide low-level access to memory or the CPU, because it was initially created for browsers which do not require it.
84+
>>>>>>> 035c5267ba80fa7b55878f7213cbde449b4092d9
7585
7686
<!-- Modern JavaScript is a "safe" programming language. It does not provide low-level access to memory or CPU, because it was initially created for browsers which do not require it. -->
7787

@@ -83,14 +93,19 @@ JavaScript ရဲ့လုပ်ဆောင်နိုင်စွမ်းဟ
8393

8494
<!-- In-browser JavaScript can do everything related to webpage manipulation, interaction with the user, and the webserver. -->
8595

96+
<<<<<<< HEAD
8697
Browser မှာ ပါဝင်တဲ့ JavaScript တွေကတော့ webpage တွေဖော်ပြတာ, အသုံးပြုသူတွေ user နဲ့ webserver ကို ချိတ်ဆက်ပေးတာ စသည်ဖြင့် လုပ်ဆောင်နိုင်ပါတယ်။
98+
=======
99+
JavaScript's abilities in the browser are limited to protect the user's safety. The aim is to prevent an evil webpage from accessing private information or harming the user's data.
100+
>>>>>>> 035c5267ba80fa7b55878f7213cbde449b4092d9
87101
88102
<!-- For instance, in-browser JavaScript is able to: -->
89103

90104
ဥပမာ အားဖြင့် , Browser မှ JavaScript တွေဟာ :
91105

92106
<!-- - Add new HTML to the page, change the existing content, modify styles. -->
93107

108+
<<<<<<< HEAD
94109
- Html တွေ အလုပ်လုပ်နိုင်အောင် လုပ်ဆောင်ပေးတာ ၊ ရှိနေတဲ့ content တွေကို update လုပ်ပေးတာ ၊ Styles တွေ ချိန်းပေးတာ
95110
<!-- - React to user actions, run on mouse clicks, pointer movements, key presses. -->
96111
- User actions တွေကို လုပ်ဆောင်ပေးတာ ဥပမာ mouse clicks, pointer movements, key pressess
@@ -150,6 +165,19 @@ Browser မှာ အလုပ်လုပ်တဲ့ JavaScript တွေရ
150165
![](limitations.svg)
151166

152167
<!-- Such limits do not exist if JavaScript is used outside of the browser, for example on a server. Modern browsers also allow plugin/extensions which may ask for extended permissions. -->
168+
=======
169+
There are ways to interact with the camera/microphone and other devices, but they require a user's explicit permission. So a JavaScript-enabled page may not sneakily enable a web-camera, observe the surroundings and send the information to the [NSA](https://en.wikipedia.org/wiki/National_Security_Agency).
170+
- Different tabs/windows generally do not know about each other. Sometimes they do, for example when one window uses JavaScript to open the other one. But even in this case, JavaScript from one page may not access the other page if they come from different sites (from a different domain, protocol or port).
171+
172+
This is called the "Same Origin Policy". To work around that, *both pages* must agree for data exchange and must contain special JavaScript code that handles it. We'll cover that in the tutorial.
173+
174+
This limitation is, again, for the user's safety. A page from `http://anysite.com` which a user has opened must not be able to access another browser tab with the URL `http://gmail.com`, for example, and steal information from there.
175+
- JavaScript can easily communicate over the net to the server where the current page came from. But its ability to receive data from other sites/domains is crippled. Though possible, it requires explicit agreement (expressed in HTTP headers) from the remote side. Once again, that's a safety limitation.
176+
177+
![](limitations.svg)
178+
179+
Such limitations do not exist if JavaScript is used outside of the browser, for example on a server. Modern browsers also allow plugins/extensions which may ask for extended permissions.
180+
>>>>>>> 035c5267ba80fa7b55878f7213cbde449b4092d9
153181
154182
တကယ်လို့သာ JavaScript ကို Browser မှာ မဟုတ်ပဲ တစ်ခြားနေရာမှာ သုံးမယဆိုရင် အဲ့လို ကန့်သတ်ချက်တွေ မရှိပါဘူး။ ဥပမာ Server ပေါ်မှာ ဆိုရင်ပေါ့။ နောက်ပိုင်း Browser တွေကတော့ plugin/extensions တွေကို ထပ်တိုး permissions တွေတောင်းပြီး အလုပ်လုပ်နိုင်ပါတယ်။
155183

@@ -172,23 +200,42 @@ JavaScript နဲ့ ပတ်သတ်ပြီး အကောင်းဆု
172200

173201
<!-- JavaScript is the only browser technology that combines these three things. -->
174202

203+
<<<<<<< HEAD
175204
JavaScript ဟာ ထို အချက်သုံးချက်ကို Browser ပေါ်မှာ လုပ်ဆောင်နိုင်တဲ့ တစ်ခုတည်းသော နည်းပညာ ဖြစ်ပါတယ်။
205+
=======
206+
That said, JavaScript can be used to create servers, mobile applications, etc.
207+
>>>>>>> 035c5267ba80fa7b55878f7213cbde449b4092d9
176208
177209
<!-- That's what makes JavaScript unique. That's why it's the most widespread tool for creating browser interfaces. -->
178210

179211
အဲ့ဒီအရာကပဲ JavaScript ကို ထူးခြားစေပြီး browser interfaces တွေကို ဖန့်တီးတဲ့ လူသုံးအများဆုံး tool တစ်ခု ဖြစ်နေတာပါပဲ
180212

181213
<!-- That said, JavaScript also allows to create servers, mobile applications, etc. -->
182214

215+
<<<<<<< HEAD
183216
ဒါအပြင် JavaScript ကိုသုံးပြီး server တွေ mobile applications, စတဲ့ အရာတွေလည်း ဖန်တီးနိုင်ပါတယ်။
217+
=======
218+
So, recently a plethora of new languages appeared, which are *transpiled* (converted) to JavaScript before they run in the browser.
219+
>>>>>>> 035c5267ba80fa7b55878f7213cbde449b4092d9
184220
185221
<!-- ## Languages "over" JavaScript -->
186222

187223
## JavaScript ကို အခြေခံထားတဲ့ Languages များ
188224

225+
<<<<<<< HEAD
189226
<!-- The syntax of JavaScript does not suit everyone's needs. Different people want different features. -->
190227

191228
JavaScript ရဲ့ ရေးသားပုံတွေ က လူတိုင်းရဲ့ လိုအပ်ချက်နဲ့ တော့ မကိုက်ညီ နိုင်ပါဘူး။ မတူညီတဲ့ သူတွေမှာ မတူညီတဲ features တွေ လိုအပ်ကျပါတယ်။
229+
=======
230+
- [CoffeeScript](https://coffeescript.org/) is "syntactic sugar" for JavaScript. It introduces shorter syntax, allowing us to write clearer and more precise code. Usually, Ruby devs like it.
231+
- [TypeScript](https://www.typescriptlang.org/) is concentrated on adding "strict data typing" to simplify the development and support of complex systems. It is developed by Microsoft.
232+
- [Flow](https://flow.org/) also adds data typing, but in a different way. Developed by Facebook.
233+
- [Dart](https://www.dartlang.org/) is a standalone language that has its own engine that runs in non-browser environments (like mobile apps), but also can be transpiled to JavaScript. Developed by Google.
234+
- [Brython](https://brython.info/) is a Python transpiler to JavaScript that enables the writing of applications in pure Python without JavaScript.
235+
- [Kotlin](https://kotlinlang.org/docs/reference/js-overview.html) is a modern, concise and safe programming language that can target the browser or Node.
236+
237+
There are more. Of course, even if we use one of these transpiled languages, we should also know JavaScript to really understand what we're doing.
238+
>>>>>>> 035c5267ba80fa7b55878f7213cbde449b4092d9
192239
193240
<!-- That's to be expected, because projects and requirements are different for everyone. -->
194241

1-js/01-getting-started/2-manuals-specifications/article.md

+21
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,23 @@
22

33
<!-- # Manuals and specifications -->
44

5+
<<<<<<< HEAD
56
<!-- This book is a *tutorial*. It aims to help you gradually learn the language. But once you're familiar with the basics, you'll need other sources. -->
7+
=======
8+
This book is a *tutorial*. It aims to help you gradually learn the language. But once you're familiar with the basics, you'll need other resources.
9+
>>>>>>> 035c5267ba80fa7b55878f7213cbde449b4092d9
610
711
ဒီစာအုပ်က _tutorial_ တစ်ခုဖြစ်ပါတယ်။ JavaScript ကို တစ်ဖြည်းဖြည်းချင်း လေ့လာနိုင်အောင် ရည်ရွယ်ထားတယ်။ တကယ်လို့ အခြေခံ အချက်တွေကို နားလည်သွားပြီဆိုရင် တခြား လေ့လာစရာတွေကို ထပ်လေ့လာဖို့ လိုပါလိမ့်မယ်။
812

913
<!-- ## Specification -->
1014

1115
## သတ်မှတ်ချက်
1216

17+
<<<<<<< HEAD
1318
<!-- [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. -->
19+
=======
20+
A new specification version is released every year. Between these releases, the latest specification draft is at <https://tc39.es/ecma262/>.
21+
>>>>>>> 035c5267ba80fa7b55878f7213cbde449b4092d9
1422
1523
[The ECMA-262 specification](https://www.ecma-international.org/publications/standards/Ecma-262.htm) ဆိုတဲ့ သတ်မှတ်ချက် တွေမှာ JavaScript နဲ့ ပတ်သတ်ပြီး အသေးစိတ် , အခြေခံကျကျ နဲ့ တိကျတဲ့ အချက်အလက်တွေ ပါဝင်ပါတယ်။
1624

@@ -20,19 +28,32 @@
2028

2129
<!-- A new specification version is released every year. In-between these releases, the latest specification draft is at <https://tc39.es/ecma262/>. -->
2230

31+
<<<<<<< HEAD
2332
နှစ်စဉ်နှစ်တိုင်း သတ်မှတ်ချက် အသစ်တွေ ထွက်ပါတယ်။ အဲ့ မထွက်ခင် အတောအတွင်း သတ်မှတ်ချက်တွေကို <https://tc39.es/ecma262/> မှာ သွားကြည့်လို့ရပါတယ်။
2433

2534
<!-- To read about new bleeding-edge features, including those that are "almost standard" (so-called "stage 3"), see proposals at <https://github.com/tc39/proposals>. -->
35+
=======
36+
You can find it at <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference>.
37+
38+
Although, it's often best to use an internet search instead. Just use "MDN [term]" in the query, e.g. <https://google.com/search?q=MDN+parseInt> to search for the `parseInt` function.
39+
>>>>>>> 035c5267ba80fa7b55878f7213cbde449b4092d9
2640
2741
အသစ်ထွက်လာမယ့် features တွေ "almost standard" (so-called "stage 3") လို့ခေါ်တဲ့ standard ဖြစ်တော့မယ့် features တွေအကြောင်းဖတ်ချင်ရင် <https://github.com/tc39/proposals> သွားဖတ်လို့ရပါတယ်။
2842

2943
<!-- Also, if you're developing for the browser, then there are other specifications covered in the [second part](info:browser-environment) of the tutorial. -->
3044

3145
နောက်ပြီးတော့ တကယ်လို့ သင်ဟာ brower အတွက် ဖန်တီးနေတဲ့သူဆိုရင် browser environment တွေအတွက် သတ်မှတ်မှတ်ချက် တွေကို ဒီ tutorial ရဲ့ [second part](info:browser-environment) မှာ ပြောပြသွားပါမယ်။
3246

47+
<<<<<<< HEAD
3348
<!-- ## Manuals -->
3449

3550
## Manual
51+
=======
52+
- <https://caniuse.com> - per-feature tables of support, e.g. to see which engines support modern cryptography functions: <https://caniuse.com/#feat=cryptography>.
53+
- <https://kangax.github.io/compat-table> - a table with language features and engines that support those or don't support.
54+
55+
All these resources are useful in real-life development, as they contain valuable information about language details, their support, etc.
56+
>>>>>>> 035c5267ba80fa7b55878f7213cbde449b4092d9
3657
3758
<!-- - **MDN (Mozilla) JavaScript Reference** is the main manual with examples and other information. It's great to get in-depth information about individual language functions, methods etc. -->
3859

0 commit comments

Comments
 (0)