开发者

using bindAll in a constructor

开发者 https://www.devze.com 2023-03-15 06:13 出处:网络
i wanted to use _.bindAll(this) in a constructor. unfortunately, i realized the prototype functions are not considered \"own properties\", so _.bindAll via _.funct开发者_高级运维ions won\'t find them

i wanted to use _.bindAll(this) in a constructor.

unfortunately, i realized the prototype functions are not considered "own properties", so _.bindAll via _.funct开发者_高级运维ions won't find them.

is there another way to get at the prototype functions of "this" in a constructor functions?


You could use the dreaded for-in loop, since that iterates over prototype properties as well.

0

精彩评论

暂无评论...
验证码 换一张
取 消