JavaScript | JavaScript JSON | Question 4

Last Updated :
Discuss
Comments

What will the following code output?

JavaScript
const obj = { name: "Ajay", age: 25 };
console.log(JSON.stringify(obj));


undefined

{ name: "Ajay", age: 25 }

'{"name":"Ajay","age":25}'

Error

Share your thoughts in the comments