so I want to write a function that takes 3 parameters, 3rd one being optional. I want something to check that if optional does not exist then give it a default value. IS there a IF Not way of doing it? if not then whats the best way of doing it?
This is what i want
foo.(x,y, opt){
if (!opt){opt = 1;}
......
......
}
This is what I have:
foo.(x,y, opt){
if (opt){}
else {opt = 1;};
......
......
}