Sorin Adrian Carbunaru Sorin Adrian Carbunaru - 1 year ago 124
Javascript Question

Declare and use an enum in Node.js with Geddy

For my model I want to have an enumeration as a datatype, but I don't know how to do that. I couldn't find anything helpful in the documentation from or with google.

A model could be defined like this:

var fooModel= function () {
fooField: {type: 'datatype'},

Where and how should I define the enumeration and how do I use it?

Answer Source

Remember that Node is just javascript, and javascript does not (to the best of my knowledge) have enums. You can however fake it, which is discussed here: Enums in JavaScript?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download