ADDED: What follows is wrong, and not the solution!
if (locker % id && locker >= id) {
I can't even guess what is intended here, but it isn't acceptable JavaScript code.
&& is a diadic operator, it expects two boolean operands, things that are either true or false; locker % id is a number, not a boolean.