Jump to content

Function definition: Difference between revisions

updated neko
m (Replaced stuff that went missing in my last edit (probably due to my dodgy connection).)
(updated neko)
Line 979:
 
=={{header|Neko}}==
<lang Neko>// a function definition can be written either as
var multiply = function(a, b) { a*b }
a * b
}
 
// or
function multiply(a, b) {
a * b
}
 
// and calling a function
$print( multiply(2,3) + "\n");</lang>
 
'''Output:'''
6
 
=={{header|Nemerle}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.