I am wondering if there is a way to handle the following scenarios in a CLASS in NodeJs. I have a class lets call it contact which has a bunch of string fields but also has for example an array of email class. How can i specify in JavaScript that a value should be actually an Array of another class since i cant specify data type in JavaScript. Also how can i restrict the value in a field in a class, for example my email class has a field called type which can either be "home|work|other"