Are you first timer at lazacode.org? 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
14 views
added Mar 6 in Javascript by LC Marshal Lieutenant (16,990 points)
let PropertyType = ColumnMainData.result.field_property_type.und['1'].target_id;
switch (PropertyType) {
    case '34':
      PropertyType = 'Condominium / Apartment / Serviced Residence';
      break;
    case '35':
      PropertyType = 'Flat';
      break;
    case '38':
      PropertyType = 'Link Bungalow / Semi-Detached House';
    // default:
    // PropertyType = 'null';
}

 

Please log in or register to response this reference.

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...