Skip to content

Commit

Permalink
Readme.md > Link > add > 13 OOP > Encapsulation
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMadWill committed Dec 8, 2021
1 parent 5ad6de8 commit 74ffe80
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 8 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 @@ -15,7 +15,8 @@ <h1> Javascript Object </h1>
<!-- <script src="../Js/47_13_5_InheritanceUsage.js"></script> -->
<!-- <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/50_13_8_Function_return_Function.js"></script> -->
<script src="../Js/51_13_9_Setter_Getter.js"></script>

</body>

Expand Down
87 changes: 87 additions & 0 deletions 13_Object_Oriented_Programming/Js/51_13_9_Setter_Getter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
//* Encapsulation

// *Spimple Exp

// const Person = {
// names: 'Will',
// surname: 'Mad',
// GetFullName:function(){
// return `${this.surname} ${this.names}`
// },
// SetFullName:function(value){
// let post=value.split(" ");
// this.names = post[0]
// this.surname = post[1]
// }

// }

// console.log(Person.GetFullName())
// Person.SetFullName("Damtion Road")
// console.log(Person.GetFullName())



//* We use


// const Person = {
// names: 'Will',
// surname: 'Mad',
// get FullName(){
// return `${this.surname} ${this.names}`
// },
// set FullName(value){
// let post=value.split(" ");
// this.names = post[0]
// this.surname = post[1]
// }

// }

// console.log(Person.FullName)
// Person.FullName = 'Damtion Road'
// console.log(Person.FullName)

// or


const Person ={
names: "Bartas",
surename: "Deleveqa",
}

Object.defineProperty(Person,"fullname",{
get(){
return `${this.surname} ${this.names}`
},
set(value) {
let post=value.split(" ");
this.names = post[0]
this.surname = post[1]
}
})


console.log(Person)
Person.FullName = 'Damtion Road'
console.log(Person.FullName)



Object.defineProperty(Person,'age',{
value:25 // not writable
})

Person.age=21

console.log(Person.age)

Object.defineProperty(Person,'job',{
value:"Damtion", // not writable
writable:true
})

Person.job="Teacher"

console.log(Person.job)
9 changes: 8 additions & 1 deletion Documantation/13_Object_Oriented/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,11 @@ Burada bizə `Object.create()` methodu köməyimizə gəlir.
### Function that return function
***
> Bir funksiyadan return dəyər funksiya göndərə bilərik.
> Bir funksiyadan return dəyər funksiya göndərə bilərik.

