Google지도 유틸리티 라이브러리에서 source of InfoBubble을 찾았습니다. 작성자가 점 표기법으로 프로토 타입 메소드를 작성했지만 메소드 정의 끝에 해당 프로토 타입 속성을 대괄호 표기법으로 다시 지정한다는 것을 알았습니다.InfoBubble.js 제작자가 대괄호 표기법을 사용하여 프로토 타입 메서드를 재 할당하는 이유는 무엇입니까?
이 명확해야합니다
/**
* Set the style of the shadow
*
* @param {number} shadowStyle The style of the shadow.
*/
InfoBubble.prototype.setShadowStyle = function(shadowStyle) {
this.set('shadowStyle', shadowStyle);
};
InfoBubble.prototype['setShadowStyle'] = InfoBubble.prototype.setShadowStyle;
어떤 생각을?