My team is using this plugin and I noticed a few places that needed to be cleaned up and optimized:
A bunch of inconsistency with the use of strict equality (===). Strict equality should always be used when you're not dealing with falsey objects (i.e. null == undefined is permitted, so therefore obj == null or obj == undefined is permissible)
There was a missing semicolon. Every other line ends with a semicolon, so that one needed one as well.
A minor for loop optimization would be to cache the length of the for loop inside of a variable in the first portion of the loop. This saves having to call length every single time.While this is optimized in modern browsers, given you support legacy browsers, this is a worthwhile optimization.
My team is using this plugin and I noticed a few places that needed to be cleaned up and optimized:
===
). Strict equality should always be used when you're not dealing with falsey objects (i.e.null == undefined
is permitted, so thereforeobj == null
orobj == undefined
is permissible)