---
# System prepended metadata

title: Data Model of My Life

---

# Data Model of My Life
Thao's profile
```
const thaoVu = {
    firstName: "Thao";
    lastName: "Vu";
    age:27;
    isFemale: true;
    hobbies: [hiking, reading, listening to music];
    bestFriends: [studentA, studentB]
}
```

Her first best friend's info
```
let studentA = {
    firstName: "Kristina";
    lastName: "Anguil";
    age:27;
    nationality: "Russian" 
```
}

Her second best friend's info
```
let studentB = {
    firstName: "Rosie";
    lastName: "Nguyen";
    age:34;
    nationality: "Vietnamese";
}
```

Thao recently moved to the U.S and she adopted a new hobby: visiting museums
`thaoVu.hobbies. push('visiting museums');`

Thao lost touch with Rosie as well
`thaoVu.bestFriends.pop('studentB');`



After waking up, she will chug on coffee until she is ready to tackle the day
```
var energy;
let cupOfCoffee = 0;

function drinkCoffee(energy, cupOfCoffee){
do {
  cupOfCoffee++;
  energy+=10;
} while (energy < 50);}

return console.log(cupOfCoffee);
}




```
This morning she woke up feeling pretty low. 

    `energy=10`
Using the function drinkCoffee
    After 1 cup of coffee: energy=20
    After 2 cups of coffee: energy=30
    After 3 cups of coffee: energy=40
    After 4 cups of coffee: energy=50
It took her 4 cups of coffee to feel human again
```
drinkCoffee(10,0)-> 4
```

Today she found a good lunch deal on Grubhub. Customers get 15% discount if order value > 10$, 20% discount if order value > 15$ and 30% discount if order value>18$

```
function total(value,total){
if(value>10){
    total=value*0.85;
}else if(value>15){
    total=value*0.8;
} else if(value>20){
    total=value*0.7;
}else {total=value;}

return console.log(total);
}
```
She checked the fridge to see if there is anyfood left. If there is none, she would order from Grubhub
```

var myFridge = {
  dairy: "egg",
  fruit: "apple",
  drinks: "wine"
};

function checkObj(checkProp) {
  
  var result = myFridge.hasOwnProperty(checkProp);

  if (result == true) {
    return myFridge[checkProp];
  } else {
    return console.log("Eat out");
  }


}
```


She checked if there is meat but seems like there is none left. So she decides to eat out
```
checkObj("meat");
console.log(result) -> "Eat out"
```

In the afternoon Phil sent her a text asking her out for dinner

```
function askOutForDinner(answer,count){
if (answer==="yes"){
    console.log("Dinner time!");
} else(count>=10){
    console.log("Time to give up!Haha");
}
return console.log(answer);
}

```

Thao agreed and they had dinner together
```
askOutforDinner("yes", 0)-> "Dinner time!""
```




At the end of the day, she usually checks if there is any task to do in the day. If there is no task, she goes to sleep in peace. If there are tasks to do, she will slave away and sacrifice her holly sleep time. 

```
let sleep=8

function checkTask(task,sleep){
if (task<=0){
    sleep;
}else{
    sleep--;}
return console.log(sleep);
}
```
She had no task left today and could go to sleep in peace
```
checkTask(0,8) -> 8
```







    

