inline ifs in js