Echo JS 0.11.0

<~>
tracker1 1678 days ago. link 1 point
I really don't care for these types of articles, because they're usually written poorly and the questions themselves have many, many holes in them. I hit the filter, senior, practical..

First question uses stringify to compare two object... Unfortunately this does not work, because there is no guarantee of property order in serialization... Use json-stringify-safe[1]

#8 Does it make sense to add directive ‘use strict’ in modern scripts?  No... if you are writing ESM, it's not just that babel adds the "use strict" it's that strict is implied and Babel adds it for standards compatibility.  It's not needed, even if using modules directly in the browser.

#10 is really muddy and not better in terms of being well understood.

#13 is not something someone should be expected to know out of hand... beyond this, the trend is towards simpler wrappers such as parcel that handle a lot of this for you.

#15 incomplete, assumes lodash, may as well assume jquery if doing that.  Better to ask about how one would handle this, than specific examples. Should probably check against the src to see if it's already the appropriate image src.  the TODO comment has no functionality to enforce.

#18 setting the height doesn't change the exposed object's height (getter preffered).

That's as far as I'm going... 


1. https://www.npmjs.com/package/json-stringify-safe

Replies