jika lagi jika php ternary

var name = (variable === 1) ? 'foo' : ((variable === 2) ? 'bar' : 'baz');
Jaskaran