Oh, no! Don't worry about it. I take no offense because I know that this is an educated discussion. 😉
As for the examples you provided, I definitely agree with them. I think it semantically makes sense to return undefined in your examples since the values of the fields haven't been defined in the first place. In other words, what I'm trying to say that your usage of undefined is truly valid and justifiable in those specific contexts.
In regard to the quote you cited, I see now how my wording can be misinterpreted and may have implied that undefined is "always" wrong. That is my mistake. When I wrote the sentence you quoted, what I meant by it is that null should always be returned if the intent is to literally pass absolutely nothing.
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.
Oh, no! Don't worry about it. I take no offense because I know that this is an educated discussion. 😉
As for the examples you provided, I definitely agree with them. I think it semantically makes sense to return
undefined
in your examples since the values of the fields haven't been defined in the first place. In other words, what I'm trying to say that your usage ofundefined
is truly valid and justifiable in those specific contexts.In regard to the quote you cited, I see now how my wording can be misinterpreted and may have implied that
undefined
is "always" wrong. That is my mistake. When I wrote the sentence you quoted, what I meant by it is thatnull
should always be returned if the intent is to literally pass absolutely nothing.