2 ms·
I think for the purpose of teaching people the basics of programming it's perfectly acceptable to leave them with a basic understanding of "You can only add num
by Me1000 14y ago
I think for the purpose of teaching people the basics of programming it's perfectly acceptable to leave them with a basic understanding of "You can only add numbers and strings." Then allow them to revisit the oddities much later after they have a much better understanding of what objects are. Honestly, I think it might be acceptable to just ask the student to explain to you how "object addition" would work. There are various ambiguous problems you could run into (concatenating two objects with the same property name but different values). I think this basic understanding is enough that even a novice would accept.
I think things like dynamic "this" in javascript will be more confusing for newcomers. But, once you start talking about "this", you should probably already have the basics down.
Edit:
With all that said, I'm not saying Javascript is a great language to learn programming with. But I don't honestly know of a single language that I would be perfectly comfortable telling people to learn with. Most languages have their own quirks.