InterviewSolution
Saved Bookmarks
| 1. |
What are the parameters of the method JSON.parse()?(a) text(b) reviver(c) both text and reviver(d) objectI have been asked this question in semester exam.Enquiry is from Parsing Values using JavaScript topic in section Parsing, Benchmarking and Logging of JavaScript |
|
Answer» RIGHT answer is (c) both text and reviver To EXPLAIN: The JSON.parse() method can optionally transform the result with a function. The parameters of the method JSON.parse() are : text : The string to parse as JSON. reviver : If a function, prescribes how the VALUE originally PRODUCED by parsing is transformed, before being returned. |
|