How to print the content of JavaScript object?
krishnavignesh07:
give me brainliest plzzzzzz
Answers
Answered by
0
Clone the object before printing
function log_them() {
var p = {
'fname' : 'Foo',
'lname' : 'Bar'
};
console. log("Before Change", JSON. parse(JSON. stringify(p)));
p["email"] = '[email protected]';
console. log("Acter Change", JSON. parse(JSON. stringify(p)));
hope give me brainliest
Similar questions
Math,
7 months ago
English,
7 months ago
English,
7 months ago
Computer Science,
1 year ago
Math,
1 year ago
Psychology,
1 year ago