Inventor, Founder of ZIM JavaScript Canvas Framework and Nodism, Professor of Interactive Media at Sheridan, Canadian New Media Awards Programmer and Educator
Any idea why they made null not work to trigger the default parameter value? I guess it is handy if you really want that parameter to have a null value rather than the default. I don't recall ever needing that... but this way there is a choice. It is just sort of annoying after years of typing null in for a default parameter we have to type undefined. That is twice as much typing. Kind of wished they went the other way - pass an undefined in to keep the parameter undefined. Pass a null in to trigger the default parameter. Whatever - too late now.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Any idea why they made null not work to trigger the default parameter value? I guess it is handy if you really want that parameter to have a null value rather than the default. I don't recall ever needing that... but this way there is a choice. It is just sort of annoying after years of typing null in for a default parameter we have to type undefined. That is twice as much typing. Kind of wished they went the other way - pass an undefined in to keep the parameter undefined. Pass a null in to trigger the default parameter. Whatever - too late now.