Functions

A function is very often a dialogue. The writing is as follows:

nameFunction() {

}

A function can contain parameters:

nameFunction(args1, args2) {

}

Trigger a function

A function is delineated as follows:

nameFunction()

A decorator can indicate the role of a function and trigger it according to a situation

Return of a function

A function can return a value

start() {
    str = nameFunction()
}

nameFunction() {
    return 'hello'
}

Warning, unlike JS, the return keyword must return a value. He can not be alone

Last updated