問題タブ [chainable]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
javascript - クラスなしの JavaScript/Typescript チェーン可能な関数
Typescript で連鎖可能な関数を正しくコーディングしようとしています。以下はコードです
関数は、正しい結果が得られるまで機能しています。ただし、typescript エラーが発生しています。This expression is not callable. Not all constituents of type 'number | ((_val: number | undefined) => number | ...)' are callable. Type 'number' has no call signatures.
orsum
を使用せずにそのような関数を正しくコーディングするにはどうすればよいですか?class
this