I have a function, that takes 3 arguments… but i would like to completely avoid giving it the third one for example and then the function sort of assumes things on its own.
Like:
func add3(a,b,c) -> float:
if c == null:
return a+b
else:
return a+b+c
Worth mentioning as well that it doesn’t have to be a “null”, it can be any other value that will be treated as “default” when this argument is not provided explicitly. So e.g. func add3(a,b,c = 420) -> float:
Will also work fine, it will always add 420 if you don’t provide the 3rd argument explicitly.