Javascript interview questions part 40

Javascript interview questions part 40

Take as many assements as you can to improve your validate your skill rating

Total Questions: 20

1. Rhino is originated by _______

Correct Answer is : Mozilla

2. Which of the following are global functions that are not part of core JavaScript?

Correct Answer is : spawn(f);

3. Which Rhino command quits Rhino environment?

Correct Answer is : quit()

4. Which is a useful way to try out small and simple Rhino programs and one-liners?

Correct Answer is : Starting an interactive shell

5. Which is a more formal way of importing packages and classes as JavaScript objects?

Correct Answer is : importClass(java.util.*);

6. Consider the following code snippet var f = new java.io.File("/tmp/test"); var out = new java.io.FileWriter(f); out instanceof java.io.Reader What will be the output for the above code snippet?

Correct Answer is : FALSE

7. What does Rhino do when the getter and setter methods exist?

Correct Answer is : It becomes JavaScript properties

8. The JavaScript classes can be instantiated using _____ operator.

Correct Answer is : new

9. The new Java arrays can be created into JavaScript programs using which of the following classes?

Correct Answer is : java.lang.reflect.Array

10. What are the events generated by the Node objects called?

Correct Answer is : emitters

11. What is the function used to deregister event handler ‘f’?

Correct Answer is : removeListener(name,f)

12. What is the function used to remove all handlers for name events?

Correct Answer is : removeAllListeners(name)

13. Which function is a synonym for on()?

Correct Answer is : addListener()

14. Which of the following is an event emitter?

Correct Answer is : process

15. When do uncaught exceptions generate events?

Correct Answer is : When handlers are registered

16. Which among the following POSIX signals generate events?

Correct Answer is : SIGINT

17. What is the method used to pause “data” events?

Correct Answer is : s.pause();

18. What will be the return value of the write() method when the Node cannot write the data immediately and has to buffer it internally?

Correct Answer is : FALSE

19. Consider the following code snippet let succ = function(x) x+1, yes = function() true, no = function() false; What convenience does the above code snippet provide?

Correct Answer is : Functional behaviour

20. Consider the following code snippet data.sort(function(a,b),b-a); What does the above code do?

Correct Answer is : Sort in reverse numerical order

Similar Interview Questions

    Search for latest jobs

    Icon
    Icon