diff --git a/scope.js b/scope.js index e0d709e..f327422 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; } @@ -17,7 +17,7 @@ function outerFunction() { function innerFunction() { var world = 'World'; - return /* answer here */; + return hello + " " + world ; } return innerFunction(); } @@ -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; @@ -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