Hey all,
I'm currently practicing Named Parameters. At the moment my code looks like this:
So I can call it by e.g.
or
I'm just wondering if this is the right method to do it, as the method signature with {...} = { } looks a bit weird IMO. By the way, I want to have my code to be compatible with MV.
I'm currently practicing Named Parameters. At the moment my code looks like this:
JavaScript:
drawPath({
start = "south",
end = "north",
mapName = "Path",
weightFunction = undefined,
thickness = 3,
mode = "smooth"
} = { }) {
So I can call it by e.g.
Code:
drawPath({ start: "west", end: "east", thickness = 4 })
or
Code:
drawPath()
I'm just wondering if this is the right method to do it, as the method signature with {...} = { } looks a bit weird IMO. By the way, I want to have my code to be compatible with MV.