-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
67 lines (57 loc) · 1.09 KB
/
Copy pathapp.js
File metadata and controls
67 lines (57 loc) · 1.09 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
const teaOrder = {
variety: "oolong",
teaName: "winter sprout",
origin: "taiwan",
price: 12.99,
hasCaffeine: true,
quantity: 3,
brewTemp: 180,
};
const { price, quantity, teaName, ...others } = teaOrder;
const { origin } = teaOrder;
const { brewTemp: temp = 175 } = teaOrder;
const { teaName: tea } = teaOrder;
function checkOut(tea) {
const { quantity = 1, price } = tea;
return quantity * price;
}
const students = [
{
name: "Drake",
GPA: 4.6,
},
{
name: "Henrietta",
GPA: 4.4,
},
{
name: "Tung",
GPA: 4.0,
},
{
name: "Harry",
GPA: 3.8,
},
{
name: "Ant",
GPA: 3.2,
},
];
//const [topStudent, secondBest, , fourth, lastBest] = students;
const [first, ...losers] = students;
function getTotal({ quantity, price }) {
return quantity * price;
}
const longJump = ["Tammy", "Jessica", "Violet"];
function awardMetals([gold, silver, bronze]) {
return {
gold,
silver,
bronze,
};
}
let delicious = "Mayonnise";
let disgusting = "whipped Cream";
// let both = [disgusting, delicious];
// [delicious, disgusting] = both;
[disgusting, delicious] = [delicious, disgusting];