Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Zadanie 1
- const prod1 =
- {
- name:"Chleb",
- price: 2,
- weight: 0.5
- };
- const prod2 =
- {
- name:"Dżem",
- price: 4,
- weight: 0.3
- };
- document.write ("Produkt numer jeden to: "+prod1.name+"<br>"+"Produkt numer dwa to: "+prod2.name+"<br>"+"Produkty kosztują razem: "+(prod1.price+prod2.price)+"zł"+"<br>"+"Produkty ważą razem: "+(prod1.weight+prod2.weight)+);
- //Zadanie 2
- const currentUser={
- name:"Marcin",
- surname:"Molenda",
- email:"marcin.molenda17@wp.pl",
- www:"localhost",
- userType:"admin",
- show(){
- document.write("Imię: "+currentUser.name+"<br>"+"Nazwisko: "+currentUser.surname+"<br>"+"E-mail: "+currentUser.email+"<br>"+"Strona www: "+'<a href="http://localhost">'+currentUser.www+"</a>"+"<br>"+"Typ użytkownika: "+currentUser.userType);
- }
- };
- currentUser.show();
- //Zadanie 3
- const book={
- title:"JavaScript i jQuery. Interaktywne strony WWW dla każdego.",
- author:"J.Duckett",
- pageCount: 648,
- publisher:"Helion",
- showDetails(){
- for(const key in book)
- {
- document.write((key)+": "+book[key]+"<br>");
- }
- }
- };
- book.showDetails();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement