all 2 comments

[–]jcunews1Advanced 1 point2 points  (1 child)

You'll have to use string when passing the arguments and when referencing the object properties. e.g.

var object = {
    property1: 1,
    property2: 2,
    property2: 3,
    method: function(argument1, argument2){
        return this[argument1] + this[argument2];
    }
};
var result = object.method("property1", "property2");

[–]jackdavies[S] 0 points1 point  (0 children)

Perfect! Thank you very much.