You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
+
>>>>>>> 52c1e61915bc8970a950a3f59bd845827e49b4bf
67
73
68
74
<!-- 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. -->
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
+
>>>>>>> 52c1e61915bc8970a950a3f59bd845827e49b4bf
75
85
76
86
<!-- 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. -->
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
+
>>>>>>> 52c1e61915bc8970a950a3f59bd845827e49b4bf
87
101
88
102
<!-- For instance, in-browser JavaScript is able to: -->
89
103
90
104
ဥပမာ အားဖြင့် , Browser မှ JavaScript တွေဟာ :
91
105
92
106
<!-- - Add new HTML to the page, change the existing content, modify styles. -->
<!-- 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 severely limited. Though possible, it requires explicit agreement (expressed in HTTP headers) from the remote side. Once again, that's a safety limitation.
176
+
177
+

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.
-[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
+
>>>>>>> 52c1e61915bc8970a950a3f59bd845827e49b4bf
192
239
193
240
<!-- That's to be expected, because projects and requirements are different for everyone. -->
Copy file name to clipboardExpand all lines: 1-js/01-getting-started/2-manuals-specifications/article.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,15 +2,23 @@
2
2
3
3
<!-- # Manuals and specifications -->
4
4
5
+
<<<<<<< HEAD
5
6
<!-- 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.
<!-- [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/>.
<!-- A new specification version is released every year. In-between these releases, the latest specification draft is at <https://tc39.es/ecma262/>. -->
<!-- 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
+
>>>>>>> 52c1e61915bc8970a950a3f59bd845827e49b4bf
26
40
27
41
အသစ်ထွက်လာမယ့် features တွေ "almost standard" (so-called "stage 3") လို့ခေါ်တဲ့ standard ဖြစ်တော့မယ့် features တွေအကြောင်းဖတ်ချင်ရင် <https://github.com/tc39/proposals> သွားဖတ်လို့ရပါတယ်။
28
42
29
43
<!-- Also, if you're developing for the browser, then there are other specifications covered in the [second part](info:browser-environment) of the tutorial. -->
-<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
+
>>>>>>> 52c1e61915bc8970a950a3f59bd845827e49b4bf
36
57
37
58
<!-- - **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. -->
0 commit comments