I am beginner trying to complete a simple JSON problem on SingPath which asks that I make a JSON Object with a property “message” and a value of “hello world”. I have tried the following code:
jsonStr = {“message”:”hello world”}
but I get a TypeError ==> TypeError: expected string or buffer
Could someone please help me get started? or figure out what I should correct?
the JSON questions in Singpath require you to submit your JSON object in the form of a string, which is the reason why you are having that error.
Try adding a single quote (‘) around your JSON object in your answer, and Singpath should accept your answer.
i.e.
Cheers,
Daniel