I believe json should be lowercase if not toUpperCase.
Also, you are hard coding the message. If this were a real world scenario, if you wanted to change the message you would have to change it on two lines which could lead to errors and more time spent maintaining the code.
If you make the message a variable, and then wanted to change the message you would only have to change it on one line.
For example in semi-pseudo code:
let message = “Hello json”
if (my message should be uppercase) message = message.toUpperCase()
res.json({“message”: message})
toUpperCase is a method (function). How do you call a functon?
The value for the message property should be the same that was used in the previous lesson, unless process.env.MESSAGE_STYLE is equal to “uppercase”. You are assigning the wrong value to lower here.
Similar to what I said in the previous post (see below).
You have a typo for the value of message when process.env.MESSAGE_STYLE is not equal to “uppercase”.
Just assign the correct default value to sentence and then use sentence as the message property’s value for the else instead of trying to hard-code it like you are doing now.
You didn’t catch on to what I was suggesting and made two variables rather than one and changed the lowercase string. Which means you still have the same problem I was alluding to. I think @RandellDawson provided more insight on the problem to help understand. If you still have more questions I would be happy to help.