Thursday, 12 September 2013

Converting a member expression string to a member expression

Converting a member expression string to a member expression

I have a string memEx = 'subjects.i'. How can I use this string to access
subjects.i?
Example: I need a function f() such that f('subjects.i') returns the
member expression object subjects.i, so that if I have to set the marks
property of subjects.i
I can do something like f('subjects.i').marks = 20.

No comments:

Post a Comment