Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript] problemy z objektami
Terrorizer
post
Post #1





Grupa: Zarejestrowani
Postów: 345
Pomógł: 3
Dołączył: 31.03.2012

Ostrzeżenie: (0%)
-----


Cześć,
Robię sobie kurs w Codecademy, ale coś słabo mi idzie :/
Nie bardzo wiem co mam tutaj nie tak, mógłby mi ktoś podpowiedzieć ;/ ?
  1. function Rabbit(adjective) {
  2. this.adjective = adjective;
  3. this.describeMyself = function() {
  4. console.log("I am a " + this.adjective + " rabbit");
  5. };
  6. }
  7.  
  8. var rabbit1 = new Rabbit()
  9. rabbit1.adjective = "fluffy";
  10. var rabbit2 = new Rabbit()
  11. rabbit2.adjective = "happy";
  12. var rabbit3 = new Rabbit()
  13. rabbit3.adjective = "sleepy";
  14.  
  15. this.describeMyself();


Ten post edytował Terrorizer 29.06.2014, 15:06:09
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.12.2025 - 22:37