Skip to content

Commit

Permalink
Readme.md > Link > add > 13 OOP > Call ,Apply and Bind Function
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMadWill committed Dec 8, 2021
1 parent 2a09063 commit 16a4a82
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
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 @@ -16,7 +16,8 @@ <h1> Javascript Object </h1>
<!-- <script src="../Js/48_13_6_CallBack_Function.js"></script> -->
<!-- <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/51_13_9_Setter_Getter.js"></script> -->
<script src="../Js/52_13_10_Call_Applay_Bind_Funciio.js"></script>

</body>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
//* Call ,Apply and Bind Function

// * No arguments
let Welcom = function () {
console.log("Welcome " + this.name)
}

let orxan = {name:"Orxan"}
let ali = {name:"Ali"}

//call
Welcom.call(orxan)
Welcom.call(ali)

//apply
Welcom.apply(orxan)
Welcom.apply(ali)

//bind
let bindorxan = Welcom.bind(orxan)
bindorxan()
let bindali = Welcom.bind(ali)
bindali()



// * Arguments Use
let WelcomArg = function (a,b) {
console.log("Welcome " + this.name+". Do yo Like "+a+" or "+b)
}


//call
WelcomArg.call(orxan,"Angular","Asp.net")
WelcomArg.call(ali,"Js","Python")

//apply
WelcomArg.apply(orxan,["Angular","Asp.net"])
WelcomArg.apply(ali,["Js","Python"])

//bind
let bind1=WelcomArg.bind(orxan)
bind1("Angular","Asp.net")

let bind2 = WelcomArg.bind(ali)
bind2("Js","Python")




5 changes: 5 additions & 0 deletions Documantation/13_Object_Oriented/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,8 @@ Burada bizə `Object.create()` methodu köməyimizə gəlir.
> Obyejtləri qorumaq üçün **Encapsulation**dan istidfadə edirik.
- `set()` methodu yazmaq üçün
- `get()` methodu oxumaq üçündür.


### 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.

0 comments on commit 16a4a82

Please sign in to comment.