Skip to content

Commit 5192e3d

Browse files
Merge branch 'master' into master
2 parents 2058d1f + e2b48f6 commit 5192e3d

File tree

24 files changed

+224
-85
lines changed

24 files changed

+224
-85
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
@@ -1,5 +1,5 @@
1-
# ജവസ്ക്രിപ്റ്റിന്റെ ഒരു ഇൻട്രൊഡകഷൻ,
2-
നമുക്ക് നോക്കാം ജവസ്ക്രിപ്റ്റന് എന്താണ് വലിയ പ്രെത്യേകതയെന്നു,നമുക്ക് അതുബ്കൊണ്ടു എന്തൊക്കെ നേടാം, പിന്നെ ഏതൊക്കെ മറ്റു ടെക്നോളജിസ് അതിന്റെ കൂടെ വർക് ചെയ്യുമെന്ന്.
1+
# ജാവാസ്ക്രിപ്റ്റ് ഒരു ഇൻട്രൊഡകഷൻ,
2+
നമുക്ക് നോക്കാം ജാവാസ്ക്രിപ്റ്റ് എന്താണ് വലിയ പ്രെത്യേകതയെന്നു,നമുക്ക് അതുബ്കൊണ്ടു എന്തൊക്കെ നേടാം, പിന്നെ ഏതൊക്കെ മറ്റു ടെക്നോളജിസ് അതിന്റെ കൂടെ വർക് ചെയ്യുമെന്ന്.
33

44
## എന്താണ് ജാവാസ്ക്രിപ്റ്റ്
55

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11

2-
# മാനുവലും ഇതിന്റെ നിർദേശങ്ങളും
32

4-
ഈ ബുക് ഒരു *ടൂട്ടോറിയൽ* ആണ്. ഇതു നിങ്ങളെ പതുക്കെ പഠിക്കാൻ സഹായിക്കും.പക്ഷെ ഒരിക്കൽ നിങ്ങൾ ഇത് പൂർത്തീകരിച്ചാൽ പിന്നെ നിങ്ങൾക്ക് മറ്റൊരു റിസോർസ് വേണ്ടി വരും.
3+
# ഈ മാനുവലും അതിന്റെ പ്രത്യേകതകളും
54

