I need to convert the output of my function into a string variable.
Here's the function I have:
schemaTitle: function() {
return Categories.findOne({_id: "Gt5prgS4RW3GW23NG"}).title;
}
Now, I want to use the returned value as a string variable in a switch statement like this:
switch(this.schemaTitle) {
case "HOME":
return {
schemaName: "StateSchema"
};
break;
}
Is there a way to accomplish this?