Skip to content

Commit 884ddd1

Browse files
authored
Merge pull request #91 from javascript-tutorial/sync-d6e88647
Sync with upstream @ d6e8864
2 parents f376923 + 131c391 commit 884ddd1

File tree

233 files changed

+3304
-1370
lines changed

Some content is hidden

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

233 files changed

+3304
-1370
lines changed

Diff for: 1-js/01-getting-started/1-intro/article.md

+24
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# জাভাস্ক্রিপ্ট পরিচিতি
22

3+
<<<<<<< HEAD
34
চলুন দেখে নেওয়া যাক জাভাস্ক্রিপ্ট এর বিশেষ বিশেষ দিকগুলো, আমরা এটি দিয়ে কী করতে পারি, এবং অন্যান্য প্রযুক্তিগুলি যা এর সাথে ভালো কাজ করে।
5+
=======
6+
Let's see what's so special about JavaScript, what we can achieve with it, and what other technologies play well with it.
7+
>>>>>>> d6e88647b42992f204f57401160ebae92b358c0d
48
59
## জাভাস্ক্রিপ্ট কী?
610

@@ -24,9 +28,15 @@
2428

2529
বিভিন্ন ইঞ্জিনের আলাদা আলাদা "কোডনাম" রয়েছে । উদাহরণ স্বরূপ:
2630

