Could anyone tell me how to declare our very own functions those can pass some arguments and can return some too in uniyt javascript?? Also a help about how to extend classes in there? Thanks in advance!!

Try the following links:

http://www.unifycommunity.com/wiki/index.php?title=Head_First_into_Unity_with_JavaScript

http://forum.unity3d.com/threads/34015-Newbie-guide-to-Unity-Javascript-(long)

http://www.unifycommunity.com/wiki/index.php?title=Head_First_into_Unity_with_JavaScript