I was writing some code this morning for a demo application, and I kept getting an error in one part of my Flex code and I just couldn’t figure out what the hell was going on. Turned out, it was a symptom of how many different function declaration conventions I have to deal with.
It got me thinking about how many different ways do I write a function in one day. Let’s see…
-= Java and C# =-
public <type> myFunction([args])...
-= Javascript =-
function myFunction([args])...
-= ColdFusion =-
public <type> function myFunction([args])...
-= Flex =-
public function myFunction([args]):<type>
No wonder I confused from time to time.
3 Responses for "How to define a function"
sorry off topic — what word press theme is this?
So how did you fixed it :)?
Don’t forget the alternate javascript syntax:
foo = function([args]){}
Leave a reply