-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathj2.js
48 lines (43 loc) · 1.02 KB
/
j2.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
// //object part 2
// const tinder=new Object();
// tinder.name="Tinder";
// tinder.url="www.tinder.com";
// tinder.rating=4.5;
// tinder.isFree=true;
// tinder.download=function(){
// console.log("Download " + this.name + " from " + this.url);
// }
// console.log(tinder.download()); // Output: Download Tinder from www.tinder.com
// console.log(tinder);
// //object part 3
// //objects into objects
// const person = {
// name: "John",
// age: 30,
// address: {
// street: "123 Main St",
// city: "New York"
// }
// };
// console.log(person.address.street);
// //combining objects
const person1 = {
name: "John",
age: 30
};
const person2 = {
name2: "Jane",
age2: 25
};
// const person3 = {
// ...person1,
// ...person2,
// country: "USA"
// };
// const person3 = Object.assign({},person1, person2);
// console.log(person3);
// console.log(person1);
const person3 = { ...person1, ...person2 };
console.log(person3);
console.log(Object.keys(person3));
console.log(`chandra`);