Skip to content
Advertisement

How return count result instead closure function?

I have a function that returns boolean if tree has at least one enebled value:

JavaScript

Using is:

JavaScript

How to return result not calling outher functon (this.tree)?

Advertisement

Answer

You can go about this a few ways. The most simple one would probably be to invoke the internal function within the outer function, and return the result:

JavaScript

However, as @sledetman mentioned in the comments below your question, the code snippet you provided does not “return a boolean if tree has at least one enabled value”.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement