Skip to content

Aliza lab - #8

Open
aliza89p wants to merge 9 commits into
sea-401d5-javascript:masterfrom
aliza89p:aliza-lab
Open

Aliza lab#8
aliza89p wants to merge 9 commits into
sea-401d5-javascript:masterfrom
aliza89p:aliza-lab

Conversation

@aliza89p

Copy link
Copy Markdown

Need to add more tests

Comment thread aliza/server.js
}

let user = req.url.substring(7);
if (req.url === '/greet/' + user && req.method === 'GET'){

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I finally understand why you needed to declare user outside of the if statement. However, since there might not always be a character at substring(7) like when the route is just '/greet', user will be undefined, but that's OK because it doesn't cause an error, it just silently returns "undefined".

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