Are there legitimate uses for JavaScript's “with” statement?

后端 未结 30 2404
伪装坚强ぢ
伪装坚强ぢ 2020-11-22 04:22

Alan Storm\'s comments in response to my answer regarding the with statement got me thinking. I\'ve seldom found a reason to use this particular language feature, and had ne

30条回答
  •  天命终不由人
    2020-11-22 05:03

    I just really don't see how using the with is any more readable than just typing object.member. I don't think it's any less readable, but I don't think it's any more readable either.

    Like lassevk said, I can definitely see how using with would be more error prone than just using the very explicit "object.member" syntax.

提交回复
热议问题