You can define your own functions in the following way:
You must put the return statement at the end. For more information about the return statement, see . Inside some functions, there can be Mappings
. These may be in any place inside the function.
In addition to any other data type mentioned above, the function can also return void
.
You can also define a function for your own error messages.
This message
variable should be declared as a global string variable and defined anywhere in the code so as to be used in the place where the getMessage()
function is located. The message
will be written to the console.