1.

Which of the following reads the textual contents of a URL and returns as a string?(a) spawn(f);(b) load(filename,…);(c) readFile(file);(d) readUrl(url);This question was addressed to me at a job interview.Query is from Remote Logging topic in chapter Parsing, Benchmarking and Logging of JavaScript

Answer»

The correct choice is (d) readUrl(url);

The BEST explanation: readUrl() opens an INPUT CONNECTION to the given string url, read all its bytes and convert them to a string using the SPECIFIED character coding or default character coding if an explicit coding ARGUMENT is not given.



Discussion

No Comment Found

Related InterviewSolutions