This reads kind of funny, why not just `if (device.length <= 0)` or `if (device.length == 0)`