From 037724b5687bc9d5fed9291b10b3a4de24b87181 Mon Sep 17 00:00:00 2001 From: Sundus Hussein Date: Fri, 28 Nov 2025 20:12:48 -0800 Subject: [PATCH] completed week5 --- .DS_Store | Bin 0 -> 6148 bytes arrays.js | 32 +++++++++++++++++++++++++------- callbacks.js | 27 +++++++++++++++++++++++++-- index.html | 3 +++ objects.js | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 100 insertions(+), 9 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..1d52f2c7750bbb35ed2b3d7131890b66eb7b6d75 GIT binary patch literal 6148 zcmeHKyH3ME5S)b+2~eb@yf3iC9~_ZWq@aNxAa-biktG5JoqIlp@1ug*+XG@_T7=N9 zbvJu=JNFpL_W&S^$ITfq2QXz)6m>>St4Es-a`1#GsgEb@P+*JQsu}6%FIMT?XISH& z-x_=KZ|kaQE4HdM=S;<0GJ3!XYDPEwDq@Y>uXXo$F9Y5YS~9k{A?IP7BhLfQ43}7P z1|=?t1@5p}HT$E;>wv+cn=9Z7xB{+#EAXQNJhRoN$A+G}05yPDWoZ%*qKFW5&*qEi^GI(WsK27-DqRha49(c7{fW= 30){ + console.log(`${tempretureValue}°C is hot`) + } else if(tempretureValue >= 15 && tempretureValue <= 30) { + console.log(`${tempretureValue}°C is Warm`) + } else if(tempretureValue <= 15) { + console.log(`${tempretureValue}°C is cold`) + } else { + console.log("put the tempreture value here") + } + +} + +checkTemperature(10, theCallBackFunction) diff --git a/index.html b/index.html index 1104b64..1201b94 100644 --- a/index.html +++ b/index.html @@ -3,6 +3,9 @@ Week 5 Assignment

Look at the console to see the results

+ + + diff --git a/objects.js b/objects.js index e2426e9..8885928 100644 --- a/objects.js +++ b/objects.js @@ -30,6 +30,19 @@ Expected Output: // ✍️ Solve it here ✍️ +const gamerProfile = { + username: "ShadowSlayer", + level: 5, + isOnline: false, +updateOnlineStatus: function(gamerStatus){ + if(gamerStatus === true) + return `${this.username} is now online.` + else{ + return `${this.username} is now absent` + } + } +}; +console.log(gamerProfile.updateOnlineStatus(true)) /* @@ -64,6 +77,20 @@ Expected Output: // ✍️ Solve it here ✍️ + const dress = { + name: "Evening Gown", + size: "M", + inStock: true, +checkAvailability: function(dressAvailability){ + if(dressAvailability === true) + return`${this.name} is available in size ${this.size}` +else{ + return `${this.name} is not available in size ${this.size}` +} +} +} +console.log(dress.checkAvailability(true)) + /* @@ -104,3 +131,23 @@ Features: */ // ✍️ Solve it here ✍️ + +const supercar = { + model: "Ferrari SF90", + price: 500000, + features: { + color: "Red", + } +}; + +function addFeature(supercar,featureName){ + supercar.features[featureName] = true + console.log(`${featureName} has been added to ${supercar.model}`) +} + +for (let key in supercar.features){ + console.log(`${key}: ${supercar.features[key]}`) +} + +addFeature(supercar, "turbo") +