From 0b763ee902886d71dabf144a8212ea51d2ebca26 Mon Sep 17 00:00:00 2001 From: Zaid7 Date: Wed, 12 Jan 2022 15:49:02 +0000 Subject: [PATCH] JS front end dev --- 03_06/script.js | 19 +++++++++++++++++++ 08_07/script.js | 6 ++---- Practice/05_04/index.html | 2 +- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/03_06/script.js b/03_06/script.js index 0203772a..4a574206 100755 --- a/03_06/script.js +++ b/03_06/script.js @@ -21,4 +21,23 @@ const backpack = { }, }; +const Home = { + name: "mountbelRd", + no: 24, + type: "Address - Duplex", + people: { + p1: { + name: "zaid", + age: 21 + }, + p2: { + name: "uzy", + age: 22 + }, + }, + isOwner: false +} console.log("The backpack object:", backpack); +console.log("The Home object:", Home); +console.log("People:", Home.people); +console.log("Age of p1", Home.people.p1.age, "Name of p2", Home.people.p2.name); diff --git a/08_07/script.js b/08_07/script.js index c337c3bb..61fdb854 100755 --- a/08_07/script.js +++ b/08_07/script.js @@ -3,9 +3,7 @@ * @link https://developer.mozilla.org/en-US/docs/Glossary/Function */ -const tipCalculator = () => { - let sum = 29.95; - let percentage = 18; +const tipCalculator = (sum,percentage) => { let tip = sum * (percentage / 100); let total = sum + tip; console.log(` @@ -16,4 +14,4 @@ const tipCalculator = () => { `); }; -tipCalculator(); +tipCalculator(20,20); diff --git a/Practice/05_04/index.html b/Practice/05_04/index.html index 56f5937a..faeb6728 100644 --- a/Practice/05_04/index.html +++ b/Practice/05_04/index.html @@ -17,7 +17,7 @@