skip to Main Content

How to print an JSON string in javascript?

When I try to print console.log(body.email), the console says its undefined, but when I call console.log(body) it returns me {"email":"[email protected]","password":"Password"} here is the code below: document.getElementById("SingupForm").addEventListener('submit', evt =>{ evt.preventDefault() const form = evt.target const body =JSON.stringify({ email: form.elements.email.value, password: form.elements.password.value,…

VIEW QUESTION

Unordered set in JSON?

In this article EB is saying that this '{"oranges": 2, "apples": 6, "pears": 5}' is an unordered set in JSON, while this s-expression '((ORANGES 2) (APPLES 6) (PEARS 5)) is a nested list, but apparently not an unordered set. He…

VIEW QUESTION

javascript: string to object and dot notation

In the application I am working on, I have some configuration stored in a memo field in object literals. { JWT : { endpoint :"https://somelink1", clientid :"consent-management", grantType :"client_credentials" }, CMP : {endpoint :"https://someotherlink2", contentType :"application/json"} } Using regex and…

VIEW QUESTION
Back To Top
Search