This is my first post here, new member!
Trying my best to learn JavaScript using some online tutorials : s Anyways, ive been having problems with the min/max embed in a function. I want it to return the biggest or smallest # depending on if i use min or max. I got it to work with this code :
But i need to use a function to return the #. Right now this is what ive got :
Of crouse its not working...Can anyone help me out? Yes i'm a newb at JavaScript.
Thanks!
Trying my best to learn JavaScript using some online tutorials : s Anyways, ive been having problems with the min/max embed in a function. I want it to return the biggest or smallest # depending on if i use min or max. I got it to work with this code :
Code:
<script language="javascript">
<!--
var a=13;
var b=37;
document.write(Math.min(a, b) + " -"); //-
// -->
</script>
But i need to use a function to return the #. Right now this is what ive got :
Code:
<script language="javascript">
<!--
function send_min ()
{
var a=13
var b=37
result = Math.min(a, b);
return result
}
// -->
</script>
Of crouse its not working...Can anyone help me out? Yes i'm a newb at JavaScript.
Thanks!
Last edited: