I have this JavaScript excerpt, and I was wondering if this (primarily the usage of switch case) would be considered good practice. One item of note is that I have it separated into two similar parts to not evaluate the same boolean check over and over again when it is static the whole time.if (strict) {  for (var i = 0, len = node.properties.length; i < len; ++i) {    var other = node.properties[i];    if (other.key.name !== prop.key.name) continue;    var otherKind = other.kind;    switch (kind) { // used as a kind of goto    case init:    case get:    case set:      if (otherKind === get ||          otherKind === set ||          otherKind === init)        raise(prop.key.start, Redefinition of property);  }} else if (sawGetSet)) {  loop:  for (var i = 0, len = node.properties.length; i < len; ++i) {    var other = node.properties[i];    if (other.key.name !== prop.key.name) continue;    var otherKind = other.kind;    switch (kind) { // used as a kind of goto    case get:    case set:      if (otherKind === init) break;    case init:      if (otherKind === get || otherKind === set) break;    default: continue loop; // skip the below portion, don't throw error    }    raise(prop.key.start, Redefinition of property);  }}Should I rewrite it like this, something else, or leave it as is? (Speed still is important.)if (strict) {  for (var i = 0, len = node.properties.length; i < len; ++i) {    var other = node.properties[i];    if (other.key.name !== prop.key.name) continue;    var otherKind = other.kind;    if ((kind === init ||         kind === get ||         kind === set) &&        (otherKind === get ||         otherKind === set ||         otherKind === init)) {      raise(prop.key.start, Redefinition of property);    }  }} else if (sawGetSet)) {  for (var i = 0, len = node.properties.length; i < len; ++i) {    var other = node.properties[i];    if (other.key.name === prop.key.name) continue;    var otherKind = other.kind;    if ((kind === get ||         kind === set) &&        (otherKind === init ||         otherKind === get ||         otherKind === set)) {      raise(prop.key.start, Redefinition of property);    } else if ((kind === init) &&               (otherKind === get ||                otherKind === set)) {      raise(prop.key.start, Redefinition of property);    }  }}
Code to initialize, set, or get node properties
javascript;comparative review