# Why use return?

**URL:** <https://forum.kirupa.com/t/why-use-return/128769>\
**Category:** Uncategorized\
**Created:** [November 16, 2004, 2:48am UTC](https://forum.kirupa.com/t/why-use-return/128769 "2004-11-16T02:48:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marc0047](https://avatars.discourse-cdn.com/v4/letter/m/ce73a5/32.png) [@marc0047](https://forum.kirupa.com/u/marc0047)\
**Post date:** [November 16, 2004, 2:48am UTC](https://forum.kirupa.com/t/why-use-return/128769/1 "2004-11-16T02:48:02Z")

</div>

I’m trying to understand the purpose of using return in functions. I’m reading Robert Penner’s “Programming Macromedia Flash MX” and there is a good example of how to apply functions using the prototype feature:

// Code start

MovieClip.prototype.spin = function (angle) {  
this.\_rotation += angle;  
return this.\_rotation;  
}

result = \_level5.box.spin(10);

// Code stop

I created a second movieclip called box2, and rather than call it through a variable, I simply called the function this way:

box2.spin(10);

They both produce the same result. I’m just wondering what the purpose is for using return in this particular case. I unfortunately can’t seem to find more information on this simple idea. I am reading ahead but I am afraid if I don’t understand this concept now, I’m going to miss something very important in the future!

Any tips would be greatly appreciated.
