[wp-trac] [WordPress Trac] #45810: JavaScript type comparison should not lead to a type coercion
WordPress Trac
noreply at wordpress.org
Wed Jan 2 13:47:19 UTC 2019
#45810: JavaScript type comparison should not lead to a type coercion
------------------------------+-----------------------------------
Reporter: subrataemfluence | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 5.0.2
Severity: normal | Keywords: has-patch 2nd-opinion
Focuses: coding-standards |
------------------------------+-----------------------------------
Although `typeof jQuery!='undefined'` would not lead to any type
conversion I think it is always better to be on a safer side by writing it
as `typeof jQuey !== 'undefined'`.
I hope this will make the type comparison more concrete.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/45810>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list