Identify the process done in the following JavaScript code snippet?
o = {x:1, y:{z:[false,null,””]}};
s = JSON.stringify(o);
p = JSON.parse(s);
a) Object Encapsulation
b) Object Serialization
c) Object Abstraction
d) Object Encoding
Answer: b
Explanation: Object serialization is the process of converting an object’s state to a string from which it can later be restored. The JSON.parse() method parses a JSON string, constructing the JavaScript value or object described by the string.
Related Posts
The basic purpose of the toLocaleString() is to _________
The purpose of extensible attribute is to __________
What is the prototype represents in the following JavaScript code snippet?
function f() {};To determine whether one object is the prototype of (or is part of the prototype chain of) another object, one should use the ____________
In the following syntax, the data type within the square brackets must be ___________
book[datatype]=assignment_value;A linkage of series of prototype objects is called as ________
What will be the firstname and surname of the following JavaScript code?
var book = {
“main title”: “JavaScript”,
‘sub-title’: “The Definitive Guide”,
“for”: “all audiences”,
author: {
firstname: “David”,
surname: “Flanagan”
}
};
Join The Discussion