I can't find the similiar problem, I guess it's because i can't find a correct question/answer. I want to create a function that will use default values if there is not arguments passed when calling a function, if so, replace default values with the values passed in function's parameters. For example:
function openBlock(false){
// if parameter was passed with 'false' value, it will do this
// else it will put automatically a 'true' value to an function's argument
}
So if call a function openBlock()
without any params, it will consider that it's param true
by default. If i call a function with argument false
like openBlock(false)
it will override the default behavior.
Thanks