Skip to content

Commit

Permalink
13 OOP > Object > Error Handling > add
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMadWill committed Dec 8, 2021
1 parent abdce86 commit 9479528
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 3 deletions.
3 changes: 2 additions & 1 deletion 13_Object_Oriented_Programming/HTML/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ <h1> Javascript Object </h1>
<!-- <script src="../Js/49_13_7_ImmediateFunction.js"></script> -->
<!-- <script src="../Js/50_13_8_Function_return_Function.js"></script> -->
<!-- <script src="../Js/51_13_9_Setter_Getter.js"></script> -->
<script src="../Js/52_13_10_Call_Applay_Bind_Funciio.js"></script>
<!-- <script src="../Js/52_13_10_Call_Applay_Bind_Funciio.js"></script> -->
<script src="../Js/53_13_11_Error_Handling.js"></script>

</body>

Expand Down
49 changes: 49 additions & 0 deletions 13_Object_Oriented_Programming/Js/53_13_11_Error_Handling.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// * Error Handling



// ReferenceError

try {
console.log(wilFunction());

} catch (error) {
console.log(error.message)
console.log(error.name)

console.log(error instanceof ReferenceError)
console.log(error instanceof TypeError)
}


console.log("+++++++++++++++++++++++")


let wil = {
name:"Lider"
}

try {
console.log(wil.surename)// underfind
if (!surename){
// throw new SyntaxError("User has no email");
throw new TypeError("User has no email");
}
} catch (error) {
console.log(error)
console.log(error.message)
console.log(error.name)//Referance Error
} finally {
console.log("finally block every time using")
}











5 changes: 4 additions & 1 deletion Documantation/13_Object_Oriented/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,7 @@ Burada bizə `Object.create()` methodu köməyimizə gəlir.

### Call ,Apply and Bind Function
***
> call methodu vastəsi ilə classın constractorunu çağəra bilir. Call və Apply eyni funksiyanı yerinə yetirir sadəcə **prametr** qəbul edrkən Call prametirləri vergüllərlə ayırır,Apply prametrirləri **array** olaraq əbul edir.Bind isə həmin funksiyanı özəlləşdirərək bizə qatarırır.
> call methodu vastəsi ilə classın constractorunu çağəra bilir. Call və Apply eyni funksiyanı yerinə yetirir sadəcə **prametr** qəbul edrkən Call prametirləri vergüllərlə ayırır,Apply prametrirləri **array** olaraq əbul edir.Bind isə həmin funksiyanı özəlləşdirərək bizə qatarırır.


3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,5 @@
- [Setter Getter](https://github.com/DrMadWill/JavaScript/blob/main/13_Object_Oriented_Programming/Js/51_13_9_Setter_Getter.js)
- [My Documantation](https://github.com/DrMadWill/JavaScript/blob/main/Documantation/13_Object_Oriented/documentation.md#encapsulation)
- [Call,Apply and Bind Function](https://github.com/DrMadWill/JavaScript/blob/main/13_Object_Oriented_Programming/Js/52_13_10_Call_Applay_Bind_Funciio.js)
- [My Documantation](https://github.com/DrMadWill/JavaScript/blob/main/Documantation/13_Object_Oriented/documentation.md#call-apply-and-bind-function)
- [My Documantation](https://github.com/DrMadWill/JavaScript/blob/main/Documantation/13_Object_Oriented/documentation.md#call-apply-and-bind-function)
- [Error Handling]()

0 comments on commit 9479528

Please sign in to comment.