diff --git a/scope.js b/scope.js index e0d709e..c052af8 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 j = 0; j < matrix[i].length; j++) { + result = result + matrix[i][j]; } } return result; @@ -54,13 +54,13 @@ function sendDataToClient() { authenticated: false }; - if (userObject.handle === username) { - userObject.authenticated = true; - return userObject + if (obj.handle === username) { + obj.authenticated = true; + return obj } else { - return userObject + return obj } } authenticateUser(userObject, 'neo') return userObject -} \ No newline at end of file +}