Create a Back-End App with Javascript

If you want to have the best chances of getting a useful answer quickly, make sure you follow our guidelines about how to ask a good question. That way you’ll be helping everyone – helping people to answer your question and helping others who are stuck to find the question and answer! :slight_smile:

Is it just me, or is the Create a Back-End App with JavaScript rather advanced? I’ve worked through a good portion of the course, but I keep on getting absolutely stumped by most of the cumulative projects, save the beginning ones. I’m just frustrated by the lack of instructions and teaching about the concepts that are featured in the projects, when they are so clearly the very difficult ones that need the most instruction…

I’m asking this question because no one else seems to have, and I’m wondering if I’m either missing something in the course or…? I feel like many beginner to beginner-intermediate (which is how I would describe myself) coders taking the course should be similarly stumped.

Just as an example, here is a snippet of some project instructions (“The Scoop”) –

*** POST**
** * Receives comment information from comment property of request body**
** * Creates new comment and adds it to database, returns a 201 response with comment on comment property of response body**
** * If body isn’t supplied, user with supplied username doesn’t exist, or article with supplied article ID doesn’t exist, returns a 400 response**

And here is the solution code for it. I swear we weren’t taught this, unless I’m missing something.

function createComment(url, request) { const requestComment = request.body && request.body.comment; const response = {}; if (requestComment && requestComment.body && requestComment.articleId && database.articles[requestComment.articleId] && requestComment.username && database.users[requestComment.username]) { const comment = { id: database.nextCommentId++, body: requestComment.body, username: requestComment.username, articleId: requestComment.articleId, upvotedBy: [], downvotedBy: [] }; database.comments[] = comment; database.users[comment.username].commentIds.unshift(; database.articles[comment.articleId].commentIds.unshift(; response.body = {comment: comment}; response.status = 201; } else { response.status = 400; } return response; }