Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Zadanie1
- const prod1={
- name: "Szynka",
- price: 30,
- weight: 1,
- }
- const prod2={
- name: "Ziemniaki",
- price: 20,
- weight: 2,
- }
- document.write("Produkt numer jeden to: "+prod1.name+"<br>");
- document.write("Produkt numer dwa to: "+prod2.name+"<br>");
- document.write("Kosztują razem:"+(prod1.price+prod2.price)+"zł <br>");
- document.write("Produkt numer jeden to: "+(prod1.weight+prod2.weight)+"kg<br>");
- //Zadanie2
- const currentUser={
- name: "Michał",
- surname: "Walczak",
- www: "localhost.com",
- userType: "HeadAdmin",
- show: function(){
- document.write("Imię: "+currentUser.name+ "<br> Nazwisko: "+currentUser.surname+"<br> adres e-mail: "+currentUser.email+"<br> Adres strony WWW: "+currentUser.www+"<br> Typ Użytkownika: "+currentUser.userType+"<br>");
- }
- }
- currentUser.show();
- //Zadanie3
- const book={
- name: "Silmarilion",
- author: "J.R.R Tolkien",
- pageCount: 482,
- publisher: "Allen & Unwin",
- showDetails: function(){
- for(const key in book){
- document.write(book[key]+"<br>");
- }
- }
- }
- book.showDetails();
Advertisement
Add Comment
Please, Sign In to add comment