6-
## നിർദേശങ്ങൾ
5+
ഈ ബുക് ഒരു *ടൂട്ടോറിയൽ* ആണ്. ഇതു നിങ്ങളെ പതിയെപ്പതിയെ ല്ഗ്വേജ് പഠിക്കാൻ സഹായിക്കും. ബേസിക് കാര്യങ്ങളൊക്കെ പഠിച്ചു കഴിഞ്ഞാൽ, പിന്നെ നിങ്ങൾക്ക് വേറൊരു സോഴ്സ് പിന്നെ വേണ്ടി വരും.
6+
7+
## കുറച്ചു കാര്യങ്ങൾ
8+
9+
[The ECMA-262 specification](https://www.ecma-international.org/publications/standards/Ecma-262.htm) ജാവാസ്ക്രിപ്റ്റിനെ കുറിച്ചു ആഴത്തിലുള്ള വിശദമായ ഒരു വിശകലനം നമുക്ക് നേടിത്തരുo. അതാണ് പ്രോഗ്രാമിന് രൂപം കൊടുക്കുന്നത്.
710

8-
[ECMA-262 specification](https://www.ecma-international.org/publications/standards/Ecma-262.htm) ൽ ജാവസ്ക്രിപ്റ്റിനെ കുറിച്ചു വളരെ ആഴത്തിലും ഡീറ്റൈൽഡ് ആയും പറയുന്നുണ്ട്. ഇത് ലൻഗ്വേജിനെ തന്നെ വിവരിക്കുന്നു.
911

1012
പക്ഷെ വളരെ ഫോർമലായത് കൊണ്ടു, തുടക്കമിത് മനസ്സിലാക്കാൻ നല്ല ബുദ്ധിമുട്ടായിരിക്കും. അതിനാൽ, വിശദാംശങ്ങളെക്കുറിച്ചുള്ള ഏറ്റവും വിശ്വാസ്യതയുള്ള ഡാറ്റ സ്രോതസ്സ് നിങ്ങൾക്ക് ആവശ്യമുണ്ടെങ്കിൽ, അതൊരു ശരിയായ സ്ഥലമാണ്. എന്നാൽ ഇത് സാദാരണ ഉപയോഗത്തിന് വേണ്ടിയല്ല.
1113

@@ -15,9 +17,8 @@
1517

1618
കൂടാതെ,നിങ്ങളൊരു ബ്രൌസർ ഡെവലപ്‌ ചെയ്യുകയാണെങ്കിൽ, കെ7റച്ചു കൂടി ഡീറ്റൈലായിട്ടൊരു [രണ്ടാം ഭാഗം](info:browser-environment) കിട്ടുന്നതാണ്.
1719

18-
## മാന്വൽസ്
1920

20-
- **MDN (Mozilla) JavaScript Reference** ഉദാഹരണങ്ങളും മറ്റു വിവരങ്ങളും അടങ്ങിയ ഒരു മാന്വൽ. Function കളെ കുറിച്ചും methods നെ കുറിച്ചുമെല്ലാം ആഴത്തിൽ അറിയാൻ ശ്രമിക്കുന്നത് നല്ലതാണ്.
21+
- **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.
2122

2223
ഒന്നു നോക്കുക <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference>.
2324

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ In JavaScript they are written like this:
99
- 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/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

1-js/05-data-types/09-keys-values-entries/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Usually that's convenient. But if we want symbolic keys too, then there's a sepa
7474

7575
Objects lack many methods that exist for arrays, e.g. `map`, `filter` and others.
7676

77-
If we'd like to apply them, then we can use `Object.entries` followed `Object.fromEntries`:
77+
If we'd like to apply them, then we can use `Object.entries` followed by `Object.fromEntries`:
7878

7979
1. Use `Object.entries(obj)` to get an array of key/value pairs from `obj`.
8080
2. Use array methods on that array, e.g. `map`.

1-js/06-advanced-functions/03-closure/article.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ Rectangles on the right-hand side demonstrate how the global Lexical Environment
183183

184184
1. When the script starts, the Lexical Environment is pre-populated with all declared variables.
185185
- Initially, they are in the "Uninitialized" state. That's a special internal state, it means that the engine knows about the variable, but it cannot be referenced until it has been declared with `let`. It's almost the same as if the variable didn't exist.
186-
2. Then `let phrase` definition appears. There's no assignment yet, so its value is `undefined`. We can use the variable since this moment.
186+
2. Then `let phrase` definition appears. There's no assignment yet, so its value is `undefined`. We can use the variable from this point forward.
187187
3. `phrase` is assigned a value.
188188
4. `phrase` changes the value.
189189

@@ -286,7 +286,7 @@ Later, when `counter()` is called, a new Lexical Environment is created for the
286286

287287
![](closure-makecounter-nested-call.svg)
288288

289-
Now when the code inside `counter()` looks for `count` variable, it first searches its own Lexical Environment (empty, as there are no local variables there), then the Lexical Environment of the outer `makeCounter()` call, where finds it and changes.
289+
Now when the code inside `counter()` looks for `count` variable, it first searches its own Lexical Environment (empty, as there are no local variables there), then the Lexical Environment of the outer `makeCounter()` call, where it finds and changes it.
290290

291291
**A variable is updated in the Lexical Environment where it lives.**
292292

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
function sum(a) {
2+
3+
let currentSum = a;
4+
5+
function f(b) {
6+
currentSum += b;
7+
return f;
8+
}
9+
10+
f.toString = function() {
11+
return currentSum;
12+
};
13+
14+
return f;
15+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
function sum(a){
2+
// Your code goes here.
3+
4+
}
5+
6+
/*
7+
sum(1)(2) == 3; // 1 + 2
8+
sum(1)(2)(3) == 6; // 1 + 2 + 3
9+
sum(5)(-1)(2) == 6
10+
sum(6)(-1)(-2)(-3) == 0
11+
sum(0)(1)(2)(3)(4)(5) == 15
12+
*/
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
describe("sum", function(){
2+
3+
it("sum(1)(2) == 3", function(){
4+
assert.equal(3, sum(1)(2));
5+
});
6+
7+
it("sum(5)(-1)(2) == 6", function(){
8+
assert.equal(6, sum(5)(-1)(2));
9+
});
10+
11+
it("sum(6)(-1)(-2)(-3) == 0", function(){
12+
assert.equal(0, sum(6)(-1)(-2)(-3));
13+
});
14+
15+
it("sum(0)(1)(2)(3)(4)(5) == 15", function(){
16+
assert.equal(15, sum(0)(1)(2)(3)(4)(5));
17+
});
18+
});
19+

1-js/06-advanced-functions/09-call-apply-decorators/04-throttle/_js.view/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ describe("throttle(f, 1000)", function() {
77
}
88

99
before(function() {
10-
f1000 = throttle(f, 1000);
1110
this.clock = sinon.useFakeTimers();
11+
f1000 = throttle(f, 1000);
1212
});
1313

1414
it("the first call runs now", function() {

0 commit comments

Comments
 (0)