[removed] inline functions vs predefined functions

前端 未结 13 1912
心在旅途
心在旅途 2020-12-02 11:00

Can any body throw me some arguments for using inline functions against passing predefined function name to some handler.

I.e. which is better:

13条回答
  •  Happy的楠姐
    2020-12-02 11:39

    IMO, declaring a function will be useful only if you intend to re-use it later, in some other way.

    I personally use function expressions (first way) for setTimeout handlers.

    However you might want to know the differences between function declarations and function expressions, I recommend you the following article:

    • Named function expressions demystified

提交回复
热议问题