Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //ZADANIE 1
- var prod1={
- name:"Drożdże",
- price:0.99,
- weight:0.1
- }
- var prod2={
- name:"Woda mineralna",
- price:2,
- weight:1
- }
- document.write("Produkt numer 1 to: "+prod1.name+"<br>");
- document.write("Produkt numer 2 to: "+prod2.name+"<br>");
- document.write("Produkty kosztują razem "+(prod1.price+prod2.price)+"<br>");
- document.write("Produkty ważą razem "+(prod1.weight+prod2.weight)+"<br>");
- //ZADANIE 2
- var currentUser={
- name:"Łukasz",
- surname:"Pańko",
- email:"email.com@email.com",
- www:"www.www.pl",
- userType:"admin",
- show(){
- return "Imie: "+this.name + "<br>" +
- "Nazwisko: " +this.surname + "<br>" +
- "email: " +this.email + "<br>" +
- "Strona: " +this.www + "<br>" +
- "Użytkownik: " +this.userType;
- }
- }
- document.write(currentUser.show());
- //ZADANIE 3
- var book={
- title:"Harry Potter i Czara ognia",
- author:"J.K Rowling",
- pageCount:768,
- publisher:"Media Rodzina",
- showDetails(){
- for(var key in book){
- document.write((key)+": "+(book[key])+"<br>")};
- }
- }
- book.showDetails();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement