I am trying to understand the concepts of functions and methods but while practicing, I am getting confused in different situations like how, where and when to exactly use `return` statements?
So here, are two parts of codes from separate operations.

code 1:

```
var john = {
     fname : 'John',
     mass : 45,
     age  : 24,
     height : 2,
     calculateBMI : function(){
         this.bmi = this.mass/(this.height * this.height);
         return this.bmi;

     } 

```

code 2:

```
var adi ={
    fName : "adi",
    bills : [124,48,268,180,242],
    calculateTips : function(){
          this.tips =[];
          this.totalValue = [];

      for(var i=0; i<this.bills.length;i++){
          var percentage;
          var bill = this.bills[i]

          if(bill<50){
              percentage = 0.2;
          }else if(bill>=50 && bill<200){
              percentage = 0.15;
          }else{
              percentage = 0.1;
          }
          this.tips[i] = percentage * bill;
          this.totalValue[i] = bill + bill * percentage;

```