Skip to content

Commit f735c41

Browse files
authored
Merge pull request #7 from javascript-tutorial/master
Update with origin
2 parents 52279a0 + 13787b1 commit f735c41

File tree

11 files changed

+184
-95
lines changed

11 files changed

+184
-95
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
*जावास्क्रिप्ट* को पहली बार *वेब पेजेस चलाने* के लिए बनाया गया था।
88

9-
इस भाषा में प्रोग्राम को *स्क्रिप्ट्स* कहा जाता है। उन्हें एचटीएमएल के अंदर में ही लिखा जा सकता है और वो पेज लोड होते ही अपने आप एक्सेक्यूट (निष्पादित) हो जाता है।
9+
इस भाषा में प्रोग्राम को *स्क्रिप्ट्स* कहा जाता है। उन्हें एचटीएमएल के अंदर में ही लिखा जा सकता है और वो पेज लोड होते ही अपने आप निष्पादित (Execute) हो जाता है।
1010

1111
स्क्रिप्ट्स को एक प्लेन टेक्स्ट के रूप में लिखा तथा एक्सेक्यूट (निष्पादित) किया जाता है. उन्हें चलाने के लिए एक विशेष तैयारी या संकलन की आवश्यकता नहीं है।
1212

@@ -65,7 +65,7 @@
6565

6666
- एक वेबपेज पर जावास्क्रिप्ट हार्ड डिस्क पर मनमानी फाइलों को नहीं पढ़ / लिख सकता है, उन्हें कॉपी या प्रोग्राम निष्पादित नहीं कर सकता है। ऑपरेटिंग सिस्टम फ़ंक्शंस (OS functions) पर इसकी कोई सीधी पहुंच नहीं है।
6767

68-
आधुनिक ब्राउज़र इसे फ़ाइलों के साथ काम करने की अनुमति देता है, लेकिन पहुंच सीमित है और केवल तभी प्रदान की जाती है जब उपयोगकर्ता कुछ कार्य करता है, जैसे किसी फ़ाइल को ब्राउज़र विंडो में "ड्रॉप करना" या <input> ('इनपुट') टैग के माध्यम से चुनना।
68+
आधुनिक ब्राउज़र इसे फ़ाइलों के साथ काम करने की अनुमति देता है, लेकिन पहुंच सीमित है और केवल तभी प्रदान की जाती है जब उपयोगकर्ता कुछ कार्य करता है, जैसे किसी फ़ाइल को ब्राउज़र विंडो में "ड्रॉप करना" या input ('इनपुट') टैग के माध्यम से चुनना।
6969

