Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Zadanie 1
- const prod1={
- name: "Pringles",
- price: 6,
- weight: 160
- };
- const prod2={
- name: "Lays",
- price: 5,
- weight: 150
- };
- document.write("Zadanie 1");
- document.write("<br>");
- document.write("Produkt numer jeden to: " +prod1.name);
- document.write("<br>");
- document.write("Produkt numer dwa to: " +prod2.name);
- document.write("<br>");
- document.write("Produkty kosztują razem: " +(prod1.price + prod2.price));
- document.write("<br>");
- document.write("Produkty ważą razem: " +(prod1.weight + prod2.weight));
- document.write("<br>");
- //Zadanie 2
- const currentUser={
- name: "Dawid",
- surname: "Kubiak",
- email: "dawidkubiak66@wp.pl",
- www: "www.progi.pl",
- userType: "admin",
- show(){
- document.write("Zadanie 2");
- document.write("<br>");
- document.write("Imię: "+currentUser.name);
- document.write("<br>");
- document.write("Nazwisko: "+currentUser.surname);
- document.write("<br>");
- document.write("E-mail: "+currentUser.email);
- document.write("<br>");
- document.write("Strona www: "+currentUser.www);
- document.write("<br>");
- document.write("Typ użytkownika: "+currentUser.userType);
- document.write("<br>");
- }
- };
- currentUser.show();
- //Zadanie 3
- document.write("Zadanie 3");
- const book={
- title: "Stary Człowiek i Morze",
- author: "Ernest Hemingway",
- pageCount: 237,
- publisher: "Wydawnictwo GoG",
- showDetails(){
- for(const key in book)
- {
- document.write(key);
- document.write("<br>");
- document.write(book[key]);
- document.write("<br>");
- }
- }
- };
- book.showDetails();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement