Answer the question
In order to leave comments, you need to log in
How to execute object method via do in CoffeeScript?
There is an object, for example, with two methods that return the same object.
The first one accepts a parameter, the second one does not.
There is no problem with calling the first one.
obj
.firstMethod "firstParameter"
obj
._1 "firstParameter"
.do secondMethod
obj.firstMethod("firstParameter").do(secondMethod);
obj.firstMethod("firstParameter").secondMethod();
Answer the question
In order to leave comments, you need to log in
class Klass
methodA: ->
console.log arguments
this
methodB: ->
console.log arguments
this
obj = new Klass
(do (obj.methodA "aaa").methodB).methodA "aaa"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question