7070
कैमरा / माइक्रोफोन और अन्य उपकरणों के साथ बातचीत करने के तरीके हैं, लेकिन उन्हें उपयोगकर्ता की स्पष्ट अनुमति की आवश्यकता होती है। इसलिए एक जावास्क्रिप्ट-सक्षम पेज वेब-कैमरा को चुपके से सक्षम नहीं कर सकता है, परिवेश का निरीक्षण नहीं कर सकता है और [एनएसए] (https://en.wikipedia.org/wiki/National_Security_Agency) को जानकारी नहीं भेज सकता है।
7171
- विभिन्न टैब / विंडो आमतौर पर एक-दूसरे के बारे में नहीं जानते हैं। कभी-कभी वे जानते हैं, उदाहरण के लिए जब एक window दूसरे को खोलने के लिए जावास्क्रिप्ट का उपयोग करती है। लेकिन इस मामले में भी, एक पृष्ठ से जावास्क्रिप्ट दूसरे तक नहीं पहुंच सकता है यदि वे विभिन्न साइटों (एक अलग डोमेन, प्रोटोकॉल या पोर्ट से) से आते हैं।
Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
11

2-
# Manuals and specifications
2+
# मैनुअल और विशिष्टता
33

4-
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.
4+
यह पुस्तक एक * ट्यूटोरियल * है। इसका उद्देश्य आपको धीरे-धीरे जावास्क्रिप्ट सीखने में मदद करना है। एक बार जब आप मूल बातें से परिचित हो जाते हैं, तो आपको अन्य स्त्रोत की आवश्यकता होगी।
55

6-
## Specification
6+
## विशिष्टता
77

8-
[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.
8+
[ECMA-262 विशिष्टता] (https://www.ecma-international.org/publications/standards/Ecma-262.htm) में {जावास्क्रिप्ट} के बारे में सबसे अधिक गहन, विस्तृत और औपचारिक जानकारी है। यह जावास्क्रिप्ट को परिभाषित करता है।
99

10-
But being that formalized, it's difficult to understand at first. So if you need the most trustworthy source of information about the language details, the specification is the right place. But it's not for everyday use.
10+
लेकिन औपचारिक होने के नाते, यह पहली बार में समझना मुश्किल है। इसलिए यदि आपको जावास्क्रिप्ट के विवरण के बारे में सबसे भरोसेमंद स्त्रोत की आवश्यकता है, तो विशिष्टता सही जगह है। लेकिन यह रोजमर्रा के उपयोग के लिए नहीं है।
1111

12-
A new specification version is released every year. In-between these releases, the latest specification draft is at <https://tc39.es/ecma262/>.
12+
हर साल एक नया विशिष्टता संस्करण जारी किया जाता है। इन रिलीज़ों के बीच, नवीनतम विशिष्टता ड्राफ्ट <https://tc39.es/ecma262/> पर है।
1313

14-
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>.
14+
नवीनतम विशेषताओं के बारे में पढ़ने के लिए, जिनमें "लगभग मानक" (तथाकथित "स्टेज 3") शामिल हैं, <https://github.com/tc39/proposals> पर प्रस्ताव देखें।
1515

16-
Also, if you're in developing for the browser, then there are other specs covered in the [second part](info:browser-environment) of the tutorial.
16+
इसके अलावा, यदि आप ब्राउज़र के लिए विकसित कर रहे हैं, तो ट्यूटोरियल के [दूसरे भाग](info:browser-environment) में अन्य विशिष्टताएं शामिल हैं।
1717

18-
## Manuals
18+
## मैनुअल
1919

20-
- **MDN (Mozilla) JavaScript Reference** is a manual with examples and other information. It's great to get in-depth information about individual language functions, methods etc.
20+
- **एमडीएन (मोज़िला) जावास्क्रिप्ट संदर्भ** उदाहरण और अन्य जानकारी के साथ एक मैनुअल है।यह जावास्क्रिप्ट के फंक्षन, मेतड आदि के बारे में गहराई से जानकारी प्राप्त करना बहुत अच्छा है।
2121

22-
One can find it at <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference>.
22+
कोई इसे <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference> पर पा सकता है।
2323

24-
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 `parseInt` function.
24+
हालांकि, इसके बजाय अक्सर इंटरनेट खोज का उपयोग करना सबसे अच्छा है। बस क्वेरी में "एमडीएन [टर्म]" का उपयोग करें। {`parseInt`} फ़ंक्शन की खोज करने के लिए <https://google.com/search?q=MDN+parseInt> पर जाएं।
2525

2626

27-
- **MSDN** – Microsoft manual with a lot of information, including JavaScript (often referred to as JScript). If one needs something specific to Internet Explorer, better go there: <http://msdn.microsoft.com/>.
27+
- **MSDN** – Microsoft की मैनुअल मे बहुत सारी जानकारी है, जिसमें जावास्क्रिप्ट (अक्सर JScript के रूप में संदर्भित) शामिल है। अगर किसी को इंटरनेट एक्सप्लोरर के लिए कुछ विशिष्ट चाहिए, तो यहा जाएं: <http://msdn.microsoft.com/>
2828

29-
Also, we can use an internet search with phrases such as "RegExp MSDN" or "RegExp MSDN jscript".
29+
इसके अलावा, हम "RegExp MSDN" या "RegExp MSDN jscript" जैसे वाक्यांशों के साथ एक इंटरनेट खोज का उपयोग कर सकते हैं।
3030

31-
## Compatibility tables
31+
## संगतता टेबल
3232

33-
JavaScript is a developing language, new features get added regularly.
33+
जावास्क्रिप्ट एक विकासशील भाषा है, नई विशेषताएं को नियमित रूप से जोड़ा जाता है।
3434

35-
To see their support among browser-based and other engines, see:
35+
ब्राउज़र-आधारित और अन्य इंजनों के बीच उनका समर्थन देखने के लिए, देखें:
3636

37-
- <http://caniuse.com> - per-feature tables of support, e.g. to see which engines support modern cryptography functions: <http://caniuse.com/#feat=cryptography>.
38-
- <https://kangax.github.io/compat-table> - a table with language features and engines that support those or don't support.
37+
- <http://caniuse.com> - समर्थन की प्रति-सुविधा तालिका, उदाहरण के लिए, यह देखने के लिए कि कौन से इंजन आधुनिक क्रिप्टोग्राफी फंक्षन का समर्थन करते हैं: <http://caniuse.com/#feat=cryptography>
38+
- <https://kangax.github.io/compat-table> - जावास्क्रिप्ट सुविधाओं और इंजनों के साथ एक तालिका जो समर्थन करती है या समर्थन नहीं करती है।
3939

40-
All these resources are useful in real-life development, as they contain valuable information about language details, their support etc.
40+
ये सभी संसाधन वास्तविक जीवन के विकास में उपयोगी होते हैं, क्योंकि इनमें जावास्क्रिप्ट के विवरण, उनके समर्थन आदि के बारे में बहुमूल्य जानकारी होती है।
4141

42-
Please remember them (or this page) for the cases when you need in-depth information about a particular feature.
42+
कृपया उन्हें (या यह पृष्ठ) उन मामलों के लिए याद रखें जब आपको किसी विशेष सुविधा के बारे में गहराई से जानकारी की आवश्यकता होगी।

1-js/02-first-steps/09-comparison/article.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ In JavaScript they are written like this:
66

77
- Greater/less than: <code>a &gt; b</code>, <code>a &lt; b</code>.
88
- Greater/less than or equals: <code>a &gt;= b</code>, <code>a &lt;= b</code>.
9-
- Equals: `a == b`, please note the double equality sign `=` means the equality test, while a single one `a = b` means an assignment.
9+
- Equals: `a == b`, please note the double equality sign `==` means the equality test, while a single one `a = b` means an assignment.
1010
- Not equals. In maths the notation is <code>&ne;</code>, but in JavaScript it's written as <code>a != b</code>.
1111

12-
In this article we'll learn more about different types of comparisons, how JavaScript makes them, including important peculiarities.
12+
In this article we'll learn more about different types of comparisons, how JavaScript makes them, including important peculiarities.
13+
14+
At the end you'll find a good recipe to avoid "javascript quirks"-related issues.
1315

1416
## Boolean is the result
1517

@@ -196,13 +198,12 @@ We get these results because:
196198
- Comparisons `(1)` and `(2)` return `false` because `undefined` gets converted to `NaN` and `NaN` is a special numeric value which returns `false` for all comparisons.
197199
- The equality check `(3)` returns `false` because `undefined` only equals `null`, `undefined`, and no other value.
198200

199-
### Evade problems
200-
201-
Why did we go over these examples? Should we remember these peculiarities all the time? Well, not really. Actually, these tricky things will gradually become familiar over time, but there's a solid way to evade problems with them:
201+
### Avoid problems
202202

203-
Just treat any comparison with `undefined/null` except the strict equality `===` with exceptional care.
203+
Why did we go over these examples? Should we remember these peculiarities all the time? Well, not really. Actually, these tricky things will gradually become familiar over time, but there's a solid way to avoid problems with them:
204204

205-
Don't use comparisons `>= > < <=` with a variable which may be `null/undefined`, unless you're really sure of what you're doing. If a variable can have these values, check for them separately.
205+
- Treat any comparison with `undefined/null` except the strict equality `===` with exceptional care.
206+
- Don't use comparisons `>= > < <=` with a variable which may be `null/undefined`, unless you're really sure of what you're doing. If a variable can have these values, check for them separately.
206207

207208
## Summary
208209

1-js/04-object-basics/07-optional-chaining/article.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ AND'ing the whole path to the property ensures that all components exist, but is
4040

4141
The optional chaining `?.` stops the evaluation and returns `undefined` if the part before `?.` is `undefined` or `null`.
4242

43-
Further in this article, for brevity, we'll be saying that something "exists" if it's not `null` and not `undefined`.
44-
43+
**Further in this article, for brevity, we'll be saying that something "exists" if it's not `null` and not `undefined`.**
4544

4645
Here's the safe way to access `user.address.street`:
4746

@@ -57,14 +56,14 @@ Reading the address with `user?.address` works even if `user` object doesn't exi
5756
let user = null;
5857

5958
alert( user?.address ); // undefined
60-
6159
alert( user?.address.street ); // undefined
62-
alert( user?.address.street.anything ); // undefined
6360
```
6461
65-
Please note: the `?.` syntax works exactly where it's placed, not any further.
62+
Please note: the `?.` syntax makes optional the value before it, but not any further.
63+
64+
In the example above, `user?.` allows only `user` to be `null/undefined`.
6665
67-
In the last two lines the evaluation stops immediately after `user?.`, never accessing further properties. But if the `user` actually exists, then the further intermediate properties, such as `user.address` must exist.
66+
On the other hand, if `user` does exist, then it must have `user.address` property, otherwise `user?.address.street` gives an error at the second dot.
6867
6968
```warn header="Don't overuse the optional chaining"
7069
We should use `?.` only where it's ok that something doesn't exist.
@@ -74,14 +73,14 @@ For example, if according to our coding logic `user` object must be there, but `
7473
So, if `user` happens to be undefined due to a mistake, we'll know about it and fix it. Otherwise, coding errors can be silenced where not appropriate, and become more difficult to debug.
7574
```
7675
77-
````warn header="The variable before `?.` must exist"
78-
If there's no variable `user`, then `user?.anything` triggers an error:
76+
````warn header="The variable before `?.` must be declared"
77+
If there's no variable `user` at all, then `user?.anything` triggers an error:
7978

8079
```js run
8180
// ReferenceError: user is not defined
8281
user?.address;
8382
```
84-
The optional chaining only tests for `null/undefined`, doesn't interfere with any other language mechanics.
83+
There must be `let/const/var user`. The optional chaining works only for declared variables.
8584
````
8685

8786
## Short-circuiting

1-js/05-data-types/02-number/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ There are two ways to do so:
148148

149149
1. Multiply-and-divide.
150150

151-
For example, to round the number to the 2nd digit after the decimal, we can multiply the number by `100`, call the rounding function and then divide it back.
151+
For example, to round the number to the 2nd digit after the decimal, we can multiply the number by `100` (or a bigger power of 10), call the rounding function and then divide it back.
152152
```js run
153153
let num = 1.23456;
154154

0 commit comments

Comments
 (0)