struct.js
function(name) {
      if (name in props) {

        // Check property descriptor
        var desc = this.getOwnPropertyDescriptor(name);
        if (props[name].nullable === false) {
          throw name + ' is not allowd null or undefined';
        }

        return delete obj[name];
      } else {
        throw name + ' is not defined in this struct';
      }
    }
function(name) {
      if (name in props) {

        // Check property descriptor
        var desc = this.getOwnPropertyDescriptor(name);
        if (props[name].nullable === false) {
          throw name + ' is not allowd null or undefined';
        }

        return delete obj[name];
      } else {
        throw name + ' is not defined in this struct';
      }
    }
function ( name ) { if ( name in props ) { // Check property descriptor var desc = this . getOwnPropertyDescriptor ( name ) ; if ( props [ name ] . nullable === false ) { throw name + ' is not allowd null or undefined' ; } return delete obj [ name ] ; } else { throw name + ' is not defined in this struct' ; } }
Delete specified property.
Check property name if defined in advance.
Delete specified property . Check property name if defined in advance .