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
Discussions

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
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
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
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
🌐
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....
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › String
String - JavaScript | MDN
See "String primitives and String objects" below. String literals can be specified using single or double quotes, which are treated identically, or using the backtick character `. This last form specifies a template literal: with this form you can interpolate expressions. For more information on the syntax of string literals, see lexical grammar. There are two ways to access an individual character in a string.
Find elsewhere
🌐
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().
🌐
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 - Similarly, it converts a number to a string. Finally, it logs the types before and after conversion for each case. JSON.stringify() converts the JavaScript object to a string which is needed to send data over the web server.
🌐
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.
🌐
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('-') }

🌐
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 - JavaScript news and opinion. ... It’s also the one I use because it’s the most explicit — making it easy for other people to follow the intention of your code 🤓 · Remember the best code is not necessarily the most clever way, it’s the one that best communicates the understanding of your code to others 💯 · const value = 12345;// Concat Empty String value + '';// Template Strings `${value}`;// JSON.stringify JSON.stringify(value);// toString() value.toString();// String() String(value);// RESULT // '12345'
🌐
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 ...
🌐
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)); ...
🌐
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.
🌐
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 › js › js_json_parse.asp
W3Schools.com
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 receiving data from a web server, the data is always a string. Parse the data with JSON.parse(), and the data becomes a JavaScript ...
🌐
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 ...
🌐
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.