1.

Which of the following does JSON.stringify not serialize?(a) Undefined values(b) Functions within an object(c) Both Undefined values and Functions within an object(d) Functions outside the objectThis question was addressed to me at a job interview.This interesting question is from Integrating the Performance Object with perfLogger in portion Invocation and Performance Navigation of JavaScript

Answer»

The CORRECT ANSWER is (c) Both Undefined values and Functions WITHIN an object

To elaborate: JSON.stringify does not serialize undefined values or functions within an object. JSON.stringify() converts a JavaScript object into a string.



Discussion

No Comment Found

Related InterviewSolutions