Before, it would've added a package unless it was a duplicate of the first one in the array.
In JavaScript, the "double-tilde idiom" produces results similar to the floor function, but not quite. It also produces bewilderment in the mind of a programmer unfamiliar with JS minutiae. It's best to avoid it.
I've only recently started using this idiom (only in another project actually) but I see it is not a good one. (x.indexOf('y') > -1) is probably better
Before, it would've added a package unless it was a duplicate of the first one in the array.
In JavaScript, the "double-tilde idiom" produces results similar to the floor function, but not quite. It also produces bewilderment in the mind of a programmer unfamiliar with JS minutiae. It's best to avoid it.