|
1 |
| -# Code structure |
| 1 | +# कोड संरचना |
2 | 2 |
|
3 |
| -The first thing we'll study is the building blocks of code. |
| 3 | +पहली चीज जो हम अध्ययन करेंगे, वह है कोड की नींव की ईंटें (building blocks)। |
4 | 4 |
|
5 |
| -## Statements |
| 5 | +## उक्ति (Statements) [#उक्ति] |
6 | 6 |
|
7 |
| -Statements are syntax constructs and commands that perform actions. |
| 7 | +उक्ति कार्य करने वाले वाक्य रचना और आदेश हैं। |
8 | 8 |
|
9 |
| -We've already seen a statement, `alert('Hello, world!')`, which shows the message "Hello, world!". |
| 9 | +हमने पहले ही एक उक्ति देखा है, `alert('हेलो विश्व!')`, "हेलो विश्व" जो संदेश दिखाता है। |
10 | 10 |
|
11 |
| -We can have as many statements in our code as we want. Statements can be separated with a semicolon. |
| 11 | +हम अपने कोड में जितने चाहें उतने उक्ति दे सकते हैं। उक्ति अर्धविराम से अलग किए जा सकते हैं। |
12 | 12 |
|
13 |
| -For example, here we split "Hello World" into two alerts: |
| 13 | +उदाहरण के लिए, यहां हमने "हेलो विश्व!" को दो अलर्ट में विभाजित किया है: |
14 | 14 |
|
15 | 15 | ```js run no-beautify
|
16 |
| -alert('Hello'); alert('World'); |
| 16 | +alert('हेलो!'); alert('विश्व'); |
17 | 17 | ```
|
18 | 18 |
|
19 |
| -Usually, statements are written on separate lines to make the code more readable: |
| 19 | +आमतौर पर कोड को अधिक पठनीय बनाने के लिए अलग-अलग लाइनों पर उक्ति लिखे जाते हैं: |
20 | 20 |
|
21 | 21 | ```js run no-beautify
|
22 |
| -alert('Hello'); |
23 |
| -alert('World'); |
| 22 | +alert('हेलो'); |
| 23 | +alert('विश्व'); |
24 | 24 | ```
|
25 | 25 |
|
26 |
| -## Semicolons [#semicolon] |
| 26 | +## अर्धविराम [#अर्धविराम] |
27 | 27 |
|
28 |
| -A semicolon may be omitted in most cases when a line break exists. |
| 28 | +लाइन ब्रेक मौजूद होने पर अधिकांश मामलों में अर्धविराम छोड़ा जा सकता है। |
29 | 29 |
|
30 |
| -This would also work: |
| 30 | +यह कोड काम करेगा: |
31 | 31 |
|
32 | 32 | ```js run no-beautify
|
33 |
| -alert('Hello') |
34 |
| -alert('World') |
| 33 | +alert('हेलो') |
| 34 | +alert('विश्व') |
35 | 35 | ```
|
36 | 36 |
|
37 |
| -Here, JavaScript interprets the line break as an "implicit" semicolon. This is called an [automatic semicolon insertion](https://tc39.github.io/ecma262/#sec-automatic-semicolon-insertion). |
| 37 | +यहाँ, जावास्क्रिप्ट लाइन ब्रेक (एक पंक्ति का अंत) को "निहित" अर्धविराम के रूप में मानता है। इसे [automatic semicolon insertion](https://tc39.github.io/ecma262/#sec-automatic-semicolon-insertion) कहा जाता है। |
38 | 38 |
|
39 |
| -**In most cases, a newline implies a semicolon. But "in most cases" does not mean "always"!** |
| 39 | +**ज्यादातर मामलों में, एक नई पंक्ति का अर्थ अर्धविराम है। लेकिन "ज्यादातर मामलों में" का अर्थ "हमेशा" नहीं होता है!** |
40 | 40 |
|
41 | 41 | There are cases when a newline does not mean a semicolon. For example:
|
42 | 42 |
|
|
0 commit comments