diff --git a/quiz/arrow.html b/quiz/arrow.html
index fdac020..ad88b5b 100644
--- a/quiz/arrow.html
+++ b/quiz/arrow.html
@@ -12,14 +12,16 @@
diff --git a/quiz/scripts/closure.js b/quiz/scripts/closure.js
index 627414d..93d1e0c 100644
--- a/quiz/scripts/closure.js
+++ b/quiz/scripts/closure.js
@@ -1,10 +1,11 @@
function setColor(set) {
let changeColor = set;
- if(changeColor) {
- let userColor = document.getElementById('color').value;
- document.getElementById('myPara').style.color = userColor;
+ return () => {
+ if(changeColor) {
+ let userColor = document.getElementById('color').value;
+ document.getElementById('myPara').style.color = userColor;
+ }
}
-
}
window.onload = function() {
diff --git a/quiz/scripts/logger.js b/quiz/scripts/logger.js
index 5d03eb6..2abe1d9 100644
--- a/quiz/scripts/logger.js
+++ b/quiz/scripts/logger.js
@@ -1 +1,8 @@
// Define a JavaScript function called logMsg() that can be used to log an error message for any object that contains the property errMsg.
+function logMsg() {
+ console.log(`Error: ${this.errMsg}`);
+}
+const obj1 = {
+ errMsg: "error has occured"
+}
+logMsg.call(obj1);
\ No newline at end of file