Minor JS nit: no ternary operator is needed here, just the conjunction.