December 2018
— This is how I would do it
Okey, than I'll just recursively call myself
function HSVtoRGB(H, S, V) { let r; let g; let b; const h = H; const s = S; const v = V; if (arguments.length === 1) { return HSVtoRGB(H.h, H.s, H.v); }
— Lol, nice
— But problematic
— How?
— HSVtoRGB({ h: 4 });
HSVtoRGB({ h: 4 });
— I can't help stupid users :D
— Uhhh, why use arguments?
— And not spread / rest?
— What do you mean?
— function HSVtoRGB(...args) {}
function HSVtoRGB(...args) {}
— It's better practice than using arguments
arguments