Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sunglasses-io Node Eval - WLA #151

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

Will9214
Copy link

No description provided.

let brands = [];
let products = [];
let users = [];
let accessTokens = [];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any variable that you don't reassign, should be a const

const currentAccessToken = accessTokens.find((accessToken=>accessToken.token == parsedUrl.query.accessToken));

if (currentAccessToken) {
return currentAccessToken;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could use a ternary here to make this easier to read

return null;
};
} else {
return null;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems repetitive


response.writeHead(200, { "Content-Type": "application/json" });
return response.end(JSON.stringify(userCart));
})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing semi-colon

};

// plus 1 quantity of desired product
foundProduct.quantity += 1;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also use ++

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants