Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
20
rated 0 times [  21] [ 1]  / answers: 1 / hits: 99111  / 11 Years ago, fri, march 8, 2013, 12:00:00

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 geddyjs.org or with google.



A model could be defined like this:



var fooModel= function () {
this.defineProperties({
fooField: {type: 'datatype'},
.............................
});
}


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


More From » node.js

 Answers
1

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?


[#79724] Thursday, March 7, 2013, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
valentinam

Total Points: 166
Total Questions: 117
Total Answers: 81

Location: Puerto Rico
Member since Sun, Jun 27, 2021
3 Years ago
;