Do you use 'this' in front of instance variables?

前端 未结 17 2135
猫巷女王i
猫巷女王i 2020-12-19 01:08

When accessing instance variables or properties of a class from within the class itself, do you prepend them with \"this.\"?

17条回答
  •  無奈伤痛
    2020-12-19 02:04

    Anytime I have a method parameter whose name is identical to an instance variable (rarely) I do, to avoid confusion.

提交回复
热议问题