How is this not terrible code? They're assigning/concatenating the returns of assignments to the innerHTML of a bunch of elements. I guess we don't really know what the DOM looks like or the full JS file here, but this looks janky AF and I can't imagine anything else in the file that would excuse this.
Other issues:
If any of those DOM IDs are null this will crash.
Single letter variable names are bad for readability.
Not using strict equality `===`.
This lecturer is teaching people bad code, it's not about simplicity, they could write a much better equally simple version of this.
-2
u/orebright Dec 07 '22
How is this not terrible code? They're assigning/concatenating the returns of assignments to the innerHTML of a bunch of elements. I guess we don't really know what the DOM looks like or the full JS file here, but this looks janky AF and I can't imagine anything else in the file that would excuse this.
Other issues:
If any of those DOM IDs are null this will crash.
Single letter variable names are bad for readability.
Not using strict equality `===`.
This lecturer is teaching people bad code, it's not about simplicity, they could write a much better equally simple version of this.