Javascript Interview Questions and Answers – Part5

41. What is break and continue statements?
Break statement exits from the current loop.
Continue statement continues with next statement of the loop.

42. What are the two basic groups of dataypes in JavaScript?
They are as –
• Primitive
• Reference types.
Primitive types are number and Boolean data types. Reference types are more complex types like strings and dates.

43. How generic objects can be created?
Generic objects can be created as

var I = new object();

44. What is the use of type of operator?
‘Typeof’ is an operator which is used to return a string description of the type of a variable.

45. Which keywords are used to handle exceptions?
Try… Catch—finally is used to handle exceptions in the JavaScript

Code to throw an exception 
Code runs either it finishes successfully or after catch 

46. Which keyword is used to print the text in the screen?
document.write(“Welcome”) is used to print the text – Welcome in the screen.

47. What is the use of blur function?
Blur function is used to remove the focus from the specified object.

48. What is variable typing?
Variable typing is used to assign a number to a variable and then assign string to the same variable. Example is as follows:

i= 8;

49. How to find operating system in the client machine using JavaScript?
The ‘Navigator.appversion’ is used to find the name of the operating system in the client machine.

50. What are the different types of errors in JavaScript?
There are three types of errors:
• Load time errors: Errors which come up when loading a web page like improper syntax errors are known as Load time errors and it generates the errors dynamically.
• Run time errors: Errors that come due to misuse of the command inside the HTML language.
• Logical Errors: These are the errors that occur due to the bad logic performed on a function which is having different operation.

Sign-up for our email newsletter and get free job alerts, current affairs and GK updates regularly.
Subscribe Here (or)

Leave a Reply

Your email address will not be published. Required fields are marked *

− nine = 0

Popup Dialog Box Powered By :
  • RSS
  • Facebook
  • Google+
  • Twitter