Tag: javascript

Questions Related to javascript

  1. Not on windows platforms

  2. Yes

  3. No

  4. Not on Linux Platform


Correct Option: B
Explanation:

To solve this question, the user needs to have basic knowledge of JavaScript syntax and understand the difference between uppercase and lowercase letters.

The answer is:

A. Yes

In JavaScript, capital letters and lowercase letters are different from each other. This means that variables named "test" and "Test" are considered two separate variables. It is important to be consistent with capitalization when naming variables and calling functions in JavaScript.

  1. overMouse event

  2. onMouseOver event

  3. onRollOver event

  4. OnMouseOut event


Correct Option: B
  1. stringName.charAt(0);

  2. stringName.substring(1);

  3. stringName.charAt(1);

  4. stringName.charAt(2);


Correct Option: A

Which has no syntax error ?

  1. alert("hello "+3+" times);

  2. alert("hello "+3 times);

  3. alert("hello +3+ times");

  4. alert("hello "+3 +" times);


Correct Option: C

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) alert("hello "+3+" times); - This option is incorrect because it is missing a closing quotation mark after the word "times".

Option B) alert("hello "+3 times); - This option is incorrect because it is missing a closing quotation mark after the word "times" and it does not properly concatenate the string and the number.

Option C) alert("hello +3+ times"); - This option is correct because it includes the correct syntax for concatenating a string ("hello "), a number (3), and another string (" times").

Option D) alert("hello "+3 +" times); - This option is incorrect because it is missing a closing quotation mark after the word "times".

The correct answer is C. This option has no syntax errors because it correctly concatenates the string, number, and string using the + operator and includes the necessary quotation marks.

  1. popUp(PageURL,WindowName,settings);

  2. window.launch(PageURL,WindowName,settings);

  3. window.close(PageURL,WindowName,settings);

  4. window.open(PageURL,WindowName,settings);


Correct Option: D
  1. stringVariable.substring(subString)

  2. stringVariable.find(subString)

  3. stringVariable.indexOf(subString)

  4. stringVariable.indexOf(charAt(0))


Correct Option: C