![]() |
![]() |
![]()
Post
#1
|
|
![]() Developer Grupa: Moderatorzy Postów: 3 045 Pomógł: 290 Dołączył: 20.01.2007 ![]() |
Witam, obiekty w JavaScript mogę zapisać na dwa różne sposoby.
Pierwszy sposób: Kod Object = { Version: '1.0', setVersion: function (Version) { this.Version = Version; }, getVersion: function () { return this.Version; } } Oraz drugi sposób: Kod var Object = function () { this.Version = '1.0'; this.setVersion = function (Version) { this.Version = Version; } this.getVersion = function () { return this.Version; } } Jaki są zalety, jak i wady korzystania z danego rozwiązania? Kolejne pytanie, czym jest this[0] w JavaScript? |
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 4.07.2025 - 06:00 |