in JavaScript by

What kind of work is being performed in the following given part of JavaScript's code?

 

<script>  

  

o = {x:1, y:{z:[false,null,""]}};   

s = JSON.stringify(o);   

p = JSON.parse(s);  

</script>  




a) Object Encapsulation

b) Object Encoding

c) Object Abstraction

d) Object Serialization

1 Answer

0 votes
by

Answer: D

Reason: In the above give piece of code, the task of Object Serialization is being performed. In this task, the object's state converted into a string, that also can be restored if needed. Another method used in the above-given code is "JSON.parse()", which parses a JSON string, object described by the string or constructing javascript value.

Related questions

0 votes
asked Mar 23, 2021 in JavaScript by sharadyadav1986
0 votes
asked Mar 24, 2021 in JavaScript by sharadyadav1986
0 votes
asked Mar 24, 2021 in JavaScript by sharadyadav1986
...