title: How to verify property type in Javascript class?
body: <p>I am trying to get an idea how to build <code>javascript class</code> that would represent an object like <code>Person</code>. </p>
  
  <pre><code>class Person {
      constructor(name, age, hobbies) {
          this.name = name; // string
          this.age = age; // number
          this.hobbies = hobbies; // array
      }
  }
  </code></pre>
  
  <p>This object will be used in <code>react/redux-form</code> to map incoming and outgoing data from/to <code>database</code>. My question is how can I enforce <code>hobbies</code> are really <code>array</code> type or <code>age</code> as <code>number</code> and <code>name</code> as <code>string</code> in its class definition? In <code>java</code>, I am allowed to build simple data model via strong type of its property <code>(e.g. String name = null)</code> and having <code>getter/setter</code> method for it.</p>