From a3f1cb6f960d1cf74f53efdf775faa976b715eea Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 15 Dec 2017 13:18:56 -1000 Subject: [PATCH 1/4] isCookieJarOpen --- scope.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scope.js b/scope.js index e0d709e..4cea44e 100644 --- a/scope.js +++ b/scope.js @@ -2,11 +2,11 @@ var isCookieJarOpen = null; function closeLid() { - /* answer here */ + isCookieJarOpen = false; } function openLid() { - /* answer here */ + isCookieJarOpen = true; } From c66edfac25e637a866e837920344b596ab62fdae Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 15 Dec 2017 13:26:16 -1000 Subject: [PATCH 2/4] innerOuterFunctions --- scope.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scope.js b/scope.js index 4cea44e..d62923a 100644 --- a/scope.js +++ b/scope.js @@ -17,7 +17,7 @@ function outerFunction() { function innerFunction() { var world = 'World'; - return /* answer here */; + return hello + " " + world ; } return innerFunction(); } From 9cec06e31f881e32f19b7cedcc96431aa133a59c Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 15 Dec 2017 14:09:57 -1000 Subject: [PATCH 3/4] matrix --- scope.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scope.js b/scope.js index d62923a..264e661 100644 --- a/scope.js +++ b/scope.js @@ -31,8 +31,8 @@ function addMatrixElements(matrix) { for(var i = 0; i < matrix.length; i++) { /* fix counter variables in the second loop */ - for(var i = 0; i < matrix[i].length; i++) { - result = result + matrix[i][i]; + for(var n = 0; n < matrix[i].length; n++) { + result += matrix[i][n]; } } return result; From ea64ead2f818db073ffc218dbd7f2667dd01ea63 Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 15 Dec 2017 14:19:06 -1000 Subject: [PATCH 4/4] authenticateUser --- scope.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scope.js b/scope.js index 264e661..f327422 100644 --- a/scope.js +++ b/scope.js @@ -45,8 +45,8 @@ function sendDataToClient() { var userObject = { handle: 'neo', - authenticated: false - } + authenticated: true + }; function authenticateUser(obj, username) { var userObject = { @@ -56,11 +56,11 @@ function sendDataToClient() { if (userObject.handle === username) { userObject.authenticated = true; - return userObject + return userObject; } else { - return userObject + return userObject; } } - authenticateUser(userObject, 'neo') - return userObject + authenticateUser(userObject, 'neo'); + return userObject; } \ No newline at end of file