Java Script Interview Question and Answer

89. How are object properties assigned?
Assigning properties to objects is done in the same way as a value is assigned to a variable. For example, a form object’s action value is assigned as ‘submit’ in the following manner – Document.form.action=”submit”

90. What is Number object in JavaScript?
he Number object represents numerical date, either integers or floating-point numbers. In general, you do not need to worry about Number objects because the browser automatically converts number literals to instances of the number class.

91. Which built-in method returns the string representation of the number’s value?
toString() method returns the string representation of the number’s value.

92. Which built-in method returns the length of the string?
length() method returns the length of the string.

93. Which built-in method returns the calling string value converted to upper case?
toUpperCase() method returns the calling string value converted to upper case.

94. Which built-in method removes the last element from an array and returns that element?
pop() method removes the last element from an array and returns that element.

95. Can you access Cookie using javascript?
JavaScript can also manipulate cookies using the cookie property of the Document object. JavaScript can read, create, modify, and delete the cookie or cookies that apply to the current web page.

96. What is the way to get the status of a CheckBox?
The status can be acquired as follows –
alert(document.getElementById(‘checkbox1’).checked);
If the CheckBox will be checked, this alert will return TRUE.

test1

test1

Comments are closed here.