Function or loop


#1

var orangeCost = function(price){
console.log(price*5);
}
orangeCost(5);

if i run this code the output is
25

var orangeCost = function(price){
var total = price*5;
console.log("Total = "+total);
}
orangeCost(5);

if i run this code the output is
Total = 25
Total = 25
so my question is why it is printing it for 2 time like its a loop


#2

@adit_srivastava,

In some sections of this course, the course-checker Display's data
this you could then identify by placing two EXTRA code-line's:
console.log( "== My End ==" );
console.log( "== All that is displayed now, is the course-checker ==" );
like

var orangeCost = function(price){
    var total = price*5;
    console.log("Total = "+total);
}
orangeCost(5);
console.log( "== My End ==" );**
console.log( "== All that is displayed now, is the course-checker ==" );

#3

@leonhard.wettengmx.n
I'm sorry but I didn't get that could u explain it