Last time i wrote about variables and variable privacy. This time i am going to talk about functions.
Ok, let's start easy. Imagine functions as a cannon:
Now, let's say we want cannon to fire when number 1 is smaller than number 2 (it will happen all time time but its ok for now):
That is basically it, functions are like variables, but instead of storing one number, word or sentence it can store commands. For beginners who want to understand whole code first we say:
function *name of the function* (*these are parameters*)
{
*we put code here we want to run*
}
I just want to mention that all of this code can be tested here.
It works for similarly to if or if-else statements and i will talk about that in next post.
Until next time bye o/
Thanks for sharing! I need to get some badass coding skills and this has me on the right path. Small; consistent, lessons!
Thank you, my goal is to teach you the best i can :)
Excellent explanation of functions to newbies.
Thank you, i want to simplify lessons the best as i can :)