If your object is like

const obj = { name: "John", age: 30, city: "New York" };

Use the JavaScript function JSON.stringify() to convert it into a string. Like this JSON.stringify(obj). then you will get this string:

"{"name":"John","age":30,"city":"New York"}"

Answer from Hasibul- on Stack Overflow
🌐
Favtutor
favtutor.com › articles › convert-string-to-object-javascript
Convert String to Object in JavaScript (with JSON.Parse)
December 11, 2023 - In this blog, we discussed the JSON.parse() method that helps in converting JSON string to object. We also dealt with problems that relate to Date and Functions. If you still have any doubts, you might take our premium JavaScript homework help ...
Discussions

Understanding strings as objects
I’m trying to better understand the internal structure of a string. In the following code, I initialize a string. To see what’s inside, I use Object.getOwnPropertyNames() and Object.values(). var str = 'hi'; console.log(Object.getOwnPropertyNames(str)); console.log(Object.values(str)); ... More on forum.freecodecamp.org
🌐 forum.freecodecamp.org
0
September 5, 2018
In JavaScript, object keys/properties are strings?
JavaScript object keys are strings, but for convenience, when the key is a valid identifier (i.e. does not start with a digit, does not have spaces or dashes in it, etc.), the quotes can be omitted. More on reddit.com
🌐 r/typescript
24
4
January 27, 2024
Convert object to string using reduce
What did you try so far? Code example? Edit: Without a code example, I’m almost certain you are reducing your array and inside the reduce returning your accumulator plus your current value. This would result in an object. You’re going to want to get the values of your current value object and turn that into a string before appending to the accumulator. I have a code example that does what I’m explaining but I want to see what you’ve tried so far. Edit 2: Code example here: https://gist.github.com/viemmsakh/47e7e318c32981c57aa0aad3b7435f83 Note both functions provided do not handle nested arrays/objects. Since this is for a class assignment, I am assuming that you are not going to be doing something that advanced. But the "advancedConvertArrayToString" function assumes we don't know what the structure of the object looks like (more or less key/value pairs) and dynamically builds the output string. Comments in code to explain what I was doing each step of the way. Please let me know if you have any questions. More on reddit.com
🌐 r/learnjavascript
10
4
March 28, 2025
javascript - Converting an object to a string - Stack Overflow
Instead of console.log you can use console.dir(o) to print the javascript object instead to printig it as a string. In the developer tools this enables to open the object and check all properties, even arrays. More on stackoverflow.com
🌐 stackoverflow.com
🌐
W3Schools
w3schools.com › js › js_json_parse.asp
W3Schools.com
A common use of JSON is to exchange data to/from a web server. When receiving data from a web server, the data is always a string. Parse the data with JSON.parse(), and the data becomes a JavaScript object.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Object › toString
Object.prototype.toString() - JavaScript | MDN
... class Dog { constructor(name, ... code in place, any time an instance of Dog is used in a string context, JavaScript automatically calls the toString() method....
🌐
freeCodeCamp
forum.freecodecamp.org › javascript
Understanding strings as objects - JavaScript - The freeCodeCamp Forum
September 5, 2018 - I’m trying to better understand the internal structure of a string. In the following code, I initialize a string. To see what’s inside, I use Object.getOwnPropertyNames() and Object.values(). var str = 'hi'; console.log(Object.getOwnPropertyNames(str)); console.log(Object.values(str)); ...
🌐
HTML Goodies
htmlgoodies.com › home › javascript
Converting a JavaScript Object to a String | HTML Goodies
August 14, 2022 - This is the only native JavaScript function that turns any object to a string; all you need to do is call JSON.stringify(OBJECT) and it will turn an object or array into a JSON (JavaScript Object Notation) encoded string.
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-convert-an-object-to-string-using-javascript
How to convert an object to string using JavaScript ? - GeeksforGeeks
July 11, 2025 - Let's first create a JavaScript object. ... String() constructor converts the value of an object to a string.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-convert-string-to-array-of-objects-javascript
How to Convert String to Array of Objects JavaScript ? - GeeksforGeeks
August 5, 2025 - If the string is not in JSON format, you can manually split the string and construct objects to create the array, split() method splits the string into an array of individual records based on the semicolon delimiter. The map() is used to iterates over each record and splits it into name and age using the comma delimiter.
🌐
W3Schools
w3schools.com › jsref › jsref_object_tostring.asp
JavaScript Object toString() Method
The toString() method returns "[object Object]" if it cannot return a string. Object.toString() always returns the object constructor. The toString() method does not change the original object. Every JavaScript object has a toString() method.
🌐
Vultr Docs
docs.vultr.com › javascript › standard-library › Object › toString
JavaScript Object toString() - Convert to String | Vultr Docs
November 11, 2024 - function Employee(name, age, jobTitle) ... properties with custom ones, resulting in a comprehensive string output. The toString() method in JavaScript offers extensive flexibility by allowing the conversion of objects to string ...
🌐
Reddit
reddit.com › r/learnjavascript › convert object to string using reduce
r/learnjavascript on Reddit: Convert object to string using reduce
March 28, 2025 -

Hello! I'm learning JS and I've understood some concepts, but my teacher sent me a project which requires "converting an array of objects using reduce()" and I can't use JSON.stringify. I tried something, but I always get [object Object] as the result...

Edit:

A code example:

Const elQuijote={ Title:"el quijote", Author: "Garcia", Category: fantasy", ISBN: 182831 }

let books = []

books.push(elQuijote);

//This function is just an example function toString(list){ return list.reduce().join('-') }

🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › String
String - JavaScript | MDN
String primitives and String objects also give different results when using eval(). Primitives passed to eval are treated as source code; String objects are treated as all other objects are, by returning the object.
🌐
W3Schools
w3schools.com › js › js_json_stringify.asp
JSON.stringify()
JS Examples JS HTML DOM JS HTML Input JS HTML Objects JS HTML Events JS Browser JS Editor JS Exercises JS Quiz JS Website JS Syllabus JS Study Plan JS Interview Prep JS Bootcamp JS Certificate JS Reference ... A common use of JSON is to exchange data to/from a web server. When sending data to a web server, the data has to be a string. You can convert any JavaScript datatype into a string with JSON.stringify().
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › JSON › stringify
JSON.stringify() - JavaScript | MDN
If space is anything other than ... representing the given value, or undefined. ... A BigInt value is encountered. JSON.stringify() converts a value to the JSON notation that the value represents....
🌐
W3Schools
w3schools.com › jsref › jsref_obj_string.asp
JavaScript String Reference
HTML wrapper methods return a string wrapped inside an HTML tag. These are not standard methods, and may not work as expected. The HTML wrapper methods are deprecated in JavaScript. They are only standardized for compatibility purposes and are not recommended for new development. Modern web development practices advocate for using CSS for styling and DOM manipulation to create and modify HTML elements, providing greater control and flexibility.
🌐
Medium
medium.com › dailyjs › 5-ways-to-convert-a-value-to-string-in-javascript-6b334b2fc778
5 Ways to Convert a Value to String in JavaScript | by Samantha Ming | DailyJS | Medium
May 27, 2019 - Here are the variables we’re going to test these against: const string = "hello"; const number = 123; const boolean = true; const array = [1, "2", 3]; const object = {one: 1 }; const symbolValue = Symbol('123'); const undefinedValue = undefined; const nullValue = null; string + ''; // 'hello' number + ''; // '123' boolean + ''; // 'true' array + ''; //… · 110K followers · ·Last published Jul 12, 2022 · JavaScript news and opinion.
🌐
Vocal Media
vocal.media › 01 › a-comprehensive-guide-to-object-to-string-conversion-in-java-script
A Comprehensive Guide to Object to String Conversion in JavaScript | 01
The most commonly used method for converting objects to strings in JavaScript is the JSON.stringify() method. This method converts a JavaScript object into a JSON (JavaScript Object Notation) string.