forked from FirmanKurniawan/Javascript-Projects
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuizDicodingObject.js
More file actions
49 lines (43 loc) · 1.39 KB
/
QuizDicodingObject.js
File metadata and controls
49 lines (43 loc) · 1.39 KB
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
/**
* TODO
* 1. Buatlah variabel dengan nama restaurant yang bertipe object dengan ketentuan berikut:
* - Memiliki properti bernama "name"
* - Bertipe data string
* - Bernilai apa pun, asalkan tidak string kosong atau null.
* - Memiliki properti bernama "city"
* - Bertipe data string
* - Bernilai apa pun, asalkan tidak string kosong atau null.
* - Memiliki properti "favorite drink"
* - Bertipe data string
* - Bernilai apa pun, asalkan tidak string kosong atau null.
* - Memiliki properti "favorite food"
* - Bertipe data string
* - Bernilai apa pun, asalkan tidak string kosong atau null.
* - Memiliki properti "isVegan"
* - Bertipe data boolean
* - Bernilai boolean apa pun.
*
* 2. Buatlah variabel bernama name.
* Kemudian isi dengan nilai name dari properti object restaurant
* 3. Buatlah variabel bernama favoriteDrink.
* Kemudian isi dengan nilai "favorite drink" dari properti object restaurant
*/
const restaurant = {
name:"Fariz",
city:"Cirebon",
"favorite drink":"Ice Jasjus",
"favorite food":"Bakso",
"isVegan":false
}
const {name} = restaurant;
const {'favorite drink': favoriteDrink } = restaurant;
console.log(name);
console.log(favoriteDrink);
/**
* Hiraukan kode di bawah ini
*/
// TODO
/**
* Jangan hapus kode di bawah ini
*/
module.exports = { restaurant, name, favoriteDrink };