-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathobjectes6.js
102 lines (65 loc) · 1.9 KB
/
objectes6.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// let fisrName = 'Muhammed'
// let lastName = 'Essa'
// let age = 36
// let salary = 'employeeSalary'
// let person = {
// fisrName,
// lastName,
// age,
// [salary]:3000.3,
// fullName(){
// return this.fisrName +" "+ this.lastName;
// }
// }
// console.log(person )
// console.log(person.fisrName)
// console.log(person.lastName)
// console.log(person.age)
// var names = { 1:'Muhammed', 2:'Essa' };
// var names2 = { 3:'Ahmed', 4: 'Ali' };
// var names3 = { 5:'Khalid',6: 'Osama' };
// var totalNames = Object.assign(names,names2,names3);
// console.log(totalNames)
// let personInfo = {
// name: 'Muhammed',
// lastName: 'Hameed',
// age:36,
// salary:3000
// }
// let personInfo2 = Object.assign({} ,personInfo )
// personInfo2.name = 'Ahmed'
// console.log(personInfo2);
// var name = {1:"Muhammed" , 2:"Ahmed"}
// var name2 = {3:"Ahmed" , 4:"Hassan"}
// var name3 = {5:"Usama" , 6:"Waleed"}
// var totalNames = {...name, ...name2 , ...name3}
// console.log(totalNames);
// var names = new Object;
// names.x = 'Muhammed';
// names.y = 'Essa';
// delete names.y
// console.log(names )
// let employee =
// {name:'Muhammed',age:36,department:'JS Developer'}
// let{name , age , department} = employee
// console.log(name)
// console.log(age)
// console.log(department)
// let {age1 = 33 , salary1 = 3000} = { age1 : 36}
// console.log(age1)
// console.log(salary1)
// let myInfo = {age2 : 33 , salary2 : 3000}
// let {age2:ages , salary2 : salaries} = myInfo
// console.log(ages)
// console.log(salaries)
// let fistName , lastName;
// ({fistName , lastName} = {fistName:'Muhammed',lastName:'Essa'})
// console.log(fistName)
// console.log(lastName)
// let{x,y,...args} = {x:10,y:20,z:30,u:40,s:33,t:88}
// console.log(x)
// console.log(y)
// console.log(args)
let{num1:number1=10,num2:number2=20 } = {num1:30}
console.log(number1)
console.log(number2)