31+
<<<<<<< HEAD
2732
- [V8](https://bn.wikipedia.org/wiki/V8_(JavaScript_engine) -- ক্রোম এবং অপেরা
2833
- [স্পাইডার মাংকি](https://bn.wikipedia.org/wiki/SpiderMonkey) -- ফায়ারফক্স.
2934
- ...আরও অনেক কোডনাম রয়েছে যেমন ইন্টারনেট এক্সপ্লোরার এর বিভিন্ন ভার্সন এর জন্য "Trident" এবং "Chakra", মাইক্রোসফ্ট এজের জন্য "ChakraCore", সাফারির জন্য "Nitro" এবং "SquirrelFish" ইত্যাদি।
35+
=======
36+
- [V8](https://en.wikipedia.org/wiki/V8_(JavaScript_engine)) -- in Chrome and Opera.
37+
- [SpiderMonkey](https://en.wikipedia.org/wiki/SpiderMonkey) -- in Firefox.
38+
- ...There are other codenames like "Chakra" for IE, "ChakraCore" for Microsoft Edge, "Nitro" and "SquirrelFish" for Safari, etc.
39+
>>>>>>> d6e88647b42992f204f57401160ebae92b358c0d
3040
3141
উপরের টার্ম গুলি মনে রাখা ভাল, কারণ সেগুলি ইন্টারনেটে ডেভেলপার আর্টিকেলে ব্যবহৃত হয়। আমরাও সেগুলো ব্যবহার করব। উদাহরণস্বরূপ, যদি "একটি X ফিচার V8 এ সাপোর্ট করে", তবে সম্ভবত এটি ক্রোম এবং অপেরাতেও কাজ করে।
3242

@@ -109,15 +119,29 @@
109119

110120
এই জাতীয় প্রোগ্রামিং ভাষার উদাহরণ:
111121

122+
<<<<<<< HEAD
112123
- [কফিস্ক্রিপ্ট](http://coffeescript.org/) জাভাস্ক্রিপ্টের জন্য একটি "সিনট্যাকটিক সুগার"। এটি সংক্ষিপ্ত সিনট্যাক্স নিয়ে আসে, আমাদের আরও পরিষ্কার এবং আরও সুনির্দিষ্ট কোড লেখার সুযোগ দেয়। সাধারণত, রুবি (একটি প্রোগ্রামিং ভাষা) ডেভেলপার রা এটি পছন্দ করে।
113124
- [টাইপস্ক্রিপ্ট](http://www.typescriptlang.org/) "স্ট্রিক্ট ডাটা টাইপিং" এ জোর দিয়েছিলো ডেভেলপমেন্ট ও জটিল সমস্যা গুলোকে সহজ করার জন্য। এটি মাইক্রোসফ্ট তৈরি করেছে।
114125
- [ফ্লো](http://flow.org/) ডাটা টাইপিং যুক্ত করে, তবে একটু অন্যভাবে। ফেইসবুক এটি তৈরি করেছে।
115126
- [ডার্ট](https://www.dartlang.org/) একটি স্বতন্ত্র প্রোগ্রামিং ভাষা যার নিজস্ব ইঞ্জিন রয়েছে যা ব্রাউজার ছাড়াও (মোবাইল অ্যাপ্লিকেশন হিসাবে) চালানো হয়, তবে এটি জাভাস্ক্রিপ্টে স্থানান্তরিত করা যায়। এটি গুগল তৈরী করছে।
127+
=======
128+
- [CoffeeScript](http://coffeescript.org/) is a "syntactic sugar" for JavaScript. It introduces shorter syntax, allowing us to write clearer and more precise code. Usually, Ruby devs like it.
129+
- [TypeScript](http://www.typescriptlang.org/) is concentrated on adding "strict data typing" to simplify the development and support of complex systems. It is developed by Microsoft.
130+
- [Flow](http://flow.org/) also adds data typing, but in a different way. Developed by Facebook.
131+
- [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.
132+
- [Brython](https://brython.info/) is a Python transpiler to JavaScript that allow to write application in pure Python without JavaScript.
133+
>>>>>>> d6e88647b42992f204f57401160ebae92b358c0d
116134
117135
আরো অনেক আছে। যদিও আমরা যদি ট্রান্সপাইলড ল্যাঙ্গুয়েজ গুলির মধ্যে যেকোনো একটি ব্যবহার করি তবে আমরা কী করছি তা বুঝতে আমাদের জাভাস্ক্রিপ্ট জানা উচিত।
118136

119137
## সারাংশ
120138

139+
<<<<<<< HEAD
121140
- জাভাস্ক্রিপ্ট প্রথমে শুধুমাত্র-ব্রাউজার ভাষা হিসাবে তৈরি করা হয়েছিল, তবে এখন এটি অন্যান্য অনেক জায়গাতেই ব্যবহৃত হয়।
122141
- বর্তমানে, জাভাস্ক্রিপ্ট HTML / CSS সম্পূর্ণ ইন্টিগ্রেশনের সাথে ব্রাউজারের বহুল প্রচারিত প্রোগ্রামিং ভাষা হিসাবে একটি বিশেষ অবস্থানে রয়েছে।
123142
- এমন অনেক প্রোগ্রামিং ভাষা রয়েছে যা জাভাস্ক্রিপ্টে "রূপান্তরিত" হয়ে যায় এবং নির্দিষ্ট বৈশিষ্ট্য সরবরাহ করে। জাভাস্ক্রিপ্টে দক্ষতা অর্জনের পরে কমপক্ষে সংক্ষেপে এগুলি একবার দেখার পরামর্শ দেওয়া হয়।
143+
=======
144+
- JavaScript was initially created as a browser-only language, but it is now used in many other environments as well.
145+
- Today, JavaScript has a unique position as the most widely-adopted browser language with full integration in HTML/CSS.
146+
- There are many languages that get "transpiled" to JavaScript and provide certain features. It is recommended to take a look at them, at least briefly, after mastering JavaScript.
147+
>>>>>>> d6e88647b42992f204f57401160ebae92b358c0d

Diff for: 1-js/02-first-steps/01-hello-world/article.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
আমরা পুরো URL টিও দিতে পারি। উদাহরণস্বরূপ:
7979

8080
```html
81-
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.2.0/lodash.js"></script>
81+
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.js"></script>
8282
```
8383

8484
একাধিক ট্যাগ ব্যবহার করে, একাধিক স্ক্রিপ্টগুলো সংযুক্ত করতে পারিঃ

Diff for: 1-js/02-first-steps/03-strict-mode/article.md

+40
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@
1919
...
2020
```
2121

22+
<<<<<<< HEAD
2223
শিঘ্রই আমরা ফাংশন (কমান্ড গ্রুপ করার একটি উপায়) শিখব। একটু এগিয়ে গিয়ে নোট করে নেয়া যাক, `"use strict"` কোন ফাংশনের বডির শুরুতেও দেয়া যায়। এতে করে শুধু ঐ ফাংশনে স্ট্রিক্ট মোড সক্রিয় হয়। তবে সাধারণত পুরো স্ক্রিপ্টের জন্যই স্ট্রিক্ট মোড ব্যবহার করা হয়।
2324

25+
=======
26+
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.
27+
>>>>>>> d6e88647b42992f204f57401160ebae92b358c0d
2428
2529
````warn header="\"use strict\" সবার শুরুতে থাকতে হবে"
2630
নিশ্চিত করুন যেন `"use strict"` আপনার স্ক্রিপ্টগুলোর একেবারে সবার উপরে থাকে। নাহলে স্ট্রিক্ট মোড নাও সক্রিয় হতে পারে।
@@ -47,11 +51,21 @@ alert("some code");
4751
4852
## ব্রাউজার কনসোল
4953
54+
<<<<<<< HEAD
5055
ভবিষ্যতে আপনি যখন ব্রাউজার কনসোলে কোন ফিচার পরীক্ষা করতে যাবেন, মনে রাখবেন ডিফল্টভাবে সেটা স্ট্রিক্ট মোডে থাকে না।
56+
=======
57+
When you use a [developer console](info:devtools) to run code, please note that it doesn't `use strict` by default.
58+
>>>>>>> d6e88647b42992f204f57401160ebae92b358c0d
5159
5260
কখনো কখনো যখন `use strict`-এ পার্থক্য হয়, আপনি ভুল ফলাফল পাবেন।
5361
62+
<<<<<<< HEAD
5463
একাধিক লাইন দেয়ার জন্য `key:Shift+Enter` চেপে সবার উপরে `use strict` দিয়ে দেখতে পারেন, এভাবে:
64+
=======
65+
So, how to actually `use strict` in the console?
66+
67+
First, you can try to press `key:Shift+Enter` to input multiple lines, and put `use strict` on top, like this:
68+
>>>>>>> d6e88647b42992f204f57401160ebae92b358c0d
5569
5670
```js
5771
'use strict'; <নতুন লাইনের জন্য Shift+Enter>
@@ -61,12 +75,17 @@ alert("some code");
6175

6276
বেশিরভাগ ব্রাউজার যেমন ক্রোম, ফায়ারফক্সে এটা কাজ করে।
6377

78+
<<<<<<< HEAD
6479
যদি কাজ না করে তাহলে `use strict` নিশ্চিত করার সবচেয়ে নির্ভরযোগ্য উপায় হল কোডটাকে কনসোলে এভাবে ইনপুট দেয়া:
80+
=======
81+
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:
82+
>>>>>>> d6e88647b42992f204f57401160ebae92b358c0d
6583
6684
```js
6785
(function() {
6886
'use strict';
6987

88+
<<<<<<< HEAD
7089
// ...আপনার কোড...
7190
})()
7291
```
@@ -83,3 +102,24 @@ alert("some code");
83102
২. একটি স্ক্রিপ্ট কিংবা ফাংশনের সবার উপরে `"use strict"` দিয়ে স্ট্রিক্ট মোড সক্রিয় করা যায়। ভাষার কিছু ফিচার, যেমন "classes" এবং "modules" স্বয়ংক্রিয়ভাবে স্ট্রিক্ট মোড সক্রিয় করে।
84103
৩. সব মর্ডান ব্রাউজারই স্ট্রিক্ট মোড সমর্থন করে।
85104
৪. আমরা পরামর্শ দিয়েছি সব সময় `"use strict"` দিয়ে স্ক্রিপ্ট শুরু করতে। এই টিউটোরিয়ালের সকল উদাহরণ ধরে নেয় যে স্ট্রিক্ট মোড চালু আছে, যদিনা অন্যথা (খুবই বিরল) উল্লেখ করে দেয়া থাকে।
105+
=======
106+
// ...your code here...
107+
})()
108+
```
109+
110+
## Should we "use strict"?
111+
112+
The question may sound obvious, but it's not so.
113+
114+
One could recommend to start scripts with `"use strict"`... But you know what's cool?
115+
116+
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.
117+
118+
**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.**
119+
120+
As of now, we've got to know about `use strict` in general.
121+
122+
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.
123+
124+
All examples in this tutorial assume strict mode unless (very rarely) specified otherwise.
125+
>>>>>>> d6e88647b42992f204f57401160ebae92b358c0d

Diff for: 1-js/02-first-steps/04-variables/article.md

+15-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ let user = 'John'
8080

8181
Technically, all these variants do the same thing. So, it's a matter of personal taste and aesthetics.
8282

83-
8483
````smart header="`var` instead of `let`"
8584
In older scripts, you may also find another keyword: `var` instead of `let`:
8685

@@ -135,6 +134,20 @@ alert(hello); // Hello world!
135134
alert(message); // Hello world!
136135
```
137136
137+
````warn header="Declaring twice triggers an error"
138+
A variable should be declared only once.
139+
140+
A repeated declaration of the same variable is an error:
141+
142+
```js run
143+
let message = "This";
144+
145+
// repeated 'let' leads to an error
146+
let message = "That"; // SyntaxError: 'message' has already been declared
147+
```
148+
So, we should declare a variable once and then refer to it without `let`.
149+
````
150+
138151
```smart header="Functional languages"
139152
It's interesting to note that there exist [functional](https://en.wikipedia.org/wiki/Functional_programming) programming languages, like [Scala](http://www.scala-lang.org/) or [Erlang](http://www.erlang.org/) that forbid changing variable values.
140153
@@ -190,7 +203,7 @@ let имя = '...';
190203
let 我 = '...';
191204
```
192205
193-
Technically, there is no error here, such names are allowed, but there is an international tradition to use English in variable names. Even if we're writing a small script, it may have a long life ahead. People from other countries may need to read it some time.
206+
Technically, there is no error here. Such names are allowed, but there is an international convention to use English in variable names. Even if we're writing a small script, it may have a long life ahead. People from other countries may need to read it some time.
194207
````
195208

196209
````warn header="Reserved names"

0 commit comments

Comments
 (0)