A
A
Alexander Pashkevich2017-04-17 20:32:29
OOP
Alexander Pashkevich, 2017-04-17 20:32:29

Call an object method with its parameters as arguments?

In general, there is an object A

function ff(x,y){
console.log(x,y);
}
var a = {
a:'Hello',
b:'World',
c:ff(a,b)
};
a.c();

In general, the C method does not work ( How can I pass already prepared object parameters to it as arguments?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Pashkevich, 2017-04-17
@Ankell

Already found)
Suddenly useful to someone)

function ff(x,y){
console.log(x,y);
}
var a = {
a:'Hello',
b:'World',
c:function(){
ff(this.a,this.b);
}
};
a.c();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question