You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 14_Day_Error_handling/14_day_error_handling.md
+29-29Lines changed: 29 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -14,43 +14,43 @@
14
14
15
15
</div>
16
16
17
-
[<< Day 13](../13_Day_Console_object_methods/13_day_console_object_methods.md) | [Day 15>>](../15_Day_Classes/15_day_classes.md)
17
+
[<< Gün 13](../13_Day_Console_object_methods/13_day_console_object_methods.md) | [Gün 15>>](../15_Day_Classes/15_day_classes.md)
18
18
19
-

19
+

20
20
21
-
-[Day 14](#day-14)
21
+
-[Gün 14](#day-14)
22
22
- [Error Handling](#error-handling)
23
23
- [Error Types](#error-types)
24
24
- [Exercises](#exercises)
25
25
- [Exercises:Level 1](#exerciseslevel-1)
26
26
- [Exercises: Level 2](#exercises-level-2)
27
27
- [Exercises:Level](#exerciseslevel)
28
28
29
-
# Day 14
29
+
# Gün 14
30
30
31
31
## Error Handling
32
32
33
-
JavaScript is a loosely-typed language. Some times you will get a runtime error when you try to access an undefined variable or call undefined function etc.
33
+
JavaScript geniş yazılmış bir dildir. Bazı zamanlar, tanımsız bir değişkene erişmeye veya tanımsız bir işlevi çağırmaya çalıştığınızda bir çalışma zamanı hatası alırsınız.
34
34
35
-
JavaScript similar to python or Java provides an error-handling mechanism to catch runtime errors using try-catch-finally block.
35
+
JavaScript, Python veya Java'ya benzer, try-catch-finally bloğunu kullanarak çalışma zamanı hatalarını yakalamak için bir hata işleme mekanizması sağlar.
36
36
37
37
```js
38
38
try {
39
-
//code that may throw an error
39
+
//hata verilebilicek kod
40
40
} catch (err) {
41
-
//code to be executed if an error occurs
41
+
//bir hata oluşursa çalıştırılacak kod
42
42
} finally {
43
-
//code to be executed regardless of an error occurs or not
43
+
//bir hatanın oluşup oluşmadığına bakılmaksızın yürütülecek kod
44
44
}
45
45
```
46
46
47
-
**try**: wrap suspicious code that may throw an error in try block.The try statement allows us to define a block of code to be tested for errors while it is being executed.
47
+
**try**: try bloğunda hata oluşturabilecek kodu yazın. try ifadesi, yürütülürken hatalar için test edilecek bir kod bloğu tanımlamamızı sağlar.
48
48
49
-
**catch**: write code to do something in catch block when an error occurs. The catch block can have parameters that will give you error information. Catch block is used to log an error or display specific messages to the user.
49
+
**catch**: Bir hata oluştuğunda catch bloğunda bir şeyler yapmak için kod yazın. Catch bloğu, size hata bilgisi verecek parametrelere sahip olabilir. Yakalama bloğu, bir hatayı günlüğe kaydetmek veya kullanıcıya belirli mesajları görüntülemek için kullanılır.
50
50
51
-
**finally**: finally block will always be executed regardless of the occurrence of an error. The finally block can be used to complete the remaining task or reset variables that might have changed before error occurred in try block.
51
+
**finally**: finally bloğu, bir hata oluşmasından bağımsız olarak her zaman yürütülür. finally bloğu, kalan görevi tamamlamak veya try bloğunda hata oluşmadan önce değişmiş olabilecek değişkenleri sıfırlamak için kullanılabilir.
52
52
53
-
**Example:**
53
+
**Örnek:**
54
54
55
55
```js
56
56
try {
@@ -83,7 +83,7 @@ ReferenceError: fistName is not defined
83
83
In any case it will be executed
84
84
```
85
85
86
-
The catch block take a parameter. It is common to pass e, err or error as a parameter to the catch block. This parameter is an object and it has name and message keys. Lets use the name and message.
86
+
Catch bloğu bir parametre alır. Catch bloğuna parametre olarak e, err veya error iletmek yaygındır. Bu parametre bir nesnedir ve isim ve mesaj anahtarlarına sahiptir. Adı ve mesajı kullanalım.
87
87
88
88
```js
89
89
try {
@@ -103,7 +103,7 @@ Error message fistName is not defined
103
103
In any case I will be executed
104
104
```
105
105
106
-
throw: the throw statement allows us to create a custom error. We can through a string, number, boolean or an object. Use the throw statement to throw an exception. When you throw an exception, expression specifies the value of the exception. Each of the following throws an exception:
106
+
throw: throw ifadesi özel bir hata oluşturmamıza izin verir. Bir dize, sayı, boolean veya bir nesne aracılığıyla yapabiliriz. Bir istisna atmak için throw ifadesini kullanın. Bir throw exception yazdığınızda, expression specifies değerini belirtir. Aşağıdakilerin her biri throw exception atar:
107
107
108
108
```js
109
109
throw 'Error2' // generates an exception with a string value
@@ -131,7 +131,7 @@ throwErrorExampleFun()
131
131
132
132
### Error Types
133
133
134
-
- ReferenceError: An illegal reference has occurred. A ReferenceError is thrown if we use a variable that has not been declared.
134
+
- ReferenceError: Geçersiz bir referans oluşturur. Tanımlanmamış bir değişken kullanırsak bir ReferenceError atılır.
135
135
136
136
```js
137
137
let firstName = 'Asabeneh'
@@ -145,7 +145,7 @@ Uncaught ReferenceError: lastName is not defined
145
145
at <anonymous>:2:35
146
146
```
147
147
148
-
- SyntaxError: A syntax error has occurred
148
+
- SyntaxError: Bir syntax(sözdizim) hatası oluşturur.
149
149
150
150
```js
151
151
let square = 2 x 2
@@ -158,7 +158,7 @@ console.log('Hello, world")
158
158
Uncaught SyntaxError: Unexpected identifier
159
159
```
160
160
161
-
- TypeError: A type error has occurred
161
+
- TypeError: Bir type hatası oluşturur
162
162
163
163
```js
164
164
let num = 10
@@ -170,24 +170,24 @@ Uncaught TypeError: num.toLowerCase is not a function
170
170
at <anonymous>:2:17
171
171
```
172
172
173
-
These are some of the common error you may face when you write a code. Understanding errors can help you to know what mistakes you made and it will help you to debug your code fast.
173
+
Bunlar, kod yazarken karşılaşabileceğiniz yaygın hatalardan bazılarıdır. Hataları anlamak, hangi hataları yaptığınızı bilmenize yardımcı olabilir ve kodunuzda hızlı bir şekilde hata ayıklamanıza yardımcı olur.
174
174
175
-
🌕 You are flawless. Now, you knew how to handle errors and you can write robust application which handle unexpected user inputs. You have just completed day 14 challenges and you are 14 steps a head in to your way to greatness. Now do some exercises for your brain and for your muscle.
175
+
🌕 Kusursuzsun. Artık hataların nasıl ele alınacağını biliyorsunuz ve beklenmeyen kullanıcı girdilerini işleyen sağlam bir uygulama yazabilirsiniz. 14. gün zorluklarını yeni tamamladınız ve mükemmelliğe giden yolda 14 adım öndesiniz. Şimdi beyniniz ve kasınız için bazı egzersizler yapın.
176
176
177
-
## Exercises
177
+
## Egzersizler
178
178
179
-
### Exercises:Level 1
179
+
### Egzersiz:Seviye 1
180
180
181
-
Practice
181
+
Pratik
182
182
183
-
### Exercises: Level 2
183
+
### Egzersiz: Seviye 2
184
184
185
-
Practice
185
+
Pratik
186
186
187
-
### Exercises:Level
187
+
### Egzersiz: Seviye 3
188
188
189
-
Practice
189
+
Pratik
190
190
191
-
🎉 CONGRATULATIONS ! 🎉
191
+
🎉 TEBRİKLER ! 🎉
192
192
193
-
[<< Day 13](../13_Day_Console_object_methods/13_day_console_object_methods.md) | [Day 15>>](../15_Day_Classes/15_day_classes.md)
193
+
[<< Gün 13](../13_Day_Console_object_methods/13_day_console_object_methods.md) | [Gün 15>>](../15_Day_Classes/15_day_classes.md)
0 commit comments