### Encapsulation
***
> Obyejtləri qorumaq üçün **Encapsulation**dan istidfadə edirik.
- `set()` methodu yazmaq üçün
- `get()` methodu oxumaq üçündür.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
# Learning JavaScript
## My JavaScript App <a href="https://drmadwill.github.io/JavaScript/" target="blank"> <img src="https://i.postimg.cc/6Q7k4DHr/app.png" width="100" align="right" ></a>
***
### To Do App <a href="https://codepen.io/Dr-MadWill/pen/eYEoZPe" target="blank"> <img src="https://i.postimg.cc/c4SZwbWw/list.png" width="180" align="right" ></a>
## To Do App <a href="https://codepen.io/Dr-MadWill/pen/eYEoZPe" target="blank"> <img src="https://i.postimg.cc/c4SZwbWw/list.png" width="180" align="right" ></a>
> Bu **app**-də listə itemləri əlavə edə bilirik və tək-tək və ya hamsı silə bilirik. Yazılan _data_-lar `localStorage`-ə yazılır. Yəni browser söndürülmədiyi müdətdə _data_-lar saxlanır, _reload_ edilsə belə.
- [Preview](https://codepen.io/Dr-MadWill/pen/eYEoZPe)
- [Code Documatation](https://github.com/DrMadWill/JavaScript#todo-list-app)
- **App**-in əsas xususiyyətləri:
- `localStorage` istifadə
- _RemoveElement_-dən isfadə
- _AddElement_-dən istfadə
### Slider App <a href="https://codepen.io/Dr-MadWill/pen/QWMPErQ?editors=0010" target="blank"> <img src="https://i.postimg.cc/2yWNp4fs/slid.png" width="180" align="right" ></a>
## Slider App <a href="https://codepen.io/Dr-MadWill/pen/QWMPErQ?editors=0010" target="blank"> <img src="https://i.postimg.cc/2yWNp4fs/slid.png" width="180" align="right" ></a>
> Sadəcə _JavaScript_-dən istfadə edərək sadə _Slider_ yazmağa çalışdım.Burda _data_ olaraq göstərilən [`data`](https://github.com/DrMadWill/JavaScript/blob/main/11_Slider_App/Js/30_11_4_Slider_Duration.js#L2) obyecti _DataBases_-dən gələn məlumatları göstərir._Slider_-da default olaraq rəsimləri ardıcıl göstərir. Tələbdən aslı olarq [_random_ etmək](https://github.com/DrMadWill/JavaScript/blob/main/11_Slider_App/Js/30_11_4_Slider_Duration.js#L44) olar. _Controller_-lərin üzərinə gələn zaman [_Slider_ dayanır](https://github.com/DrMadWill/JavaScript/blob/main/11_Slider_App/Js/30_11_4_Slider_Duration.js#L53).
- [Preview](https://codepen.io/Dr-MadWill/pen/QWMPErQ?editors=0010)
- [Code Documatation](https://github.com/DrMadWill/JavaScript#slider-app-1)
- **App**-in əsas xususiyyətləri:
- `setInterval`-dan istfadə edilib.
- `clearInterval`-dan istfadə edilib.
- _radom_ xususiyyəti əlavə edib.
### Form Validation App <a href="https://codepen.io/Dr-MadWill/pen/MWEYBGg" target="blank"> <img src="https://i.postimg.cc/dVh6TpqG/validation-modified.png" width="180" align="right" ></a>
## Form Validation App <a href="https://codepen.io/Dr-MadWill/pen/MWEYBGg" target="blank"> <img src="https://i.postimg.cc/dVh6TpqG/validation-modified.png" width="180" align="right" ></a>
> Validation çox zaman hazır kod blokları və ya _Packages_-dən istifadə edilir. Burada məqsəd hazır kod bloklarında istifadə etmədən öz şərtlərmizi qoyaraq bu hadisəni necə sadə yolla həyata keçrə biləcəyimizi yazmaqdır.
- [Preveiw](https://codepen.io/Dr-MadWill/pen/MWEYBGg)
- [Code Documatation](https://github.com/DrMadWill/JavaScript/blob/main/12_JQery/42_12_11_Form_Validation.html)
- **App**-ın əsas xususiyyətləri:
- _JQuery_-dən istifadə edilib.

### Back To Top App <a href="https://codepen.io/Dr-MadWill/pen/eYGmLmz" target="_blank"> <img src="https://i.postimg.cc/LsnnLxVP/back-to-top-arrow-sign-icon-scroll-up-symbol-vector-4029487-modified.png" width="180" align="right" ></a>
## Back To Top App <a href="https://codepen.io/Dr-MadWill/pen/eYGmLmz" target="_blank"> <img src="https://i.postimg.cc/LsnnLxVP/back-to-top-arrow-sign-icon-scroll-up-symbol-vector-4029487-modified.png" width="180" align="right" ></a>
> _JQuery_ istifadə edərək sadə **Back To Top App** gəliştirməyə çalişdim.
- [Preveiw](https://codepen.io/Dr-MadWill/pen/eYGmLmz)
- [Code Documatation](https://github.com/DrMadWill/JavaScript/blob/main/12_JQery/41_12_11_Back_To_top.html)

### Inheritance Usage
## Inheritance Usage
> `prototype`,`Object.create()``.call()` istifadə edərək **inheritance** ifadə etməyə çalışdım.
- Preveiw
- [Code Documantation](https://github.com/DrMadWill/JavaScript/blob/main/13_Object_Oriented_Programming/Js/47_13_5_InheritanceUsage.js)
Expand Down Expand Up @@ -129,4 +129,5 @@
- [My Documantation](https://github.com/DrMadWill/JavaScript/blob/main/Documantation/13_Object_Oriented/documentation.md#immediate-function)
- [Function that return function](https://github.com/DrMadWill/JavaScript/blob/main/13_Object_Oriented_Programming/Js/50_13_8_Function_return_Function.js)
- [My Documantation](https://github.com/DrMadWill/JavaScript/blob/main/Documantation/13_Object_Oriented/documentation.md#function-that-return-function)

- [Setter Getter]()
- [My Documantation]()

0 comments on commit 74ffe80

Please sign in to comment.