From 90eb82c89abe64cecea33afb1fa05ffa2d6ea073 Mon Sep 17 00:00:00 2001 From: Aayush Sharma Date: Thu, 2 Oct 2025 16:25:42 +0530 Subject: [PATCH] fix: replace hint style 'warning' -> 'working' across docs (fixes #307) --- de/arrays/README.md | 2 +- de/arrays/for-each.md | 2 +- de/arrays/join.md | 2 +- de/arrays/pop.md | 2 +- de/arrays/shift.md | 2 +- de/arrays/sort.md | 2 +- de/arrays/spread.md | 2 +- de/arrays/unshift.md | 2 +- de/date-and-time.md | 2 +- de/modules.md | 2 +- de/regular-expression.md | 2 +- en/Dedication.md | 24 +- en/arrays/README.md | 2 +- en/arrays/for-each.md | 2 +- en/arrays/join.md | 2 +- en/arrays/pop.md | 2 +- en/arrays/shift.md | 2 +- en/arrays/sort.md | 2 +- en/arrays/spread.md | 2 +- en/arrays/unshift.md | 2 +- en/complexity/space-complexity.md | 144 ++++----- en/complexity/time-complexity.md | 112 +++---- en/date-and-time.md | 2 +- en/error-handling/async_errorhandling.md | 372 +++++++++++------------ en/error-handling/try...-catch.md | 2 +- en/functions/README.md | 2 +- en/loops/while.md | 2 +- en/modules.md | 2 +- en/numbers/operators.md | 2 +- en/objects/delete.md | 2 +- en/objects/mutable.md | 2 +- en/promise-async-await/async-await.md | 2 +- en/promise-async-await/promise.md | 4 +- en/regular-expression.md | 2 +- en/strings/create.md | 2 +- en/strings/length.md | 2 +- en/strings/replace.md | 2 +- en/strings/substring.md | 118 +++---- es/arrays/README.md | 2 +- es/arrays/for-each.md | 2 +- es/arrays/join.md | 2 +- es/arrays/pop.md | 2 +- es/arrays/shift.md | 2 +- es/arrays/sort.md | 2 +- es/arrays/spread.md | 2 +- es/arrays/unshift.md | 2 +- es/date-and-time.md | 2 +- es/error-handling/try...-catch.md | 2 +- es/functions/README.md | 2 +- es/loops/while.md | 2 +- es/modules.md | 2 +- es/numbers/operators.md | 2 +- es/objects/delete.md | 2 +- es/objects/mutable.md | 2 +- es/promise-async-await/async-await.md | 2 +- es/promise-async-await/promise.md | 4 +- es/regular-expression.md | 2 +- es/strings/create.md | 2 +- es/strings/length.md | 2 +- es/strings/replace.md | 2 +- fr/arrays/README.md | 2 +- fr/arrays/for-each.md | 2 +- fr/arrays/join.md | 2 +- fr/arrays/pop.md | 2 +- fr/arrays/shift.md | 2 +- fr/arrays/sort.md | 2 +- fr/arrays/spread.md | 2 +- fr/arrays/unshift.md | 2 +- fr/date-and-time.md | 2 +- fr/error-handling/try...-catch.md | 2 +- fr/functions/README.md | 2 +- fr/loops/while.md | 2 +- fr/modules.md | 2 +- fr/numbers/operators.md | 2 +- fr/objects/delete.md | 2 +- fr/objects/mutable.md | 2 +- fr/promise-async-await/async-await.md | 2 +- fr/promise-async-await/promise.md | 4 +- fr/regular-expression.md | 2 +- fr/strings/create.md | 2 +- fr/strings/length.md | 2 +- fr/strings/replace.md | 2 +- id/arrays/README.md | 2 +- id/arrays/for-each.md | 2 +- id/arrays/join.md | 2 +- id/arrays/pop.md | 2 +- id/arrays/shift.md | 2 +- id/arrays/sort.md | 2 +- id/arrays/spread.md | 2 +- id/arrays/unshift.md | 2 +- id/date-and-time.md | 2 +- id/error-handling/try...-catch.md | 2 +- id/functions/README.md | 2 +- id/loops/while.md | 2 +- id/modules.md | 2 +- id/numbers/operators.md | 2 +- id/objects/delete.md | 2 +- id/objects/mutable.md | 2 +- id/promise-async-await/async-await.md | 2 +- id/promise-async-await/promise.md | 4 +- id/regular-expression.md | 2 +- id/strings/create.md | 2 +- id/strings/length.md | 2 +- id/strings/replace.md | 2 +- np/Dedication.md | 26 +- np/arrays/README.md | 2 +- np/arrays/for-each.md | 2 +- np/arrays/join.md | 2 +- np/arrays/pop.md | 2 +- np/arrays/shift.md | 2 +- np/arrays/sort.md | 2 +- np/arrays/spread.md | 2 +- np/arrays/unshift.md | 2 +- np/date-and-time.md | 2 +- np/error-handling/try...-catch.md | 2 +- np/functions/README.md | 2 +- np/loops/while.md | 2 +- np/modules.md | 2 +- np/numbers/operators.md | 2 +- np/objects/delete.md | 2 +- np/objects/mutable.md | 2 +- np/promise-async-await/async-await.md | 2 +- np/promise-async-await/promise.md | 4 +- np/regular-expression.md | 2 +- np/strings/create.md | 2 +- np/strings/length.md | 2 +- np/strings/replace.md | 2 +- tr/arrays/README.md | 2 +- tr/arrays/for-each.md | 2 +- tr/arrays/join.md | 2 +- tr/arrays/pop.md | 2 +- tr/arrays/shift.md | 2 +- tr/arrays/sort.md | 2 +- tr/arrays/spread.md | 2 +- tr/arrays/unshift.md | 2 +- tr/date-and-time.md | 2 +- tr/error-handling/try...-catch.md | 2 +- tr/functions/README.md | 2 +- tr/loops/while.md | 2 +- tr/modules.md | 2 +- tr/numbers/operators.md | 2 +- tr/objects/delete.md | 2 +- tr/objects/mutable.md | 2 +- tr/promise-async-await/async-await.md | 2 +- tr/promise-async-await/promise.md | 4 +- tr/regular-expression.md | 2 +- tr/strings/create.md | 2 +- tr/strings/length.md | 2 +- tr/strings/replace.md | 2 +- 149 files changed, 547 insertions(+), 547 deletions(-) diff --git a/de/arrays/README.md b/de/arrays/README.md index e244a3db..a2a68722 100644 --- a/de/arrays/README.md +++ b/de/arrays/README.md @@ -37,7 +37,7 @@ autos[0] = "Opel"; // Ändern des ersten Elements eines Arrays console.log(autos); // Ergebnis: ['Opel', 'Volvo', 'BMW'] ``` -{% hint style="warning" %} +{% hint style="working" %} Arrays sind eine spezielle Art von Objekt. Es können Objekte in einem Array vorhanden sein. {% endhint %} diff --git a/de/arrays/for-each.md b/de/arrays/for-each.md index 8ad17010..6454ae38 100644 --- a/de/arrays/for-each.md +++ b/de/arrays/for-each.md @@ -40,7 +40,7 @@ zahlen.forEach(zahl => console.log(zahl * 2)); Die `forEach`-Methode ändert nicht das ursprüngliche Array. Sie durchläuft lediglich die Elemente des Arrays und führt die bereitgestellte Funktion für jedes Element aus. -{% hint style="warning" %} +{% hint style="working" %} Die `forEach()`-Methode wird nicht für die leere Anweisung ausgeführt. {% endhint %} ``` diff --git a/de/arrays/join.md b/de/arrays/join.md index 4b9500f3..35930260 100644 --- a/de/arrays/join.md +++ b/de/arrays/join.md @@ -23,7 +23,7 @@ console.log(array.join(" ")); // Ergebnis: eins zwei drei vier ``` -{% hint style="warning" %} +{% hint style="working" %} Es kann ein beliebiges Trennzeichen angegeben werden, aber das Standardtrennzeichen ist ein Komma `(,)`. {% endhint %} diff --git a/de/arrays/pop.md b/de/arrays/pop.md index f85ee0b0..92176b49 100644 --- a/de/arrays/pop.md +++ b/de/arrays/pop.md @@ -34,7 +34,7 @@ while (array.length > 0) { console.log(array); // Ergebnis: [] ``` -{% hint style="warning" %} +{% hint style="working" %} Die "pop"-Methode funktioniert nur bei Arrays und nicht bei anderen Objekten, die Arrays ähneln, wie z.B. Argument-Objekten oder NodeList-Objekten. Wenn Sie Elemente aus einem dieser Arten von Objekten entfernen müssen, müssen Sie es zuerst in ein Array umwandeln, indem Sie die Methode Array.prototype.slice() verwenden. {% endhint %} diff --git a/de/arrays/shift.md b/de/arrays/shift.md index e8afdeff..5e483ec3 100644 --- a/de/arrays/shift.md +++ b/de/arrays/shift.md @@ -31,6 +31,6 @@ while (array.length > 0) { console.log(array); // Ergebnis: [] ``` -{% hint style="warning" %} +{% hint style="working" %} Die "shift"-Methode funktioniert nur bei Arrays und nicht bei anderen Objekten, die Arrays ähneln, wie zum Beispiel Argument-Objekten oder NodeList-Objekten. Wenn Sie Elemente aus einem dieser Arten von Objekten verschieben müssen, müssen Sie es zuerst in ein Array umwandeln, indem Sie die Methode Array.prototype.slice() verwenden. {% endhint %} diff --git a/de/arrays/sort.md b/de/arrays/sort.md index 87b99b0d..2935f836 100644 --- a/de/arrays/sort.md +++ b/de/arrays/sort.md @@ -46,6 +46,6 @@ punkte.sort((a, b) => {return a-b}); // Ergebnis: [1, 5, 10, 25, 40, 100] ``` -{% hint style="warning" %} +{% hint style="working" %} Die sort()-Methode überschreibt das ursprüngliche Array. {% endhint %} diff --git a/de/arrays/spread.md b/de/arrays/spread.md index e03e0c16..a293c072 100644 --- a/de/arrays/spread.md +++ b/de/arrays/spread.md @@ -28,6 +28,6 @@ console.log(arr); // Ergebnis: [1, 2, 3, 4, 5, 6, 7] ``` -{% hint style="warning" %} +{% hint style="working" %} Der Spread-Operator funktioniert nur in modernen Browsern, die diese Funktion unterstützen. Wenn Sie ältere Browser unterstützen müssen, müssen Sie einen Transpiler wie Babel verwenden, um die Syntax des Spread-Operators in äquivalenten ES5-Code umzuwandeln. {% endhint %} diff --git a/de/arrays/unshift.md b/de/arrays/unshift.md index a2903c80..65e612a4 100644 --- a/de/arrays/unshift.md +++ b/de/arrays/unshift.md @@ -13,7 +13,7 @@ array.unshift(-5); // 4 // ERGEBNIS: array = [-5 , 0, 5, 10]; ``` -{% hint style="warning" %} +{% hint style="working" %} Die Methode unshift() überschreibt das ursprüngliche Array. {% endhint %} diff --git a/de/date-and-time.md b/de/date-and-time.md index 86f9e61e..7aad03e7 100644 --- a/de/date-and-time.md +++ b/de/date-and-time.md @@ -29,7 +29,7 @@ new Date(year,month,day,hours,minutes,seconds,ms) new Date(milliseconds) ``` -{% hint style="warning" %} +{% hint style="working" %} Monate können von `0` bis `11` angegeben werden, darüber hinaus erfolgt ein Überlauf in das nächste Jahr. {% endhint %} diff --git a/de/modules.md b/de/modules.md index 0259af5f..44d30ceb 100644 --- a/de/modules.md +++ b/de/modules.md @@ -57,7 +57,7 @@ const age = 30; export {name, age}; ``` -{% hint style="warning" %} +{% hint style="working" %} Eine Datei darf nur einen einzigen Standard-`export` enthalten. {% endhint %} diff --git a/de/regular-expression.md b/de/regular-expression.md index 0adc58d2..6ce30925 100644 --- a/de/regular-expression.md +++ b/de/regular-expression.md @@ -210,7 +210,7 @@ Eigenschaften und Methoden, die von RegEx unterstützt werden: | `test()` | Testet, ob ein Treffer existiert, und gibt `true` oder `false` zurück | | `toString()` | Gibt das Muster als Zeichenkette zurück | -{% hint style="warning" %} +{% hint style="working" %} Eine `compile()` Methode zum Kompilieren eines regulären Ausdrucks ist veraltet. Sie war früher nützlich, um bestehende RegEx-Objekte neu zu konfigurieren, ist aber heute durch direktes Neuerstellen überflüssig. {% endhint %} diff --git a/en/Dedication.md b/en/Dedication.md index be419058..9f888723 100644 --- a/en/Dedication.md +++ b/en/Dedication.md @@ -1,12 +1,12 @@ ---- -pageNumber: I -chapter: ---- -# Dedication - -This book is dedicated, in respect and admiration, to the spirit of computers and programming languages in our world. - - -> “The art of programming is the art of organizing complexity, of mastering multitude and avoiding its bastard chaos as effectively as possible.” -> -> -  Edsger Dijkstra +--- +pageNumber: I +chapter: +--- +# Dedication + +This book is dedicated, in respect and admiration, to the spirit of computers and programming languages in our world. + + +> “The art of programming is the art of organizing complexity, of mastering multitude and avoiding its bastard chaos as effectively as possible.” +> +> -  Edsger Dijkstra diff --git a/en/arrays/README.md b/en/arrays/README.md index 2d09e7d1..1b57a54f 100644 --- a/en/arrays/README.md +++ b/en/arrays/README.md @@ -38,7 +38,7 @@ console.log(cars); // Result: ['Opel', 'Volvo', 'BMW'] ``` -{% hint style="warning" %} +{% hint style="working" %} Arrays are a special type of object. One can have [objects](../objects/) in an array. {% endhint %} diff --git a/en/arrays/for-each.md b/en/arrays/for-each.md index b522cf5a..d6307a2e 100644 --- a/en/arrays/for-each.md +++ b/en/arrays/for-each.md @@ -41,6 +41,6 @@ numbers.forEach(number => console.log(number * 2)); The `forEach` method does not modify the original array. It simply iterates over the elements of the array and executes the provided function for each element. -{% hint style="warning" %} +{% hint style="working" %} The `forEach()` method is not executed for the empty statement. {% endhint %} diff --git a/en/arrays/join.md b/en/arrays/join.md index fb5c6a52..a93e74a9 100644 --- a/en/arrays/join.md +++ b/en/arrays/join.md @@ -23,7 +23,7 @@ console.log(array.join(" ")); // Result: one two three four ``` -{% hint style="warning" %} +{% hint style="working" %} Any separator can be specified but the default one is a comma `(,)`. {% endhint %} diff --git a/en/arrays/pop.md b/en/arrays/pop.md index 5bfa1ae8..eed6de17 100644 --- a/en/arrays/pop.md +++ b/en/arrays/pop.md @@ -34,7 +34,7 @@ while (array.length > 0) { console.log(array); // Result: [] ``` -{% hint style="warning" %} +{% hint style="working" %} The `pop` method only works on arrays, and not on other objects that are similar to arrays such as arguments objects or NodeList objects. If you need to pop elements from one of these types of objects, you will need to convert it to an array first using the `Array.prototype.slice()` method. {% endhint %} diff --git a/en/arrays/shift.md b/en/arrays/shift.md index f1cd648b..d6b1e38e 100644 --- a/en/arrays/shift.md +++ b/en/arrays/shift.md @@ -30,6 +30,6 @@ while (array.length > 0) { console.log(array); // Result: [] ``` -{% hint style="warning" %} +{% hint style="working" %} The `shift` method only works on arrays, and not on other objects that are similar to arrays such as arguments objects or NodeList objects. If you need to shift elements from one of these types of objects, you will need to convert it to an array first using the `Array.prototype.slice()` method. {% endhint %} diff --git a/en/arrays/sort.md b/en/arrays/sort.md index 81a168da..692a0079 100644 --- a/en/arrays/sort.md +++ b/en/arrays/sort.md @@ -44,6 +44,6 @@ points.sort((a, b) => {return a-b}); // Result: [1, 5, 10, 25, 40, 100] ``` -{% hint style="warning" %} +{% hint style="working" %} The `sort()` method overrides the original array. {% endhint %} diff --git a/en/arrays/spread.md b/en/arrays/spread.md index a30454c8..75cac6b9 100644 --- a/en/arrays/spread.md +++ b/en/arrays/spread.md @@ -27,6 +27,6 @@ console.log(arr); //Result: [1, 2, 3, 4, 5, 6, 7] ``` -{% hint style="warning" %} +{% hint style="working" %} The spread operator only works in modern browsers that support the feature. If you need to support older browsers, you will need to use a transpiler like Babel to convert the spread operator syntax to equivalent ES5 code. {% endhint %} diff --git a/en/arrays/unshift.md b/en/arrays/unshift.md index 8905ed48..8e4d89af 100644 --- a/en/arrays/unshift.md +++ b/en/arrays/unshift.md @@ -14,7 +14,7 @@ array.unshift(-5); // 4 // RESULT: array = [-5 , 0, 5, 10]; ``` -{% hint style="warning" %} +{% hint style="working" %} The `unshift()` method overwrites the original array. {% endhint %} diff --git a/en/complexity/space-complexity.md b/en/complexity/space-complexity.md index 63035ae4..a07fb1cc 100644 --- a/en/complexity/space-complexity.md +++ b/en/complexity/space-complexity.md @@ -1,72 +1,72 @@ ---- -chapter: 8 -pageNumber: 55 -description: This chapter explains space complexity, which measures the memory usage of an algorithm relative to the input size. It includes examples in JavaScript to illustrate how different algorithms use memory. The focus is on understanding how the memory requirements change with varying input sizes. ---- - -# Space Complexity - -Space complexity is the amount of memory that a program takes to run with respect to the size of the input. - -In this chapter, we will learn about the following space complexities: - -- O(n) - linear space complexity -- O($n^2$) - quadratic space complexity -- O(1) - constant space complexity - -### **Linear Space Complexity: O(n)** -An algorithm has a linear space complexity if the amount of memory required to execute is proportional to the size of the input. - -**Example:** -```javascript -function squareElements(arr) { - const result = []; - for (let i = 0; i < arr.length; i++) { - result.push(arr[i] * arr[i]); - } - return result; -} - -const myArray = [1, 2, 3, 4, 5]; -console.log(squareElements(myArray)); // Output: [1, 4, 9, 16, 25] -``` -In this example, the space complexity is O(n) because the result array grows in proportion to the size of the input array `arr`. - - -### Quadratic Space Complexity (O($n^2$)) -The memory required grows proportionally to the square of the input size. - -**Example:** -```javascript -function createMatrix(n) { - const matrix = []; - for (let i = 0; i < n; i++) { - matrix[i] = []; - for (let j = 0; j < n; j++) { - matrix[i][j] = i + j; - } - } - return matrix; -} - -const matrix = createMatrix(3); -console.log(matrix); // Output: [[0, 1, 2], [1, 2, 3], [2, 3, 4]] -``` - -The space required grows quadratically with the input size `n`. - - -### **Constant Space Complexity (O(1))** -The memory required remains the same regardless of the input size. - -**Example:** -```javascript -function printCube(num) { - const result = num * num * num; - console.log(result); -} - -printCube(3); // Output: 27 -``` - -The space required does not depend on the input size. +--- +chapter: 8 +pageNumber: 55 +description: This chapter explains space complexity, which measures the memory usage of an algorithm relative to the input size. It includes examples in JavaScript to illustrate how different algorithms use memory. The focus is on understanding how the memory requirements change with varying input sizes. +--- + +# Space Complexity + +Space complexity is the amount of memory that a program takes to run with respect to the size of the input. + +In this chapter, we will learn about the following space complexities: + +- O(n) - linear space complexity +- O($n^2$) - quadratic space complexity +- O(1) - constant space complexity + +### **Linear Space Complexity: O(n)** +An algorithm has a linear space complexity if the amount of memory required to execute is proportional to the size of the input. + +**Example:** +```javascript +function squareElements(arr) { + const result = []; + for (let i = 0; i < arr.length; i++) { + result.push(arr[i] * arr[i]); + } + return result; +} + +const myArray = [1, 2, 3, 4, 5]; +console.log(squareElements(myArray)); // Output: [1, 4, 9, 16, 25] +``` +In this example, the space complexity is O(n) because the result array grows in proportion to the size of the input array `arr`. + + +### Quadratic Space Complexity (O($n^2$)) +The memory required grows proportionally to the square of the input size. + +**Example:** +```javascript +function createMatrix(n) { + const matrix = []; + for (let i = 0; i < n; i++) { + matrix[i] = []; + for (let j = 0; j < n; j++) { + matrix[i][j] = i + j; + } + } + return matrix; +} + +const matrix = createMatrix(3); +console.log(matrix); // Output: [[0, 1, 2], [1, 2, 3], [2, 3, 4]] +``` + +The space required grows quadratically with the input size `n`. + + +### **Constant Space Complexity (O(1))** +The memory required remains the same regardless of the input size. + +**Example:** +```javascript +function printCube(num) { + const result = num * num * num; + console.log(result); +} + +printCube(3); // Output: 27 +``` + +The space required does not depend on the input size. diff --git a/en/complexity/time-complexity.md b/en/complexity/time-complexity.md index 0d8cbe29..a92c41b3 100644 --- a/en/complexity/time-complexity.md +++ b/en/complexity/time-complexity.md @@ -1,56 +1,56 @@ ---- -chapter: 8 -pageNumber: 54 -description: Time complexity measures the efficiency of an algorithm by counting the number of steps it takes relative to the input size, rather than the actual running time, which can vary due to external factors. Big O notation is used to represent this complexity, helping to evaluate how an algorithm’s performance. ---- - -# Time Complexity - -Time complexity is a mathematical calculation to measure the amount of time an algorithm takes to complete considering the size of its input. -It helps in evaluating the efficiency of an algorithm by estimating the number of basic operations it performs. -**Big O notation**, is one of the ways to represent the time complexity. - -We might think of measuring an algorithm's time complexity by looking at how long it takes to run. -For example, if a program runs in 16 minutes, we might say its time complexity is 16 minutes. - -But this method is incorrect because the running time can vary depending on different factors like: - -- the device used -- the programming language -- the network -- and other conditions - -That's why we determine time complexity by counting the number of steps an algorithm takes for a given input size. For instance, - -If the time complexity is **O(n)**: - -- it takes 5 steps for an input size of 5 -- it takes 10 steps for an input size of 10 - -
- -### **Big O Notation** -Big Oh (Big O) is a mathematical notation used to represent the time complexity of an algorithm. -```javascript -let total = 0; -const n = 100; - -// iterate n times -for (let i = 1; i <= n; i++) { - total += i; -} - -console.log(total); -// Output: 5050 - -``` -The code takes n steps to run. Instead of using just plain n for time complexity, we use the O(n) notation—read as Big Oh of n—to represent it. - -### **Types of Big O** - -Some common types of Big O notations are as follows: - -- O(log n) - logarithmic time complexity -- O(n^2) - quadratic time complexity -- O(n) - linear time complexity -- O(1) - constant time complexity +--- +chapter: 8 +pageNumber: 54 +description: Time complexity measures the efficiency of an algorithm by counting the number of steps it takes relative to the input size, rather than the actual running time, which can vary due to external factors. Big O notation is used to represent this complexity, helping to evaluate how an algorithm’s performance. +--- + +# Time Complexity + +Time complexity is a mathematical calculation to measure the amount of time an algorithm takes to complete considering the size of its input. +It helps in evaluating the efficiency of an algorithm by estimating the number of basic operations it performs. +**Big O notation**, is one of the ways to represent the time complexity. + +We might think of measuring an algorithm's time complexity by looking at how long it takes to run. +For example, if a program runs in 16 minutes, we might say its time complexity is 16 minutes. + +But this method is incorrect because the running time can vary depending on different factors like: + +- the device used +- the programming language +- the network +- and other conditions + +That's why we determine time complexity by counting the number of steps an algorithm takes for a given input size. For instance, + +If the time complexity is **O(n)**: + +- it takes 5 steps for an input size of 5 +- it takes 10 steps for an input size of 10 + +
+ +### **Big O Notation** +Big Oh (Big O) is a mathematical notation used to represent the time complexity of an algorithm. +```javascript +let total = 0; +const n = 100; + +// iterate n times +for (let i = 1; i <= n; i++) { + total += i; +} + +console.log(total); +// Output: 5050 + +``` +The code takes n steps to run. Instead of using just plain n for time complexity, we use the O(n) notation—read as Big Oh of n—to represent it. + +### **Types of Big O** + +Some common types of Big O notations are as follows: + +- O(log n) - logarithmic time complexity +- O(n^2) - quadratic time complexity +- O(n) - linear time complexity +- O(1) - constant time complexity diff --git a/en/date-and-time.md b/en/date-and-time.md index 852553ee..ac14435a 100644 --- a/en/date-and-time.md +++ b/en/date-and-time.md @@ -24,7 +24,7 @@ new Date(year,month,day,hours,minutes,seconds,ms) new Date(milliseconds) ``` -{% hint style="warning" %} +{% hint style="working" %} Months can be specified from `0` to `11`, more than that will result in an overflow to the next year. {% endhint %} diff --git a/en/error-handling/async_errorhandling.md b/en/error-handling/async_errorhandling.md index 0423aa90..f8f835fd 100644 --- a/en/error-handling/async_errorhandling.md +++ b/en/error-handling/async_errorhandling.md @@ -1,186 +1,186 @@ ---- -chapter: 12 -pageNumber: 87 -description: Handling asynchronous errors is a bit more complex than synchronous errors. The issue is that the code that generates the error is not directly responsible for handling the error. Instead, the error will be handled by the callback function that is executed when the asynchronous operation is complete. ---- - -# Asynchronous Error Handling - -Handling asynchronous errors is a bit more complex than synchronous errors. The issue is that the code that generates the error is not directly responsible for handling the error. Instead, the error will be handled by the callback function that is executed when the asynchronous operation is complete. - -The example below shows how you can handle asynchronous errors: -## Examples - -A common example is when using the `fetch` API to download some data from a server. The `fetch` API returns a promise that resolves with the server response. If the server returns an error, the promise will reject with the error. - -#### Using `try...catch` with `async/await` - -Using `async/await` makes asynchronous code look and behave more like synchronous code, which can make it easier to read and understand. Here's how you can handle errors using `try...catch`: - -```javascript -async function fetchData(url) { - try { - let response = await fetch(url); - if (!response.ok) { - throw new Error(`HTTP error! status: ${response.status}`); - } - let data = await response.json(); - return data; - } catch (error) { - console.error('Error fetching data:', error); - } -} -``` - - -#### Handling errors with `.catch()` in Promises -When using Promises directly, you can handle errors using the `.catch()` method: - -```javascript - -fetch('https://api.example.com/data') - .then(response => { - if (!response.ok) { - throw new Error(`HTTP error! status: ${response.status}`); - } - return response.json(); - }) - .then(data => { - console.log(data); - }) - .catch(error => { - console.error('Error fetching data:', error); - }); - -``` - - -### Best Practices - -Always Handle Errors: Ensure that every asynchronous operation has error handling. - - -```javascript -async function fetchData(url) { - try { - let response = await fetch(url); - if (!response.ok) { - throw new Error(`HTTP error! status: ${response.status}`); - } - let data = await response.json(); - return data; - } catch (error) { - console.error('Error fetching data:', error); - } -} -``` - - -Use `try...catch` with `async/await:` This makes the code more readable and easier to maintain. - -```javascript -async function fetchData(url) { - try { - let response = await fetch(url); - if (!response.ok) { - throw new Error(`HTTP error! status: ${response.status}`); - } - let data = await response.json(); - return data; - } catch (error) { - console.error('Error fetching data:', error); - } -} -``` - - -#### Graceful Degradation: Provide fallback behavior or user-friendly error messages. - -```javascript -async function fetchData(url) { - try { - let response = await fetch(url); - if (!response.ok) { - throw new Error(`HTTP error! status: ${response.status}`); - } - let data = await response.json(); - return data; - } catch (error) { - console.error('Error fetching data:', error); - return { fallbackData: true }; // Fallback behavior - } -} -``` - - -#### Logging: Log errors for debugging and monitoring purposes. - -```javascript -async function fetchData(url) { - try { - let response = await fetch(url); - if (!response.ok) { - throw new Error(`HTTP error! status: ${response.status}`); - } - let data = await response.json(); - return data; - } catch (error) { - console.error('Error fetching data:', error); - // Log error to monitoring service - logErrorToService(error); - } -} - -function logErrorToService(error) { - // Implementation for logging error to a monitoring service -} -``` - - -#### Avoid Silent Failures: Ensure that errors are not swallowed silently; always log or handle them. - - -```javascript -async function fetchData(url) { - try { - let response = await fetch(url); - if (!response.ok) { - throw new Error(`HTTP error! status: ${response.status}`); - } - let data = await response.json(); - return data; - } catch (error) { - console.error('Error fetching data:', error); - } -} -``` - - - -#### Centralized Error Handling: Consider using a centralized error handling mechanism for larger applications. - - -```javascript -async function fetchData(url) { - try { - let response = await fetch(url); - if (!response.ok) { - throw new Error(`HTTP error! status: ${response.status}`); - } - let data = await response.json(); - return data; - } catch (error) { - handleError(error); - } -} - -function handleError(error) { - console.error('Error:', error); - // Centralized error handling logic -} -``` - - -Proper error handling in asynchronous operations is crucial for building resilient JavaScript applications. By following the examples and best practices outlined in this guide, you can ensure that your code gracefully handles errors, provides meaningful feedback to users, and maintains overall application stability. Always remember to handle errors in every asynchronous operation, use try...catch with async/await for readability, and implement centralized error handling for larger applications. With these strategies, you can effectively manage asynchronous errors and create more reliable and user-friendly applications. - - +--- +chapter: 12 +pageNumber: 87 +description: Handling asynchronous errors is a bit more complex than synchronous errors. The issue is that the code that generates the error is not directly responsible for handling the error. Instead, the error will be handled by the callback function that is executed when the asynchronous operation is complete. +--- + +# Asynchronous Error Handling + +Handling asynchronous errors is a bit more complex than synchronous errors. The issue is that the code that generates the error is not directly responsible for handling the error. Instead, the error will be handled by the callback function that is executed when the asynchronous operation is complete. + +The example below shows how you can handle asynchronous errors: +## Examples + +A common example is when using the `fetch` API to download some data from a server. The `fetch` API returns a promise that resolves with the server response. If the server returns an error, the promise will reject with the error. + +#### Using `try...catch` with `async/await` + +Using `async/await` makes asynchronous code look and behave more like synchronous code, which can make it easier to read and understand. Here's how you can handle errors using `try...catch`: + +```javascript +async function fetchData(url) { + try { + let response = await fetch(url); + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + let data = await response.json(); + return data; + } catch (error) { + console.error('Error fetching data:', error); + } +} +``` + + +#### Handling errors with `.catch()` in Promises +When using Promises directly, you can handle errors using the `.catch()` method: + +```javascript + +fetch('https://api.example.com/data') + .then(response => { + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + return response.json(); + }) + .then(data => { + console.log(data); + }) + .catch(error => { + console.error('Error fetching data:', error); + }); + +``` + + +### Best Practices + +Always Handle Errors: Ensure that every asynchronous operation has error handling. + + +```javascript +async function fetchData(url) { + try { + let response = await fetch(url); + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + let data = await response.json(); + return data; + } catch (error) { + console.error('Error fetching data:', error); + } +} +``` + + +Use `try...catch` with `async/await:` This makes the code more readable and easier to maintain. + +```javascript +async function fetchData(url) { + try { + let response = await fetch(url); + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + let data = await response.json(); + return data; + } catch (error) { + console.error('Error fetching data:', error); + } +} +``` + + +#### Graceful Degradation: Provide fallback behavior or user-friendly error messages. + +```javascript +async function fetchData(url) { + try { + let response = await fetch(url); + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + let data = await response.json(); + return data; + } catch (error) { + console.error('Error fetching data:', error); + return { fallbackData: true }; // Fallback behavior + } +} +``` + + +#### Logging: Log errors for debugging and monitoring purposes. + +```javascript +async function fetchData(url) { + try { + let response = await fetch(url); + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + let data = await response.json(); + return data; + } catch (error) { + console.error('Error fetching data:', error); + // Log error to monitoring service + logErrorToService(error); + } +} + +function logErrorToService(error) { + // Implementation for logging error to a monitoring service +} +``` + + +#### Avoid Silent Failures: Ensure that errors are not swallowed silently; always log or handle them. + + +```javascript +async function fetchData(url) { + try { + let response = await fetch(url); + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + let data = await response.json(); + return data; + } catch (error) { + console.error('Error fetching data:', error); + } +} +``` + + + +#### Centralized Error Handling: Consider using a centralized error handling mechanism for larger applications. + + +```javascript +async function fetchData(url) { + try { + let response = await fetch(url); + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + let data = await response.json(); + return data; + } catch (error) { + handleError(error); + } +} + +function handleError(error) { + console.error('Error:', error); + // Centralized error handling logic +} +``` + + +Proper error handling in asynchronous operations is crucial for building resilient JavaScript applications. By following the examples and best practices outlined in this guide, you can ensure that your code gracefully handles errors, provides meaningful feedback to users, and maintains overall application stability. Always remember to handle errors in every asynchronous operation, use try...catch with async/await for readability, and implement centralized error handling for larger applications. With these strategies, you can effectively manage asynchronous errors and create more reliable and user-friendly applications. + + diff --git a/en/error-handling/try...-catch.md b/en/error-handling/try...-catch.md index 7f274984..f97053b3 100644 --- a/en/error-handling/try...-catch.md +++ b/en/error-handling/try...-catch.md @@ -28,7 +28,7 @@ try { } ``` -{% hint style="warning" %} +{% hint style="working" %} `try...catch` works for runtime errors meaning that the code must be runnable and synchronous. {% endhint %} diff --git a/en/functions/README.md b/en/functions/README.md index a781d453..31ca98e5 100644 --- a/en/functions/README.md +++ b/en/functions/README.md @@ -42,7 +42,7 @@ An arrow function is a compact alternative to traditional functions which has so const double = (x) => 2 * x; ``` -{% hint style="warning" %} +{% hint style="working" %} The `this` keyword in the arrow function represents the object that defined the arrow function. {% endhint %} diff --git a/en/loops/while.md b/en/loops/while.md index a1fcbe02..08126627 100644 --- a/en/loops/while.md +++ b/en/loops/while.md @@ -24,6 +24,6 @@ while (i < 5) { } ``` -{% hint style="warning" %} +{% hint style="working" %} Be careful to avoid infinite looping if the condition is always true! {% endhint %} diff --git a/en/modules.md b/en/modules.md index 36d10b80..1fe1f469 100644 --- a/en/modules.md +++ b/en/modules.md @@ -57,7 +57,7 @@ const age = 30; export {name, age}; ``` -{% hint style="warning" %} +{% hint style="working" %} One can only have one default `export` in a file. {% endhint %} diff --git a/en/numbers/operators.md b/en/numbers/operators.md index cfa69dab..82fa3aca 100644 --- a/en/numbers/operators.md +++ b/en/numbers/operators.md @@ -84,7 +84,7 @@ console.log(12 % 3); // 0 The JavaScript interpreter works from left to right. One can use parentheses just like in math to separate and group expressions: `c = (a / b) + d` -{% hint style="warning" %} +{% hint style="working" %} JavaScript uses the `+` operator for both addition and concatenation. Numbers are added whereas strings are concatenated. {% endhint %} diff --git a/en/objects/delete.md b/en/objects/delete.md index e41763c6..16fbbb26 100644 --- a/en/objects/delete.md +++ b/en/objects/delete.md @@ -29,7 +29,7 @@ let prototypeAge = child.age; // 26, because child does not have its own age property. ``` -{% hint style="warning" %} +{% hint style="working" %} The `delete` operator only works on own properties of an object, and not on inherited properties. It also does not work on properties that have the `configurable` attribute set to `false`. {% endhint %} diff --git a/en/objects/mutable.md b/en/objects/mutable.md index 5124708d..8eebcb04 100644 --- a/en/objects/mutable.md +++ b/en/objects/mutable.md @@ -28,6 +28,6 @@ object.foo = 'quux'; // Modify property 'foo' delete object.baz; // Delete property 'baz' ``` -{% hint style="warning" %} +{% hint style="working" %} Primitive values (such as numbers and strings) are immutable, while objects (such as arrays and objects) are mutable. {% endhint %} diff --git a/en/promise-async-await/async-await.md b/en/promise-async-await/async-await.md index abc93ee1..efc6c1d9 100644 --- a/en/promise-async-await/async-await.md +++ b/en/promise-async-await/async-await.md @@ -42,6 +42,6 @@ async function f() { f(); ``` -{% hint style="warning" %} +{% hint style="working" %} The `await` keyword can only be used inside an `async` function. {% endhint %} diff --git a/en/promise-async-await/promise.md b/en/promise-async-await/promise.md index 050bb94f..2307f03c 100644 --- a/en/promise-async-await/promise.md +++ b/en/promise-async-await/promise.md @@ -34,7 +34,7 @@ The internal properties of `promise` object returned by the `new Promise` constr * `state` - initially `pending,` then changes to either `fulfill` upon `resolve` or `rejected` when `reject` is called * `result` - initially `undefined`, then changes to `value` upon `resolve` or `error` when `reject` is called -{% hint style="warning" %} +{% hint style="working" %} One cannot access promise properties: `state` and `result`. Promise methods are needed to handle promises. {% endhint %} @@ -87,6 +87,6 @@ let promiseThree = new Promise((resolve, reject) => { promiseThree.catch(alert); // shows "Error: Whoops!" after 1 second ``` -{% hint style="warning" %} +{% hint style="working" %} In the `Promise.then()` method, both callback arguments are optional. {% endhint %} diff --git a/en/regular-expression.md b/en/regular-expression.md index b7f4e11b..b87e76e2 100644 --- a/en/regular-expression.md +++ b/en/regular-expression.md @@ -208,7 +208,7 @@ Properties and methods supported by RegEx are listed below. | `test()` | Test for the match and returns the `true` or `false` | | `toString()` | Returns the string value of the regular exression | -{% hint style="warning" %} +{% hint style="working" %} A `complie()` method complies the regular expression and is deprecated. {% endhint %} diff --git a/en/strings/create.md b/en/strings/create.md index ddb10052..3d220daf 100644 --- a/en/strings/create.md +++ b/en/strings/create.md @@ -37,7 +37,7 @@ const message = `Hello, ${name}!`; Template literals can also contain multiple lines and can include any expression inside the placeholders. -{% hint style="warning" %} +{% hint style="working" %} Strings can not be subtracted, multiplied, or divided. {% endhint %} diff --git a/en/strings/length.md b/en/strings/length.md index ea7a470b..95624ce2 100644 --- a/en/strings/length.md +++ b/en/strings/length.md @@ -20,6 +20,6 @@ console.log(emptyStringSize); The length property of an empty string is `0`. -{% hint style="warning" %} +{% hint style="working" %} The `length` property is a read-only property, so you cannot assign a new value to it. {% endhint %} diff --git a/en/strings/replace.md b/en/strings/replace.md index 7e1c4adf..4cf18e02 100644 --- a/en/strings/replace.md +++ b/en/strings/replace.md @@ -15,7 +15,7 @@ console.log(new_str); // Result: Hi World! ``` -{% hint style="warning" %} +{% hint style="working" %} To replace a value on all instances of a [regular expression](../regular-expression.md) with a `g` modifier is set. {% endhint %} diff --git a/en/strings/substring.md b/en/strings/substring.md index ea13e69c..b8828a63 100644 --- a/en/strings/substring.md +++ b/en/strings/substring.md @@ -1,59 +1,59 @@ ---- -chapter: 4 -pageNumber: 38 ---- -# Substring - -The `string.substring()` is an inbuilt function in JavaScript that is used to return the part of the given string from the start index to the end index. Indexing start from zero `(0)`. - -Syntax: - -`string.substring(StartIndex, EndIndex)` - -### Syntax: - -* using `str.substr(start , length)` -* using the `substr()` method -* using the template `(``)` literal (introduced in [ES6](../es6-concepts/template-literals.md)) - -The `substr()` method takes in: - -* **parameters**: Here the StartIndex and EndIndex describe the part of the string to be taken as a substring. Here, the EndIndex is optional. -* **return value**: It returns a new string that is part of the given string. JavaScript code to show the working of `string.substring()` function: - -```javascript -//Example 1: -// JavaScript to illustrate substr() method - -const str = "GeeksforGeeks"; -const result = str.substring(8); -console.log(result); - - - -//Output -for - -``` - -```javascript - -//Example 2: -// Taking a string as letiable -let string = "geeksforgeeks"; -a = string.substring(-1) -b = string.substring(2.5) -c = string.substring(2.9) - -// Printing new string which are -// the part of the given string -console.log(a); -console.log(b); -console.log(c); - - -//Output -geeksforgeeks -eksforgeeks -eksforgeeks -``` +--- +chapter: 4 +pageNumber: 38 +--- +# Substring + +The `string.substring()` is an inbuilt function in JavaScript that is used to return the part of the given string from the start index to the end index. Indexing start from zero `(0)`. + +Syntax: + +`string.substring(StartIndex, EndIndex)` + +### Syntax: + +* using `str.substr(start , length)` +* using the `substr()` method +* using the template `(``)` literal (introduced in [ES6](../es6-concepts/template-literals.md)) + +The `substr()` method takes in: + +* **parameters**: Here the StartIndex and EndIndex describe the part of the string to be taken as a substring. Here, the EndIndex is optional. +* **return value**: It returns a new string that is part of the given string. JavaScript code to show the working of `string.substring()` function: + +```javascript +//Example 1: +// JavaScript to illustrate substr() method + +const str = "GeeksforGeeks"; +const result = str.substring(8); +console.log(result); + + + +//Output +for + +``` + +```javascript + +//Example 2: +// Taking a string as letiable +let string = "geeksforgeeks"; +a = string.substring(-1) +b = string.substring(2.5) +c = string.substring(2.9) + +// Printing new string which are +// the part of the given string +console.log(a); +console.log(b); +console.log(c); + + +//Output +geeksforgeeks +eksforgeeks +eksforgeeks +``` diff --git a/es/arrays/README.md b/es/arrays/README.md index 3880fe7d..6cb496b9 100644 --- a/es/arrays/README.md +++ b/es/arrays/README.md @@ -39,7 +39,7 @@ console.log(coches); // Resultado: ['Opel', 'Volvo', 'BMW'] ``` -{% hint style="warning" %} +{% hint style="working" %} Las matrices son un tipo especial de objeto. Uno puede tener [objetos](../objects/) en una matriz. {% endhint %} diff --git a/es/arrays/for-each.md b/es/arrays/for-each.md index c1d55364..1fff48f2 100644 --- a/es/arrays/for-each.md +++ b/es/arrays/for-each.md @@ -40,6 +40,6 @@ numeros.forEach(numero => console.log(numero * 2)); El método `forEach` no modifica la matriz original. Simplemente itera sobre los elementos de la matriz y ejecuta la función proporcionada para cada elemento. -{% hint style="warning" %} +{% hint style="working" %} El método `forEach()` no se ejecuta para la declaración vacía. {% endhint %} diff --git a/es/arrays/join.md b/es/arrays/join.md index ff05cd8c..838a9f1d 100644 --- a/es/arrays/join.md +++ b/es/arrays/join.md @@ -24,7 +24,7 @@ console.log(matriz.join(" ")); // Resultado: uno dos tres cuatro ``` -{% hint style="warning" %} +{% hint style="working" %} Se puede especificar cualquier separador pero el predeterminado es una coma `(,)`. {% endhint %} diff --git a/es/arrays/pop.md b/es/arrays/pop.md index 1a6c173a..6ab9b227 100644 --- a/es/arrays/pop.md +++ b/es/arrays/pop.md @@ -35,7 +35,7 @@ while (matriz.length > 0) { console.log(matriz); // Resultado: [] ``` -{% hint style="warning" %} +{% hint style="working" %} El método `pop` solo funciona en matrices, y no en otros objetos que sean similares a matrices, como objetos de argumentos u objetos NodeList. Si necesita extraer elementos de uno de estos tipos de objetos, primero deberá convertirlo en una matriz utilizando el método `Array.prototype.slice()`. {% endhint %} diff --git a/es/arrays/shift.md b/es/arrays/shift.md index 157983ef..c770da7d 100644 --- a/es/arrays/shift.md +++ b/es/arrays/shift.md @@ -30,5 +30,5 @@ while (array.length > 0) { console.log(array); // Resultado: [] ``` -{% hint style="warning" %} +{% hint style="working" %} El método `shift` solo funciona en matrices, y no en otros objetos que sean similares a matrices, como objetos de argumentos u objetos NodeList. Si necesita cambiar elementos de uno de estos tipos de objetos, primero deberá convertirlo en una matriz utilizando el método `Array.prototype.slice()`.{% endhint %} diff --git a/es/arrays/sort.md b/es/arrays/sort.md index c94c732a..99e5df40 100644 --- a/es/arrays/sort.md +++ b/es/arrays/sort.md @@ -45,6 +45,6 @@ puntos.sort((a, b) => {return a-b}); // Resultado: [1, 5, 10, 25, 40, 100] ``` -{% hint style="warning" %} +{% hint style="working" %} El método `sort()` anula la matriz original. {% endhint %} diff --git a/es/arrays/spread.md b/es/arrays/spread.md index 439d5368..1c7996aa 100644 --- a/es/arrays/spread.md +++ b/es/arrays/spread.md @@ -27,6 +27,6 @@ console.log(arr); //Resultado: [1, 2, 3, 4, 5, 6, 7] ``` -{% hint style="warning" %} +{% hint style="working" %} El operador de propagación solo funciona en navegadores modernos que admiten esta función. Si necesita admitir navegadores más antiguos, deberá utilizar un transpilador como Babel para convertir la sintaxis del operador de extensión a código ES5 equivalente. {% endhint %} diff --git a/es/arrays/unshift.md b/es/arrays/unshift.md index 5ca5d145..756c1f83 100644 --- a/es/arrays/unshift.md +++ b/es/arrays/unshift.md @@ -14,7 +14,7 @@ matriz.unshift(-5); // 4 // RESULTADO: matriz = [-5 , 0, 5, 10]; ``` -{% hint style="warning" %} +{% hint style="working" %} El método `unshift()` sobrescribe la matriz original. {% endhint %} diff --git a/es/date-and-time.md b/es/date-and-time.md index 1ca2ec50..8c70577a 100644 --- a/es/date-and-time.md +++ b/es/date-and-time.md @@ -25,7 +25,7 @@ new Date(año,mes,dia,hora,minutos,segundos,ms) new Date(milliseconds) ``` -{% hint style="warning" %} +{% hint style="working" %} Los meses se pueden especificar de `0` a `11`, más de eso resultará en un desbordamiento al año siguiente. {% endhint %} diff --git a/es/error-handling/try...-catch.md b/es/error-handling/try...-catch.md index ba8441f4..7d5001e3 100644 --- a/es/error-handling/try...-catch.md +++ b/es/error-handling/try...-catch.md @@ -29,7 +29,7 @@ try { } ``` -{% hint style="warning" %} +{% hint style="working" %} `try...catch` Funciona para errores de tiempo de ejecución, lo que significa que el código debe ser ejecutable y sincrónico. {% endhint %} diff --git a/es/functions/README.md b/es/functions/README.md index 40b87285..838dc15f 100644 --- a/es/functions/README.md +++ b/es/functions/README.md @@ -43,7 +43,7 @@ Una función de flecha es una alternativa compacta a las funciones tradicionales const double = (x) => 2 * x; ``` -{% hint style="warning" %} +{% hint style="working" %} La palabra clave `this` en la función de flecha representa el objeto que definió la función de flecha. {% endhint %} diff --git a/es/loops/while.md b/es/loops/while.md index dc2dd4ce..cfffea81 100644 --- a/es/loops/while.md +++ b/es/loops/while.md @@ -24,6 +24,6 @@ while (i < 5) { } ``` -{% hint style="warning" %} +{% hint style="working" %} ¡Tenga cuidado de evitar bucles infinitos si la condición siempre es verdadera! {% endhint %} diff --git a/es/modules.md b/es/modules.md index cd86bc2d..8ab49be2 100644 --- a/es/modules.md +++ b/es/modules.md @@ -58,7 +58,7 @@ const age = 30; export {name, age}; ``` -{% hint style="warning" %} +{% hint style="working" %} Solo se puede tener una `export` predeterminada en un archivo. {% endhint %} diff --git a/es/numbers/operators.md b/es/numbers/operators.md index 85855968..c886da44 100644 --- a/es/numbers/operators.md +++ b/es/numbers/operators.md @@ -84,7 +84,7 @@ console.log(12 % 3); // 0 El intérprete de JavaScript funciona de izquierda a derecha. Se pueden utilizar paréntesis, como en matemáticas, para separar y agrupar expresiones.: `c = (a / b) + d` -{% hint style="warning" %} +{% hint style="working" %} JavaScript utiliza el operador `+` tanto para la suma como para la concatenación. Los números se suman mientras que las cadenas se concatenan. {% endhint %} diff --git a/es/objects/delete.md b/es/objects/delete.md index a3432352..51c11381 100644 --- a/es/objects/delete.md +++ b/es/objects/delete.md @@ -29,7 +29,7 @@ let prototipoEdad = niño.edad; // 26, porque el niño no tiene su propia propiedad de edad. ``` -{% hint style="warning" %} +{% hint style="working" %} El operador `delete` solo funciona con las propiedades propias de un objeto y no con las propiedades heredadas. Tampoco funciona en propiedades que tienen el atributo `configurable` establecido en `false`. {% endhint %} diff --git a/es/objects/mutable.md b/es/objects/mutable.md index 237b2e0a..302acc2b 100644 --- a/es/objects/mutable.md +++ b/es/objects/mutable.md @@ -28,6 +28,6 @@ objeto.foo = 'quux'; // Modifica la propiedad 'foo' delete objeto.baz; // Borra la propiedad 'baz' ``` -{% hint style="warning" %} +{% hint style="working" %} Los valores primitivos (como números y cadenas) son inmutables, mientras que los objetos (como matrices y objetos) son mutables. {% endhint %} diff --git a/es/promise-async-await/async-await.md b/es/promise-async-await/async-await.md index 222b2ae0..610be82b 100644 --- a/es/promise-async-await/async-await.md +++ b/es/promise-async-await/async-await.md @@ -42,6 +42,6 @@ async function f() { f(); ``` -{% hint style="warning" %} +{% hint style="working" %} La palabra clave `await` solo se puede usar dentro de una función `async`. {% endhint %} diff --git a/es/promise-async-await/promise.md b/es/promise-async-await/promise.md index 1c68209e..4a6751d6 100644 --- a/es/promise-async-await/promise.md +++ b/es/promise-async-await/promise.md @@ -34,7 +34,7 @@ Las propiedades internas del objeto `promise` devuelta por el constructor `new P * `state` - inicialmente `pending`, luego cambia a `fulfill` al resolverse o `rejected` cuando se llama a `reject` * `result` - inicialmente `undefined`, luego cambia a `value` al resolverse `resolve` o `error` cuando se llama a `reject` -{% hint style="warning" %} +{% hint style="working" %} No se puede acceder a las propiedades de la promesa: `state` y `result`. Se necesitan métodos de promesa para manejar las promesas. {% endhint %} @@ -87,6 +87,6 @@ let promesaTres = new Promise((resuelve, rechaza) => { promesaTres.catch(alert); // muestra "Error: ¡vaya!" después de un segundo ``` -{% hint style="warning" %} +{% hint style="working" %} En el método `Promise.then()`, ambas retrollamadas son opcionales. {% endhint %} diff --git a/es/regular-expression.md b/es/regular-expression.md index 0b2c16ff..d28f105a 100644 --- a/es/regular-expression.md +++ b/es/regular-expression.md @@ -209,7 +209,7 @@ Las propiedades y métodos admitidos por RegEx se enumeran a continuación. | `test()` | Prueba la coincidencia y devuelve `true` o `false` | | `toString()` | Devuelve el valor de cadena de la expresión regular. | -{% hint style="warning" %} +{% hint style="working" %} Un método `compile()` compila la expresión regular y está en desuso. {% endhint %} diff --git a/es/strings/create.md b/es/strings/create.md index 73c7d17d..6e4ff44c 100644 --- a/es/strings/create.md +++ b/es/strings/create.md @@ -37,7 +37,7 @@ const mensaje = `¡Hola, ${nombre}!`; Los literales de plantilla también pueden contener varias líneas y pueden incluir cualquier expresión dentro de los marcadores de posición. -{% hint style="warning" %} +{% hint style="working" %} Las cadenas no se pueden restar, multiplicar ni dividir. {% endhint %} diff --git a/es/strings/length.md b/es/strings/length.md index 4da77d8a..17a249c1 100644 --- a/es/strings/length.md +++ b/es/strings/length.md @@ -20,6 +20,6 @@ console.log(emptyStringSize); La propiedad length de una cadena vacía es `0`. -{% hint style="warning" %} +{% hint style="working" %} La propiedad `length` es una propiedad de solo lectura, así que no puede asignarle un nuevo valor. {% endhint %} diff --git a/es/strings/replace.md b/es/strings/replace.md index 71006267..83b8a01e 100644 --- a/es/strings/replace.md +++ b/es/strings/replace.md @@ -15,7 +15,7 @@ console.log(new_str); // Resultado: ¡Hey, mundo! ``` -{% hint style="warning" %} +{% hint style="working" %} Para reemplazar un valor en todas las instancias de una [expresión regular](../regular-expression.md) se establece con un modificador `g`. {% endhint %} diff --git a/fr/arrays/README.md b/fr/arrays/README.md index c2eba29c..66becf33 100644 --- a/fr/arrays/README.md +++ b/fr/arrays/README.md @@ -39,7 +39,7 @@ console.log(cars); // Résultat: ['Opel', 'Volvo', 'BMW'] ``` -{% hint style="warning" %} +{% hint style="working" %} Les tableaux sont un type spécial d'objets. On peut même stocker des [objects](../objects/) dans un tableau. {% endhint %} diff --git a/fr/arrays/for-each.md b/fr/arrays/for-each.md index 5d790f0d..0f5fa2a5 100644 --- a/fr/arrays/for-each.md +++ b/fr/arrays/for-each.md @@ -41,6 +41,6 @@ numbers.forEach((number) => console.log(number * 2)); La méthode `forEach` ne modifie pas le tableau original. Elle itère simplement les éléments les uns après les autres et exécute le colback sur chacun d'entre eux. -{% hint style="warning" %} +{% hint style="working" %} La méthode `forEach()` n'est pas exécutée dans le cas d'une instruction vide. {% endhint %} diff --git a/fr/arrays/join.md b/fr/arrays/join.md index 04183246..2e8bee5c 100644 --- a/fr/arrays/join.md +++ b/fr/arrays/join.md @@ -24,7 +24,7 @@ console.log(array.join(" ")); // Résultat: one two three four ``` -{% hint style="warning" %} +{% hint style="working" %} N'importe quel séparateur peut-être spécifié, mais la virgule est le séparateur par défaut `(,)`. {% endhint %} diff --git a/fr/arrays/pop.md b/fr/arrays/pop.md index 6ac7548c..45260a9e 100644 --- a/fr/arrays/pop.md +++ b/fr/arrays/pop.md @@ -35,6 +35,6 @@ while (array.length > 0) { console.log(array); // Résultat: [] ``` -{% hint style="warning" %} +{% hint style="working" %} La méthode `pop` ne fonctionne que sur les tableaux, et non sur d'autres objets similaires aux tableaux tels que les objets arguments ou les objets NodeList. Si vous devez extraire des éléments de l'un de ces types d'objets, vous devrez d'abord le convertir en tableau à l'aide de la méthode `Array.prototype.slice()`. {% endhint %} diff --git a/fr/arrays/shift.md b/fr/arrays/shift.md index 1cf2d74b..7e4e633a 100644 --- a/fr/arrays/shift.md +++ b/fr/arrays/shift.md @@ -31,6 +31,6 @@ while (array.length > 0) { console.log(array); // Résultat: [] ``` -{% hint style="warning" %} +{% hint style="working" %} La méthode `shift` ne fonctionne que sur les tableaux, et pas sur d'autres objets similaires aux tableaux tels que les objets arguments ou les objets NodeList. Si vous devez déplacer des éléments de l'un de ces types d'objets, vous devrez d'abord le convertir en tableau à l'aide de la méthode `Array.prototype.slice()`. {% endhint %} diff --git a/fr/arrays/sort.md b/fr/arrays/sort.md index af8706aa..3fff80fb 100644 --- a/fr/arrays/sort.md +++ b/fr/arrays/sort.md @@ -46,6 +46,6 @@ points.sort((a, b) => { // Résultat: [1, 5, 10, 25, 40, 100] ``` -{% hint style="warning" %} +{% hint style="working" %} La méthode `sort()` écrase le tableau original. {% endhint %} diff --git a/fr/arrays/spread.md b/fr/arrays/spread.md index 2959c4d2..8a1717f8 100644 --- a/fr/arrays/spread.md +++ b/fr/arrays/spread.md @@ -27,6 +27,6 @@ arr = [...arr, ...arr1]; console.log(arr); //Résultat: [1, 2, 3, 4, 5, 6, 7] ``` -{% hint style="warning" %} +{% hint style="working" %} L'opérateur de décomposition spread fonctionne uniquement avec les navigateurs modernes qui supportent la fonctionnalités. Si vous souhaitez l'utiliser avec d'anciens navigateurs, vous devrez utiliser un transpiler comme Babel pour convertir la syntaxe du spread dans son équivalent ES5. {% endhint %} diff --git a/fr/arrays/unshift.md b/fr/arrays/unshift.md index 59d31e38..3764af43 100644 --- a/fr/arrays/unshift.md +++ b/fr/arrays/unshift.md @@ -15,7 +15,7 @@ array.unshift(-5); // 4 // RESULT: array = [-5 , 0, 5, 10]; ``` -{% hint style="warning" %} +{% hint style="working" %} La méthode `unshift()` écrase le tableau d'origine. {% endhint %} diff --git a/fr/date-and-time.md b/fr/date-and-time.md index 52c05e01..9ad5d2e4 100644 --- a/fr/date-and-time.md +++ b/fr/date-and-time.md @@ -25,7 +25,7 @@ new Date(year,month,day,hours,minutes,seconds,ms) new Date(milliseconds) ``` -{% hint style="warning" %} +{% hint style="working" %} Les mois sont spécifiés de `0` à `11`, si on excède ces index, on débordera sur l'année suivante. {% endhint %} diff --git a/fr/error-handling/try...-catch.md b/fr/error-handling/try...-catch.md index d092ee37..e2ebd80c 100644 --- a/fr/error-handling/try...-catch.md +++ b/fr/error-handling/try...-catch.md @@ -35,7 +35,7 @@ try { } ``` -{% hint style="warning" %} +{% hint style="working" %} `try...catch` fonctionne pour les erreurs d'exécution, ce qui signifie que le code doit être exécutable et synchrone. {% endhint %} diff --git a/fr/functions/README.md b/fr/functions/README.md index 73dabd62..b41eefa1 100644 --- a/fr/functions/README.md +++ b/fr/functions/README.md @@ -43,6 +43,6 @@ Une fonction fléchée est une alternative compacte aux fonctions traditionnelle const double = (x) => 2 * x; ``` -{% hint style="warning" %} +{% hint style="working" %} Le mot-clé `this` dans la fonction fléchée représente l'objet qui a défini la fonction arrow. {% endhint %} diff --git a/fr/loops/while.md b/fr/loops/while.md index 67a79f0e..e3df3f28 100644 --- a/fr/loops/while.md +++ b/fr/loops/while.md @@ -28,6 +28,6 @@ while (i < 5) { console.log(x); ``` -{% hint style="warning" %} +{% hint style="working" %} Faites attention d'éviter les boucles infinies qui arrivent lorsque la condition est indéfiniment évaluée à vraie. {% endhint %} diff --git a/fr/modules.md b/fr/modules.md index 7fb5f931..5439e6f6 100644 --- a/fr/modules.md +++ b/fr/modules.md @@ -58,7 +58,7 @@ const age = 30; export { name, age }; ``` -{% hint style="warning" %} +{% hint style="working" %} On ne peut avoir qu'un seul `export` par défaut dans un fichier. {% endhint %} diff --git a/fr/numbers/operators.md b/fr/numbers/operators.md index a7b98187..cc61c4bf 100644 --- a/fr/numbers/operators.md +++ b/fr/numbers/operators.md @@ -46,7 +46,7 @@ console.log(12 % 3); // 0 L'interpréteur JavaScript fonctionne de la gauche vers la droite. Il est donc impératif d'utiliser les parenthèses pour séparer et regrouper les expressions: `c = (a / b) + d` -{% hint style="warning" %} +{% hint style="working" %} En JavaScript on utilise aussi bien l'opérateur d'addition `+` pour réaliser des calculs que des concaténations. L'usage est implicite en fonction du type: les nombres seront additionnés, alors que les chaînes de caractères seront concaténées. {% endhint %} diff --git a/fr/objects/delete.md b/fr/objects/delete.md index 0b8b3a26..c1152a34 100644 --- a/fr/objects/delete.md +++ b/fr/objects/delete.md @@ -28,7 +28,7 @@ let prototypeAge = child.age; // 26, car child n'a pas de propriété age. ``` -{% hint style="warning" %} +{% hint style="working" %} L'opérateur `delete` marche uniquement sur les propriétés de l'objet (définis sur l'objet) mais pas ceux qui sont hérités. Il ne marche pas non plus sur les propriété qui ont l'attribut `configurable` mis à `false`. {% endhint %} diff --git a/fr/objects/mutable.md b/fr/objects/mutable.md index 92fee7b2..270cbcd8 100644 --- a/fr/objects/mutable.md +++ b/fr/objects/mutable.md @@ -31,6 +31,6 @@ object.foo = 'quux'; // Changer la propriété 'foo' delete object.baz; // Supprimer la propriété 'baz' ``` -{% hint style="warning" %} +{% hint style="working" %} Les valeurs primitives comme les nombres et les chaînes sont immutables tandis que les objets comme les tableaux sont mutables. {% endhint %} diff --git a/fr/promise-async-await/async-await.md b/fr/promise-async-await/async-await.md index 3c3d2c63..d8cd13a2 100644 --- a/fr/promise-async-await/async-await.md +++ b/fr/promise-async-await/async-await.md @@ -41,6 +41,6 @@ async function f() { f(); ``` -{% hint style="warning" %} +{% hint style="working" %} Le mot clé `await` net peut être utilisé que dans une fonction déclarée avec `async`. {% endhint %} diff --git a/fr/promise-async-await/promise.md b/fr/promise-async-await/promise.md index 8738bdec..0e4f8961 100644 --- a/fr/promise-async-await/promise.md +++ b/fr/promise-async-await/promise.md @@ -35,7 +35,7 @@ Les propriétés internes de la promesse retournée par l'appel du constructeur * `state` - initialement `pending` (en cours), ensuite change à soit `fulfill` (accomplie) lorsque `resolve` est appelée, soit `rejected` (rejetée) lorsque c'est `reject` qui est appelée. * `result` - initialement `undefined`, ensuite change à `value` en cas d'appel à `resolve` ou `error` lorsque c'est `reject` qui est appelée. -{% hint style="warning" %} +{% hint style="working" %} Nous ne pouvons pas accéder aux propriétés : `state` et `result`. Les méthodes spécifiques au type Promise sont nécessaires pour gérer les promesses. {% endhint %} @@ -90,6 +90,6 @@ let promiseThree = new Promise((resolve, reject) => { promiseThree.catch(alert); // montre l'erreur "Error: Whoops!" après une seconde ``` -{% hint style="warning" %} +{% hint style="working" %} Dans la méthode `Promise.then()`, toutes les deux fonctions de callback sont optionels. {% endhint %} diff --git a/fr/regular-expression.md b/fr/regular-expression.md index 8a572703..256edc9a 100644 --- a/fr/regular-expression.md +++ b/fr/regular-expression.md @@ -83,7 +83,7 @@ Les propriétés et les méthodes supportées par les regex sont listées ci-des | `test()` | Teste la correspondance et renvoie `true` ou `false` | | `toString()` | Renvoie la valeur de chaîne de l'expression régulière | -{% hint style="warning" %} +{% hint style="working" %} La méthode `compile()` recompile une expression régulière et est dépréciée. Elle ne doit plus être utilisée. {% endhint %} diff --git a/fr/strings/create.md b/fr/strings/create.md index b83bfc33..6b8a2c2e 100644 --- a/fr/strings/create.md +++ b/fr/strings/create.md @@ -39,7 +39,7 @@ const message = `Hello, ${name}!`; Les littéraux de gabarit peuvent également contenir plusieurs lignes et inclure des expressions au sein des espaces réservés. -{% hint style="warning" %} +{% hint style="working" %} Les chaînes de caractères ne peuvent être soustraites, multipliées ou divisées. {% endhint %} diff --git a/fr/strings/length.md b/fr/strings/length.md index a9413c5e..56e7403e 100644 --- a/fr/strings/length.md +++ b/fr/strings/length.md @@ -19,6 +19,6 @@ console.log(emptyStringSize); La propriété `length` d'une chaîne vide est `0`. -{% hint style="warning" %} +{% hint style="working" %} La propriété `length`est en lecture seule, cela signifie qu'il est impossible de lui assigner une nouvelle valeur. {% endhint %} diff --git a/fr/strings/replace.md b/fr/strings/replace.md index 110e34d2..bdc08ff5 100644 --- a/fr/strings/replace.md +++ b/fr/strings/replace.md @@ -16,7 +16,7 @@ console.log(new_str); // Resultat: Hi World! ``` -{% hint style="warning" %} +{% hint style="working" %} Pour remplacer une valeur sur l'ensemble des occurrences d'une [expression régulière](../regular-expression.md) on devra indiquer un drapeau `g`. {% endhint %} diff --git a/id/arrays/README.md b/id/arrays/README.md index 59cb5d6a..af0c2234 100644 --- a/id/arrays/README.md +++ b/id/arrays/README.md @@ -39,7 +39,7 @@ console.log(cars); // Result: ['Opel', 'Volvo', 'BMW'] ``` -{% hint style="warning" %} +{% hint style="working" %} Array adalah tipe objek khusus. Anda dapat memiliki [objek](../objects/) dalam sebuah array. {% endhint %} diff --git a/id/arrays/for-each.md b/id/arrays/for-each.md index 6ba82868..7c0fc2cf 100644 --- a/id/arrays/for-each.md +++ b/id/arrays/for-each.md @@ -41,6 +41,6 @@ numbers.forEach((number) => console.log(number * 2)); Metode `forEach` tidak memodifikasi array asli. Ia hanya mengulanginya melalui elemen-elemen dalam array dan menjalankan fungsi yang diberikan untuk setiap elemen. -{% hint style="warning" %} +{% hint style="working" %} Metode `forEach()` tidak akan dieksekusi jika tidak ada pernyataan (statement) dalamnya. {% endhint %} diff --git a/id/arrays/join.md b/id/arrays/join.md index e3a5639a..4b321b56 100644 --- a/id/arrays/join.md +++ b/id/arrays/join.md @@ -24,7 +24,7 @@ console.log(array.join(" ")); // Hasil: satu dua tiga empat ``` -{% hint style="warning" %} +{% hint style="working" %} Anda dapat menentukan pemisah apa pun, tetapi yang default adalah koma (`,`). {% endhint %} diff --git a/id/arrays/pop.md b/id/arrays/pop.md index 985ca17d..042408cf 100644 --- a/id/arrays/pop.md +++ b/id/arrays/pop.md @@ -35,7 +35,7 @@ while (array.length > 0) { console.log(array); // Result: [] ``` -{% hint style="warning" %} +{% hint style="working" %} Metode `pop` hanya berfungsi pada array, dan tidak pada objek lain yang mirip dengan array, seperti objek arguments atau objek NodeList. Jika Anda perlu menghapus elemen dari salah satu jenis objek ini, Anda perlu mengonversinya menjadi array terlebih dahulu menggunakan metode `Array.prototype.slice()`. {% endhint %} diff --git a/id/arrays/shift.md b/id/arrays/shift.md index 89beb5ef..79067d5f 100644 --- a/id/arrays/shift.md +++ b/id/arrays/shift.md @@ -31,6 +31,6 @@ while (array.length > 0) { console.log(array); // Result: [] ``` -{% hint style="warning" %} +{% hint style="working" %} Metode `shift` hanya berfungsi pada array, dan tidak pada objek lain yang mirip dengan array seperti objek arguments atau objek NodeList. Jika Anda perlu melakukan shift elemen dari salah satu jenis objek ini, Anda perlu mengonversinya menjadi array terlebih dahulu menggunakan metode `Array.prototype.slice()`. {% endhint %} diff --git a/id/arrays/sort.md b/id/arrays/sort.md index 45ee0ad3..b253049b 100644 --- a/id/arrays/sort.md +++ b/id/arrays/sort.md @@ -43,6 +43,6 @@ points.sort((a, b) => { // Hasil: [1, 5, 10, 25, 40, 100] ``` -{% hint style="warning" %} +{% hint style="working" %} Metode `sort()` mengganti array asli. {% endhint %} diff --git a/id/arrays/spread.md b/id/arrays/spread.md index 2bc635af..a80380e8 100644 --- a/id/arrays/spread.md +++ b/id/arrays/spread.md @@ -27,6 +27,6 @@ arr = [...arr, ...arr1]; console.log(arr); //Hasil: [1, 2, 3, 4, 5, 6, 7] ``` -{% hint style="warning" %} +{% hint style="working" %} Operator spread hanya berfungsi di peramban modern yang mendukung fitur tersebut. Jika Anda perlu mendukung peramban yang lebih tua, Anda perlu menggunakan transpiler seperti Babel untuk mengonversi sintaks operator spread menjadi kode ES5 yang setara. {% endhint %} diff --git a/id/arrays/unshift.md b/id/arrays/unshift.md index 450c809c..3b18616b 100644 --- a/id/arrays/unshift.md +++ b/id/arrays/unshift.md @@ -15,7 +15,7 @@ array.unshift(-5); // 4 // HASIL: array = [-5 , 0, 5, 10]; ``` -{% hint style="warning" %} +{% hint style="working" %} Metode `unshift()` menimpa array asli. {% endhint %} diff --git a/id/date-and-time.md b/id/date-and-time.md index 26244ba9..cef5c40b 100644 --- a/id/date-and-time.md +++ b/id/date-and-time.md @@ -25,7 +25,7 @@ new Date(tahun, bulan, hari, jam, menit, detik, ms) new Date(milidetik) ``` -{% hint style="warning" %} +{% hint style="working" %} Bulan dapat ditentukan dari `0` hingga `11`, lebih dari itu akan mengakibatkan overflow ke tahun berikutnya. {% endhint %} diff --git a/id/error-handling/try...-catch.md b/id/error-handling/try...-catch.md index 191039d6..79b3a945 100644 --- a/id/error-handling/try...-catch.md +++ b/id/error-handling/try...-catch.md @@ -35,7 +35,7 @@ try { } ``` -{% hint style="warning" %} +{% hint style="working" %} `try...catch` bekerja untuk kesalahan saat runtime, yang berarti kode harus dapat dijalankan dan bersifat sinkron. {% endhint %} diff --git a/id/functions/README.md b/id/functions/README.md index 128fc31b..61f6ebd6 100644 --- a/id/functions/README.md +++ b/id/functions/README.md @@ -43,6 +43,6 @@ Fungsi panah adalah alternatif ringkas untuk fungsi tradisional yang memiliki be const double = (x) => 2 * x; ``` -{% hint style="warning" %} +{% hint style="working" %} Kata kunci `this` dalam fungsi panah mewakili objek yang mendefinisikan fungsi panah tersebut. {% endhint %} diff --git a/id/loops/while.md b/id/loops/while.md index f845d0e6..ea0a8997 100644 --- a/id/loops/while.md +++ b/id/loops/while.md @@ -25,6 +25,6 @@ while (i < 5) { } ``` -{% hint style="warning" %} +{% hint style="working" %} Hati-hati untuk menghindari perulangan tak terbatas jika kondisinya selalu benar! {% endhint %} diff --git a/id/modules.md b/id/modules.md index b5a32e29..79488bf1 100644 --- a/id/modules.md +++ b/id/modules.md @@ -58,7 +58,7 @@ const age = 30; export { name, age }; ``` -{% hint style="warning" %} +{% hint style="working" %} Hanya dapat ada satu ekspor `default` dalam satu file. {% endhint %} diff --git a/id/numbers/operators.md b/id/numbers/operators.md index 75b2c5bd..fd90b034 100644 --- a/id/numbers/operators.md +++ b/id/numbers/operators.md @@ -84,7 +84,7 @@ console.log(12 % 3); // 0 Penerjemah JavaScript bekerja dari kiri ke kanan. Seseorang dapat menggunakan tanda kurung seperti dalam matematika untuk memisahkan dan mengelompokkan ekspresi: `c = (a / b) + d` -{% hint style="warning" %} +{% hint style="working" %} JavaScript menggunakan operator `+` baik untuk penambahan maupun penggabungan (konkatenasi). Angka ditambahkan sementara string digabungkan. {% endhint %} diff --git a/id/objects/delete.md b/id/objects/delete.md index c5956e5e..99a9dd79 100644 --- a/id/objects/delete.md +++ b/id/objects/delete.md @@ -30,7 +30,7 @@ let usiaPrototipe = anak.usia; // 26, karena anak tidak memiliki properti usia sendiri. ``` -{% hint style="warning" %} +{% hint style="working" %} Operator `delete` hanya berfungsi pada properti sendiri dari objek, dan tidak pada properti yang diwarisi. Ini juga tidak berfungsi pada properti yang memiliki atribut `configurable` yang diatur ke `false`. {% endhint %} diff --git a/id/objects/mutable.md b/id/objects/mutable.md index c994ca62..2ce0b1ea 100644 --- a/id/objects/mutable.md +++ b/id/objects/mutable.md @@ -29,6 +29,6 @@ objek.foo = "quux"; // Mengubah properti 'foo' delete objek.baz; // Menghapus properti 'baz' ``` -{% hint style="warning" %} +{% hint style="working" %} Nilai primitif (seperti angka dan string) adalah immutable, sedangkan objek (seperti array dan objek) adalah mutable. {% endhint %} diff --git a/id/promise-async-await/async-await.md b/id/promise-async-await/async-await.md index 936d9ff8..b660081a 100644 --- a/id/promise-async-await/async-await.md +++ b/id/promise-async-await/async-await.md @@ -42,6 +42,6 @@ async function f() { f(); ``` -{% hint style="warning" %} +{% hint style="working" %} Kata kunci `await` hanya dapat digunakan di dalam fungsi `async`. {% endhint %} diff --git a/id/promise-async-await/promise.md b/id/promise-async-await/promise.md index 228eafc8..5cde4b85 100644 --- a/id/promise-async-await/promise.md +++ b/id/promise-async-await/promise.md @@ -36,7 +36,7 @@ Properti internal objek `promise` yang dikembalikan oleh konstruktor `new Promis - `state` - awalnya `pending,` kemudian berubah menjadi `fulfill` saat `resolve` atau `rejected` saat `reject` dipanggil - `result` - awalnya `undefined`, kemudian berubah menjadi `value` saat `resolve` atau `error` saat `reject` dipanggil -{% hint style="warning" %} +{% hint style="working" %} Tidak dapat mengakses properti `promise`: `state` dan `result`. Diperlukan metode promise untuk menangani promise. {% endhint %} @@ -89,6 +89,6 @@ let promiseTiga = new Promise((resolve, reject) => { promiseTiga.catch(alert); // menampilkan "Error: Whoops!" setelah 1 detik ``` -{% hint style="warning" %} +{% hint style="working" %} Pada metode `Promise.then()`, kedua argumen panggilan balik adalah opsional. {% endhint %} diff --git a/id/regular-expression.md b/id/regular-expression.md index c3681324..f7c88e55 100644 --- a/id/regular-expression.md +++ b/id/regular-expression.md @@ -86,7 +86,7 @@ Properti dan metode yang didukung oleh RegEx tercantum di bawah ini. | `test()` | Uji kecocokan dan mengembalikan `true` atau `false` | | `toString()` | Mengembalikan nilai string dari ekspresi reguler | -{% hint style="warning" %} +{% hint style="working" %} Metode `complie()` mengompilasi ekspresi reguler dan sudah tidak digunakan lagi. {% endhint %} diff --git a/id/strings/create.md b/id/strings/create.md index 8919a3dd..6dd81c3b 100644 --- a/id/strings/create.md +++ b/id/strings/create.md @@ -38,6 +38,6 @@ const message = `Halo, ${name}!`; Literal template juga dapat berisi beberapa baris dan dapat mencakup ekspresi apa pun di dalam placeholder. -{% hint style="warning" %} +{% hint style="working" %} String tidak dapat dikurangkan, dikalikan, atau dibagi. {% endhint %} diff --git a/id/strings/length.md b/id/strings/length.md index 613fe344..794bdfd5 100644 --- a/id/strings/length.md +++ b/id/strings/length.md @@ -19,6 +19,6 @@ console.log(ukuranStringKosong); Properti panjang dari string kosong adalah `0`. -{% hint style="warning" %} +{% hint style="working" %} Properti `length` adalah properti hanya-baca, sehingga Anda tidak dapat memberikan nilai baru kepadanya. {% endhint %} diff --git a/id/strings/replace.md b/id/strings/replace.md index 9a4d7915..142b0c95 100644 --- a/id/strings/replace.md +++ b/id/strings/replace.md @@ -16,7 +16,7 @@ console.log(new_str); // Hasil: Hi Dunia! ``` -{% hint style="warning" %} +{% hint style="working" %} Untuk mengganti nilai pada semua instansi dari ekspresi reguler, tambahkan modifikasi `g`. {% endhint %} diff --git a/np/Dedication.md b/np/Dedication.md index 7bb16982..4c7328c1 100644 --- a/np/Dedication.md +++ b/np/Dedication.md @@ -1,13 +1,13 @@ ---- -pageNumber: I -chapter: ---- - -# समर्पण - -यो पुस्तक हाम्रो संसारमा कम्प्युटर र प्रोग्रामिंग भाषाहरूको भावनाको सम्मान र प्रशंसामा समर्पित छ। - -> "प्रोग्रामिङको कला जटिलता संगठित गर्ने कला हो, भीडमा महारत हासिल गर्ने र यसको खराब अराजकतालाई सकेसम्म प्रभावकारी रूपमा बेवास्ता गर्ने कला हो।" -> -> एड्सगर डिजस्ट्रा - +--- +pageNumber: I +chapter: +--- + +# समर्पण + +यो पुस्तक हाम्रो संसारमा कम्प्युटर र प्रोग्रामिंग भाषाहरूको भावनाको सम्मान र प्रशंसामा समर्पित छ। + +> "प्रोग्रामिङको कला जटिलता संगठित गर्ने कला हो, भीडमा महारत हासिल गर्ने र यसको खराब अराजकतालाई सकेसम्म प्रभावकारी रूपमा बेवास्ता गर्ने कला हो।" +> +> एड्सगर डिजस्ट्रा + diff --git a/np/arrays/README.md b/np/arrays/README.md index fb381359..4f4430f8 100644 --- a/np/arrays/README.md +++ b/np/arrays/README.md @@ -34,7 +34,7 @@ cars[0] = "Opel"; // changing the first element of an array console.log(cars); // Output: ['Opel', 'Volvo', 'BMW'] ``` -{% hint style="warning" %} +{% hint style="working" %} एरेहरू एक विशेष प्रकारको अब्जेक्ट(Object) अब्जेक्ट हो। एरेमा [अब्जेक्टहरू](../objects/) हुन सक्छन्। {% endhint %} diff --git a/np/arrays/for-each.md b/np/arrays/for-each.md index 2e8b3ac6..d24387fd 100644 --- a/np/arrays/for-each.md +++ b/np/arrays/for-each.md @@ -42,7 +42,7 @@ numbers.forEach(number => console.log(number * 2)); `फोरएच` ले मूल एर्रे परिमार्जन गर्दैन । यो केवल एर्रेको तत्वहरूमा पुनरावृत्ति गर्दछ र प्रत्येक तत्वको लागि प्रदान गरिएको प्रकार्य कार्यान्वयन गर्दछ। -{% hint style="warning" %} +{% hint style="working" %} खाली कथनका लागि `forEach()` विधि कार्यान्वयन गरिएको छैन । {% endhint %} diff --git a/np/arrays/join.md b/np/arrays/join.md index dcb6a1a7..6307138e 100644 --- a/np/arrays/join.md +++ b/np/arrays/join.md @@ -23,7 +23,7 @@ console.log(array.join(" ")); // Result: one two three four ``` -{% hint style="warning" %} +{% hint style="working" %} कुनै पनि विभाजक निर्दिष्ट गर्न सकिन्छ तर पूर्वनिर्धारित अल्पविराम `(,)` हो। {% endhint %} diff --git a/np/arrays/pop.md b/np/arrays/pop.md index e11d7648..0326df69 100644 --- a/np/arrays/pop.md +++ b/np/arrays/pop.md @@ -34,7 +34,7 @@ while (array.length > 0) { console.log(array); // Result: [] ``` -{% hint style="warning" %} +{% hint style="working" %} `पप` विधिले एरेहरूमा मात्र काम गर्दछ, न कि अन्य अब्जेक्टहरूमा जुन एरेहरू जस्तै अार्गुमेन्ट अब्जेक्टहरू वा नोडलिस्ट अब्जेक्टहरूसँग मिल्दोजुल्दो छ। यदि तपाईंलाई यी प्रकारका अब्जेक्टहरूमध्ये कुनै एकबाट एलिमेन्टहरू पप गर्न आवश्यक छ भने, तपाईंले यसलाई पहिले `Array.prototype.slice()` विधि प्रयोग गरेर एरेमा रूपान्तरण गर्न आवश्यक छ। diff --git a/np/arrays/shift.md b/np/arrays/shift.md index 8cf40e19..7550fc76 100644 --- a/np/arrays/shift.md +++ b/np/arrays/shift.md @@ -30,7 +30,7 @@ while (array.length > 0) { console.log(array); // Result: [] ``` -{% hint style="warning" %} +{% hint style="working" %} `shift` विधिले एरेहरूमा मात्र काम गर्दछ, न कि अन्य अब्जेक्टहरूमा जुन एरेहरू जस्तै तर्क अब्जेक्टहरू वा नोडलिस्ट अब्जेक्टहरूसँग मिल्दोजुल्दो छ। यदि तपाईंलाई यी प्रकारका अब्जेक्टहरूमध्ये कुनै एकबाट एलिमेन्टहरू स्थानान्तरण गर्न आवश्यक छ भने, तपाईंले यसलाई पहिले `Array.prototype.slice()` विधि प्रयोग गरेर एरेमा रूपान्तरण गर्न आवश्यक छ। {% endhint %} diff --git a/np/arrays/sort.md b/np/arrays/sort.md index 56c2da2d..932dacc1 100644 --- a/np/arrays/sort.md +++ b/np/arrays/sort.md @@ -46,7 +46,7 @@ points.sort((a, b) => {return a-b}); // Result: [1, 5, 10, 25, 40, 100] ``` -{% hint style="warning" %} +{% hint style="working" %} `sort()` विधिले मूल सरणीलाई ओभरराइड गर्दछ । diff --git a/np/arrays/spread.md b/np/arrays/spread.md index 3e0c8d7a..715a8f30 100644 --- a/np/arrays/spread.md +++ b/np/arrays/spread.md @@ -27,7 +27,7 @@ console.log(arr); //Result: [1, 2, 3, 4, 5, 6, 7] ``` -{% hint style="warning" %} +{% hint style="working" %} स्प्रेड अपरेटरले केवल आधुनिक ब्राउजरहरूमा काम गर्दछ जुन सुविधालाई समर्थन गर्दछ। यदि तपाईंलाई पुरानो ब्राउजरहरू समर्थन गर्न आवश्यक छ भने, तपाईंले स्प्रेड अपरेटर वाक्यविन्यासलाई समकक्ष ईएस 5 कोडमा रूपान्तरण गर्न बाबेल जस्तो ट्रान्सपिलर प्रयोग गर्न आवश्यक हुनेछ। {% endhint %} diff --git a/np/arrays/unshift.md b/np/arrays/unshift.md index 6fd12d0b..baa72d94 100644 --- a/np/arrays/unshift.md +++ b/np/arrays/unshift.md @@ -14,7 +14,7 @@ array.unshift(-5); // 4 // RESULT: array = [-5 , 0, 5, 10]; ``` -{% hint style="warning" %} +{% hint style="working" %} `unshift()` मेथठले मूल एरेलाई अधिलेखन९overwrite) गर्दछ। diff --git a/np/date-and-time.md b/np/date-and-time.md index c64e89f5..92aec67f 100644 --- a/np/date-and-time.md +++ b/np/date-and-time.md @@ -21,7 +21,7 @@ new Date(year,month,day,hours,minutes,seconds,ms) new Date(milliseconds) ``` -{% hint style="warning" %} +{% hint style="working" %} महिनाहरू `०` देखि `११` सम्म निर्दिष्ट गर्न सकिन्छ, त्यो भन्दा बढी अर्को वर्षको लागि ओभरफ्लोमा परिणत हुनेछ। {% endhint %} diff --git a/np/error-handling/try...-catch.md b/np/error-handling/try...-catch.md index cc309adb..53e43df0 100644 --- a/np/error-handling/try...-catch.md +++ b/np/error-handling/try...-catch.md @@ -32,7 +32,7 @@ try { } ``` -{% hint style="warning" %} +{% hint style="working" %} `प्रयास ... क्याच` रनटाइम त्रुटिहरूको लागि काम गर्दछ जसको अर्थ कोड रनेबल र सिंक्रोनस हुनुपर्दछ। {% endhint %} diff --git a/np/functions/README.md b/np/functions/README.md index 2877da47..5bfb0592 100644 --- a/np/functions/README.md +++ b/np/functions/README.md @@ -41,7 +41,7 @@ let double = function (x) { const double = (x) => 2 * x; ``` -{% hint style="warning" %} +{% hint style="working" %} एरो प्रकार्यमा `this` कुञ्जीशब्दले तीर प्रकार्य परिभाषित गर्ने वस्तुलाई प्रतिनिधित्व गर्दछ । {% endhint %} diff --git a/np/loops/while.md b/np/loops/while.md index 4c573f6e..7d062d0e 100644 --- a/np/loops/while.md +++ b/np/loops/while.md @@ -24,7 +24,7 @@ while (i < 5) { } ``` -{% hint style="warning" %} +{% hint style="working" %} यदि अवस्था सधैं साँचो छ भने अनन्त लूपिङबाट जोगिन होसियार हुनुहोस्! {% endhint %} diff --git a/np/modules.md b/np/modules.md index 21f7cc43..e5b400e0 100644 --- a/np/modules.md +++ b/np/modules.md @@ -55,7 +55,7 @@ const age = 30; export { name, age }; ``` -{% hint style="warning" %} +{% hint style="working" %} एउटा फाइलमा एउटा मात्र पूर्वनिर्धारित 'निर्यात' हुन सक्छ । {% endhint %} diff --git a/np/numbers/operators.md b/np/numbers/operators.md index 5cbac798..0fa05b9b 100644 --- a/np/numbers/operators.md +++ b/np/numbers/operators.md @@ -45,7 +45,7 @@ console.log(12 % 3); // 0 जाभास्क्रिप्ट दोभाषे बायाँबाट दायाँ काम गर्दछ। एकजनाले माईन्ट्स भन्दा अलग र ग्रुप अभिव्यक्तिहरू जस्तै कोष्ठकहरू प्रयोग गर्न सक्दछ: `c = (a / b) + d` -{% hint style="warning" %} +{% hint style="working" %} जाभास्क्रिप्टले दुबै थपिएको र अनुरूपको लागि `+` अपरेटर प्रयोग गर्दछ। नम्बरहरू थपिन्छन् जबकि तारहरू अनुगमन गरिन्छ। {% endhint %} diff --git a/np/objects/delete.md b/np/objects/delete.md index 1c23b40f..f7d26769 100644 --- a/np/objects/delete.md +++ b/np/objects/delete.md @@ -29,7 +29,7 @@ let prototypeAge = child.age; // 26, because child does not have its own age property. ``` -{% hint style="warning" %} +{% hint style="working" %} 'मेट्नुहोस्' अपरेटरले वस्तुको आफ्नै गुणहरूमा मात्र काम गर्दछ, र वंशानुगत गुणहरूमा होइन। यसले 'कन्फिगरेसन योग्य' विशेषता 'गलत' मा सेट गरिएको गुणहरूमा पनि काम गर्दैन। diff --git a/np/objects/mutable.md b/np/objects/mutable.md index 03473bcf..4f915ee2 100644 --- a/np/objects/mutable.md +++ b/np/objects/mutable.md @@ -28,7 +28,7 @@ object.foo = 'quux'; // Modify property 'foo' delete object.baz; // Delete property 'baz' ``` -{% hint style="warning" %} +{% hint style="working" %} आदिम मानहरू (जस्तै संख्या र स्ट्रिङहरू) अपरिवर्तनीय छन्, जबकि वस्तुहरू (जस्तै एरे र वस्तुहरू) परिवर्तनशील छन्। {% endhint %} diff --git a/np/promise-async-await/async-await.md b/np/promise-async-await/async-await.md index dc5fe6ba..748ffa9f 100644 --- a/np/promise-async-await/async-await.md +++ b/np/promise-async-await/async-await.md @@ -43,7 +43,7 @@ async function f() { f(); ``` -{% hint style="warning" %} +{% hint style="working" %} `प्रतिक्षा` कुञ्जीशब्द केवल `एसिंक` प्रकार्य भित्र प्रयोग गर्न सकिन्छ। {% endhint %} diff --git a/np/promise-async-await/promise.md b/np/promise-async-await/promise.md index f82f88b3..47eca690 100644 --- a/np/promise-async-await/promise.md +++ b/np/promise-async-await/promise.md @@ -34,7 +34,7 @@ let promise = new Promise(function(resolve, reject) {

Promise with resolve and reject callbacks

-{% hint style="warning" %} +{% hint style="working" %} एक प्रतिज्ञा गुणहरू पहुँच गर्न सक्दैन: `स्टेट` र `परिणाम`। प्रतिज्ञाहरू सम्हाल्न प्रतिज्ञा विधिहरू आवश्यक छन्। @@ -91,7 +91,7 @@ let promiseThree = new Promise((resolve, reject) => { promiseThree.catch(alert); // shows "Error: Whoops!" after 1 second ``` -{% hint style="warning" %} +{% hint style="working" %} `Promise.then()` विधिमा, दुबै कलब्याक तर्कहरू वैकल्पिक छन्। {% endhint %} diff --git a/np/regular-expression.md b/np/regular-expression.md index b9a6422a..61c83fe3 100644 --- a/np/regular-expression.md +++ b/np/regular-expression.md @@ -85,7 +85,7 @@ let re2 = /xyz/; | `toString()` | नियमित एक्स्रेसनको स्ट्रिङ मान फर्काउँछ | -{% hint style="warning" %} +{% hint style="working" %} एक `complie()` विधि नियमित अभिव्यक्ति को अनुपालन गर्दछ र अवमूल्यन गरिएको छ। {% endhint %} diff --git a/np/strings/create.md b/np/strings/create.md index 35fb37e8..e472b78d 100644 --- a/np/strings/create.md +++ b/np/strings/create.md @@ -38,7 +38,7 @@ const message = `Hello, ${name}!`; टेम्प्लेट शाब्दिकले धेरै लाइनहरू पनि समावेश गर्न सक्दछ र प्लेसहोल्डरहरू भित्र कुनै पनि अभिव्यक्ति समावेश गर्न सक्दछ। -{% hint style="warning" %} +{% hint style="working" %} स्ट्रिङहरू घटाउन, गुणा गर्न वा विभाजन गर्न सकिँदैन। {% endhint %} diff --git a/np/strings/length.md b/np/strings/length.md index 29e1289e..42bc5a55 100644 --- a/np/strings/length.md +++ b/np/strings/length.md @@ -22,7 +22,7 @@ console.log(emptyStringSize); खाली स्ट्रिङको लम्बाइ गुण `०` हो । -{% hint style="warning" %} +{% hint style="working" %} `लम्बाइ` गुण पढ्नका लागि मात्र प्रयोग गरिने गुण हो, त्यसैले तपाईँले यसमा नयाँ मान निर्दिष्ट गर्न सक्नुहुन्न । {% endhint %} diff --git a/np/strings/replace.md b/np/strings/replace.md index 05c01465..23ad1b0b 100644 --- a/np/strings/replace.md +++ b/np/strings/replace.md @@ -16,7 +16,7 @@ console.log(new_str); // Result: Hi World! ``` -{% hint style="warning" %} +{% hint style="working" %} [परिमार्जकसँग](../regular-expression.md) नियमित अभिव्यक्तिको सबै उदाहरणहरूमा मान प्रतिस्थापन गर्न सेट गरिएको छ। diff --git a/tr/arrays/README.md b/tr/arrays/README.md index f198713e..b854cd97 100644 --- a/tr/arrays/README.md +++ b/tr/arrays/README.md @@ -36,7 +36,7 @@ console.log(cars); // Result: ['Opel', 'Volvo', 'BMW'] ``` -{% hint style="warning" %} +{% hint style="working" %} Diziler, özel bir nesne türüdür. Bir dizide [nesneler](../objects/) bulunabilir. {% endhint %} diff --git a/tr/arrays/for-each.md b/tr/arrays/for-each.md index d0ace8a5..fd6ec37d 100644 --- a/tr/arrays/for-each.md +++ b/tr/arrays/for-each.md @@ -41,6 +41,6 @@ numbers.forEach((number) => console.log(number * 2)); `forEach` fonksiyonu orijinal diziyi değiştirmez. Sadece dizinin elemanları üzerinde işlem yapar ve her eleman için sağlanan fonksiyonu çalıştırır. -{% hint style="warning" %} +{% hint style="working" %} `forEach()` fonksiyonu bu şekilde tek başına çağrılmaz. {% endhint %} diff --git a/tr/arrays/join.md b/tr/arrays/join.md index e6c2441a..31f553c7 100644 --- a/tr/arrays/join.md +++ b/tr/arrays/join.md @@ -23,7 +23,7 @@ console.log(array.join(" ")); // Sonuç: bir iki üç dört ``` -{% hint style="warning" %} +{% hint style="working" %} Herhangi bir ayırıcı belirtilebilir, ancak varsayılanı virgüldür (,). {% endhint %} diff --git a/tr/arrays/pop.md b/tr/arrays/pop.md index 8da1528f..47d42420 100644 --- a/tr/arrays/pop.md +++ b/tr/arrays/pop.md @@ -34,7 +34,7 @@ while (array.length > 0) { console.log(array); // Sonuç: [] ``` -{% hint style="warning" %} +{% hint style="working" %} `pop()` fonksiyonu yalnızca dizilerde çalışır ve diğer dizilere benzer nesnelerde (örneğin, arguments nesneleri veya NodeList nesneleri) çalışmaz. Bu tür nesnelerden elemanları çıkarmak istiyorsanız, önce `Array.prototype.slice()` fonksiyonunu kullanarak onları bir diziye dönüştürmeniz gerekecektir.\ {% endhint %} diff --git a/tr/arrays/shift.md b/tr/arrays/shift.md index c4435f61..685ab721 100644 --- a/tr/arrays/shift.md +++ b/tr/arrays/shift.md @@ -30,7 +30,7 @@ while (array.length > 0) { console.log(array); // Sonuç: [] ``` -{% hint style="warning" %} +{% hint style="working" %} `shift` fonksiyonu yalnızca diziler üzerinde çalışır, argüman nesneleri veya NodeList nesneleri gibi dizilere benzeyen diğer nesneler üzerinde çalışmaz. Bu tür nesnelerden birinin öğelerini kaydırmanız gerekiyorsa, önce `Array.prototype.slice()` fonksiyonunu kullanarak onu bir diziye dönüştürmeniz gerekir. {% endhint %} diff --git a/tr/arrays/sort.md b/tr/arrays/sort.md index e4c82648..3f2fb55b 100644 --- a/tr/arrays/sort.md +++ b/tr/arrays/sort.md @@ -45,6 +45,6 @@ puanlar.sort((a, b) => { // Sonuç: [1, 5, 10, 25, 40, 100] ``` -{% hint style="warning" %} +{% hint style="working" %} `sort()` yöntemi, orijinal diziyi değiştirir. {% endhint %} diff --git a/tr/arrays/spread.md b/tr/arrays/spread.md index a6ee1dad..eb98cf55 100644 --- a/tr/arrays/spread.md +++ b/tr/arrays/spread.md @@ -26,7 +26,7 @@ dizi1 = [...dizi1, ...dizi2]; console.log(dizi1); //Sonuç: [1, 2, 3, 4, 5, 6, 7] ``` -{% hint style="warning" %} +{% hint style="working" %} Spread operatörü yalnızca bu özelliği destekleyen modern tarayıcılarda çalışır. Daha eski tarayıcıları desteklemeniz gerekiyorsa, spread operatörü sözdizimini eşdeğer ES5 koduna dönüştürmek için Babel gibi bir _transpiler_ kullanmanız gerekecektir. {% endhint %} diff --git a/tr/arrays/unshift.md b/tr/arrays/unshift.md index 81c92b75..f19cdf6d 100644 --- a/tr/arrays/unshift.md +++ b/tr/arrays/unshift.md @@ -14,7 +14,7 @@ array.unshift(-5); // 4 // Sonuç: array = [-5 , 0, 5, 10]; ``` -{% hint style="warning" %} +{% hint style="working" %} `unshift()` fonksiyonu, orijinal diziyi değiştirir. {% endhint %} diff --git a/tr/date-and-time.md b/tr/date-and-time.md index 5eaf151c..4aeb8ff1 100644 --- a/tr/date-and-time.md +++ b/tr/date-and-time.md @@ -23,7 +23,7 @@ new Date(year,month,day,hours,minutes,seconds,ms) new Date(milliseconds) ``` -{% hint style="warning" %} +{% hint style="working" %} Aylar `0` ile `11` arasında belirtilebilir, daha fazlası bir sonraki yıla akacaktır. {% endhint %} diff --git a/tr/error-handling/try...-catch.md b/tr/error-handling/try...-catch.md index 6852b08c..18408d2a 100644 --- a/tr/error-handling/try...-catch.md +++ b/tr/error-handling/try...-catch.md @@ -34,7 +34,7 @@ try { } ``` -{% hint style="warning" %} +{% hint style="working" %} `try...catch` 'in kullanılabilmesi için kodun çalışabilir ve senkronize olması gerekir. {% endhint %} diff --git a/tr/functions/README.md b/tr/functions/README.md index 3d632a30..dfba9d37 100644 --- a/tr/functions/README.md +++ b/tr/functions/README.md @@ -42,6 +42,6 @@ Bir arrow fonksiyonu, bazı sınırlamalarla birlikte bazı semantik farklılık const double = (x) => 2 * x; ``` -{% hint style="warning" %} +{% hint style="working" %} Arrow fonksiyonundaki `this` anahtar sözcüğü, arrow fonksiyonunu tanımlayan nesneyi temsil eder. {% endhint %} diff --git a/tr/loops/while.md b/tr/loops/while.md index a473553e..df15dd40 100644 --- a/tr/loops/while.md +++ b/tr/loops/while.md @@ -24,6 +24,6 @@ while (i < 5) { } ``` -{% hint style="warning" %} +{% hint style="working" %} Koşula her zaman doğru dönen bir ifade vermeye dikkat edin! Çünkü bu sonsuz döngü oluşturacaktır. {% endhint %} diff --git a/tr/modules.md b/tr/modules.md index 1d8f5614..dfc703f8 100644 --- a/tr/modules.md +++ b/tr/modules.md @@ -55,7 +55,7 @@ const age = 30; export {name, age}; ``` -{% hint style="warning" %} +{% hint style="working" %} Bir dosyada yalnızca bir tane `default` dışa aktarım olabilir! {% endhint %} diff --git a/tr/numbers/operators.md b/tr/numbers/operators.md index b73f9ba7..0a57722d 100644 --- a/tr/numbers/operators.md +++ b/tr/numbers/operators.md @@ -45,7 +45,7 @@ console.log(12 % 3); // 0 JavaScript yorumlayıcısı soldan sağa doğru çalışır. İfadeleri ayırmak ve gruplamak için matematikte olduğu gibi parantezler kullanılabilir: `c = (a / b) + d` -{% hint style="warning" %} +{% hint style="working" %} JavaScript hem toplama hem de birleştirme için `+` operatörü kullanır. Sayılar eklenirken, dizeler (**string**) birleştirilir. {% endhint %} diff --git a/tr/objects/delete.md b/tr/objects/delete.md index a817ac27..7dc4a23e 100644 --- a/tr/objects/delete.md +++ b/tr/objects/delete.md @@ -29,7 +29,7 @@ let prototypeAge = child.age; // 26, because child does not have its own age property. ``` -{% hint style="warning" %} +{% hint style="working" %} `delete` operatörü sadece bir objenin kendi özellikleri üzerinde çalışır, miras alınan özellikler üzerinde çalışmaz. Ayrıca `configurable` niteliği `false` olarak ayarlanmış özellikler üzerinde de çalışmaz. {% endhint %} diff --git a/tr/objects/mutable.md b/tr/objects/mutable.md index 07618ea6..5b6a11a5 100644 --- a/tr/objects/mutable.md +++ b/tr/objects/mutable.md @@ -28,6 +28,6 @@ object.foo = "quux"; // Modify property 'foo' delete object.baz; // Delete property 'baz' ``` -{% hint style="warning" %} +{% hint style="working" %} Primitive (_ilkel_) değerler (sayılar ve dizeler gibi) değişmezken, objeler (diziler ve objeler gibi) değişebilirdir. {% endhint %} diff --git a/tr/promise-async-await/async-await.md b/tr/promise-async-await/async-await.md index 9bc2ac6c..401c96ed 100644 --- a/tr/promise-async-await/async-await.md +++ b/tr/promise-async-await/async-await.md @@ -41,6 +41,6 @@ async function f() { f(); ``` -{% hint style="warning" %} +{% hint style="working" %} `await` anahtar kelimesi yalnızca `async` fonksiyonları içinde kullanılabilir. {% endhint %} diff --git a/tr/promise-async-await/promise.md b/tr/promise-async-await/promise.md index cd3c95df..dae66444 100644 --- a/tr/promise-async-await/promise.md +++ b/tr/promise-async-await/promise.md @@ -36,7 +36,7 @@ Burada, `new Promise`'ye bir işlev geçirilir, buna executor da denir ve oluşt - result - başlangıçta `undefined`, ardından `resolve` üzerine `value` veya `reject` üzerine `error` değişir -{% hint style="warning" %} +{% hint style="working" %} Promise özelliklerine `state` ve `result` erişilemez. Promise'leri işlemek için promise yöntemlerine ihtiyaç vardır. {% endhint %} @@ -89,6 +89,6 @@ let promiseThree = new Promise((resolve, reject) => { promiseThree.catch(alert); // shows "Error: Whoops!" after 1 second ``` -{% hint style="warning" %} +{% hint style="working" %} `Promise.then()` metodunda, her iki callback argümanının da kullanımı isteğe bağlıdır. {% endhint %} diff --git a/tr/regular-expression.md b/tr/regular-expression.md index 75c9be6b..663a1ad3 100644 --- a/tr/regular-expression.md +++ b/tr/regular-expression.md @@ -82,7 +82,7 @@ RegEx tarafından desteklenen özellikler ve yöntemler aşağıda listelenmişt | `test()` | Eşleşmeyi test eder ve `true` veya `false` döndürür | | `toString()` | Düzenli ifadenin dize değerini döndürür | -{% hint style="warning" %} +{% hint style="working" %} Bir `complie()` yöntemi düzenli ifadeyi uyumlu hale getirir ve kullanımdan kaldırılmıştır. {% endhint %} diff --git a/tr/strings/create.md b/tr/strings/create.md index 838ebb98..daa56878 100644 --- a/tr/strings/create.md +++ b/tr/strings/create.md @@ -38,7 +38,7 @@ const message = `Hello, ${name}!`; Şablon literalleri birden çok satıra da sahip olabilir ve yer tutucular içinde herhangi bir ifade içerebilir. -{% hint style="warning" %} +{% hint style="working" %} Dizeler çıkarılamaz, çarpılamaz veya bölünemez. {% endhint %} diff --git a/tr/strings/length.md b/tr/strings/length.md index a2053567..21fffbc7 100644 --- a/tr/strings/length.md +++ b/tr/strings/length.md @@ -19,6 +19,6 @@ console.log(emptyStringSize); Boş bir dizenin length özelliği `0`'dır. -{% hint style="warning" %} +{% hint style="working" %} `length` özelliği salt okunur bir özelliktir, bu nedenle ona yeni bir değer atayamazsınız. {% endhint %} diff --git a/tr/strings/replace.md b/tr/strings/replace.md index 4f04236d..afa3322d 100644 --- a/tr/strings/replace.md +++ b/tr/strings/replace.md @@ -16,7 +16,7 @@ console.log(new_str); // Sonuç: Hi World! ``` -{% hint style="warning" %} +{% hint style="working" %} Bir [regular expression](../regular-expression.md) öğesinin tüm örneklerinde bir değeri `g` değiştiricisi ile değiştirmek için ayarlanır.{% endhint %} Bir değer veya düzenli ifade için bir dize arar ve değer(ler)in değiştirildiği yeni bir dize döndürür. Orijinal dizeyi değiştirmez. Büyük/küçük harfe duyarsız global değiştirme örneğini görelim.