Are you first timer at Why not join us and start exchange your programming knowledge with everyone. Register today!

JS - Using switch instead of ifelse for heaps possibilities

0 votes
added Mar 6 in Javascript by LC Marshal Captain (23,680 points)
let PropertyType = ColumnMainData.result.field_property_type.und['1'].target_id;
switch (PropertyType) {
    case '34':
      PropertyType = 'Condominium / Apartment / Serviced Residence';
    case '35':
      PropertyType = 'Flat';
    case '38':
      PropertyType = 'Link Bungalow / Semi-Detached House';
    // default:
    // PropertyType = 'null';


Please log in or register to response this reference. - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.