Contents

What is the method used to pause “data” events?
a) s.pause();                         
b) s.stop();
c) s.halt();                             
d) s.wait();

a

Explanation: Data events are the events which are performed by either the user or the browser. The above code snippet is used to pause data events, for throttling uploads.


When the “end” event fires on EOF when no more data will arrive, which function is called?
a) s.on(“data”,f);
b) s.on(“end”,f);
c) s.on(“error”,f);
d) s.on(“default”,f);

b

Explanation: ”EOF” stands for end of file.The above code snippet gets “end” event fired on EOF when no more data will arrive.


What will be the return value of the write() method when the Node cannot write the data immediately and has to buffer it internally?
a) 0                                                        
b) 1
c) True                                  
d) False

d

Rhino is originated by……….
a) Microsoft                         
b) Mozilla
c) Apple                                
d) Chrome

b

Explanation: Rhino is a JavaScript engine written fully in Java and managed by the Mozilla Foundation as open source software. Rhino is free software from Mozilla. You can download a copy from http://www.mozilla.org/rhino/.


Which of the following are global functions that are not part of core JavaScript?
a) spawn(f);                         
b) trim();
c) exult();                              
d) eval()

a

Explanation: The spawn(f) runs f() or loads and executes file f in a new thread.


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);

d

Explanation: Rhino defines a handful of important global functions that are not part of core JavaScript in which readUrl(url) reads the textual contents of a URL and return as a string.