Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
Resource icon

What is a Function?

What is a function?​

A function... what is a function? A function is a group or set of instructions that can be called anytime. A function is a great way to reuse code without actually writing it over and over again.

Disclaimer: the syntax below does not belong to any particular language, depending on the language it may be slightly different.

Example:​

Making eggs:
  1. Cracking an egg into a pan.
  2. Flip egg.
  3. Place on a plate.

Syntax:​

[CODE title="function syntax"]function makeEggs() {
add egg to pan
flip egg
place egg on plate
}[/CODE]

With this function, we can call by using makeEggs(); within our code and it will execute the code within the makeEggs function. Once code has been successfully been executed it will return after where the function was called.
Author
Malcolm
Views
929
First release
Last update

Ratings

0.00 star(s) 0 ratings

More resources from Malcolm

Back
Top Bottom