I’ve remember learning about why Boolean parameters are bad, and thanks for the article. The only question I have about that is:
Take Element.cloneNode()
without passing the Boolean argument is that one a bad design?
I’m trying to understand why Element.cloneNode(false)
would mean not to clone it? What else would it mean, what’s the point of calling it? Or is this a good example of using a Boolean for a parameter.
So should Element.cloneNode(true)
be changed to Element.cloneNode({deep: true})
. or something similar.
Ok now on Math.random()
really?!?! it’s called with arguments, yet the arguments are ignored?
You said with call
or apply
so:
Math.random.call(Math, 1, 2, 'whateverBecauseThisIsIgnored');
Math.random.apply(Math, [1, 2, 'whateverBecauseThisIsIgnored');
Or how else would it be?
So what if it were like this: Math.random({min: 1, max: 2, intergersOnly: true});
I apologize if I sound angry Brendan, I’m not, I’m just trying to understand more just in case I encounter something else like this?