var Actions = new Dictionary<String, Action> {
{"foo", w.foo },
{"bar", w.bar }
};
var Strategies = new Dictionary<String, List<String>>(){
{"in one", new List<String> { "foo", "bar" } }
};
// run
var actions = Strategies["in one"];
actions.ForEach((action)=> Actions[action]());
function find(title, poll, parent){
parent = parent || poll;
if (poll.title === title)
return parent;
var result;
poll.reply && poll.reply.some(function(reply){
return reply.poll && (result = find(title, reply.poll, poll)) || false;
});
return result;
}
find('Вопрос 2', mass.poll);