src/Form.js
/*
    Field class allows objects to evaluate correctly according to context.
    - if used in an expression, will return a value or string.
    - for JSON.stringify() returns a scalar
    - BUT also allows explicit access to properties. e.g. field.required, field.name etc.

    Should allow us to eliminate getFieldProperty()
  */
Field class allows objects to evaluate correctly according to context.
if used in an expression, will return a value or string.
for JSON.stringify() returns a scalar
BUT also allows explicit access to properties.

Should allow us to eliminate getFieldProperty()
Field class allows objects to evaluate correctly according to context . if used in an expression will return a value or string . for JSON . stringify () returns a scalar BUT also allows explicit access to properties . Should allow us to eliminate getFieldProperty ()
function createField(name, value, readonly = false, required = true) {
  class Field {
    valueOf() { return value; }
    toString() { return value.toString(); }
    toJSON() { return value; }
    get '$value'() { return value; }
    get '$name'() { return name; }
    get '$readonly'() { return readonly; }
    get '$required'() { return required; }
  }
  const newField = new Field();
  return newField;
}
function createField ( name , value , readonly = false , required = true ) { class Field { valueOf ( ) { return value ; } toString ( ) { return value . toString ( ) ; } toJSON ( ) { return value ; } get '$value' ( ) { return value ; } get '$name' ( ) { return name ; } get '$readonly' ( ) { return readonly ; } get '$required' ( ) { return required ; } } const newField = new Field ( ) ; return newField ; }
Field class allows objects to evaluate correctly according to context.
Field class allows objects to evaluate correctly according to context .
// Use getters and scope variables so that the children are not enumerable