Do I need to specify a return type for an anonymous function in javascript / typescript?

Posted by Anne on Stack Overflow See other posts from Stack Overflow or by Anne
Published on 2012-11-18T10:05:01Z Indexed on 2012/11/18 11:00 UTC
Read the original article Hit count: 159

Filed under:
|

I have the following function:

    $('td:eq(' + iColumn + ') input', oSettings.oApi._fnGetTrNodes(oSettings))
        .each(function () {
            aData.push(this.value);
         });

In typescript I am getting a message saying:

Error   3   Function declared a non-void return type, but has no return expression  

Why am I getting this message? I can resolve the message by saying "return true". Should I always specify a return type for this?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about TypeScript