export const addBrand = (state, refreshTable, closeModal) => {
const str = JSON.stringify(state);
console.log(str); // Console Log print.
alert(str);
};
<p id="demo"></p>
<script>
const person = {
name: "John",
age: 30,
city: "New York"
};
document.getElementById("demo").innerHTML = JSON.stringify(person);
</script>
result:
Display properties in JSON format:
{"name":"John","age":30,"city":"New York"}
// `depth` tells util.inspect() how many times to recurse while formatting the object, default is 2
console.dir(obj, {
depth: 10
})
// ...or pass `null` to recurse indefinitely
console.dir(obj, {
depth: null
})