Home
Current Affairs January 2024

What is the correct answer?

4

The web development environment (JavaScript) offers which standard construct for data validation of the input entered by the user.

A. Controlled loop constructs

B. Case checking constructs

C. Validation constructs

D. All of the mentioned

Correct Answer :

D. All of the mentioned


Explanation: JavaScript provides with for, while loops and if, else, switch cases for checking the information entered by the user. Additionally, all development environments provide syntax to create and use memory variables, constants, and functions.

Related Questions

What is the correct answer?

4

The var and function are __________

A. Keywords

B. Declaration statements

C. Data types

D. Prototypes

What is the correct answer?

4

JavaScript Code can be called by using ___________

A. RMI

B. Triggering Event

C. Preprocessor

D. Function/Method

What is the correct answer?

4

What will be the output of the following JavaScript code?
var arr = [7, 5, 9, 1];
var value = Math.max.apply(null, arr);
document.writeln(value);

A. 7

B. 5

C. 1

D. 9

What is the correct answer?

4

What will be the step of the interpreter in a jump statement when an exception is thrown?

A. The interpreter stops its work

B. The interpreter throws another exception

C. The interpreter jumps to the nearest enclosing exception handler

D. The interpreter throws an error

What is the correct answer?

4

For the below mentioned code snippet:
var o = new Object();

The equivalent statement is:

A. var o = Object();

B. var o;

C. var o= new Object;

D. Object o=new Object();

What is the correct answer?

4

What will be the firstname and surname of the following JavaScript code?
var book = {
main title: JavaScript,
'sub-title': The Definitive Guide,
for: all audiences,
author: {
firstname: David,
surname: Flanagan
}
};

A. properties

B. property values

C. property names

D. objects

What is the correct answer?

4

What will be the output of the following JavaScript code?
var val1=[1,2,3];
var val2=[6,7,8];
var result=val1.concat(val2);
document.writeln(result);

A. 1, 2, 3

B. Error

C. 1, 2, 3, 6, 7, 8

D. 123

What is the correct answer?

4

JavaScript is ideal to ________

A. make computations in HTML simpler

B. minimize storage requirements on the web server

C. increase the download time for the client

D. increase the loading time of the website

What is the correct answer?

4

The property of a primary expression is ____________

A. stand-alone expressions

B. basic expressions containing all necessary functions

C. contains variable references alone

D. contains only keywords

What is the correct answer?

4

What will happen if the body of a for/in loop deletes a property that has not yet been enumerated?

A. The property will be stored in a cache

B. The loop will not run

C. That property will not be enumerated

D. The property will be enumerated

What is the correct answer?

4

In the following syntax, the data type within the square brackets must be ___________
book[datatype]=assignment_value;

A. An integer

B. A String

C. An object

D. Floating point

What is the correct answer?

4

The unordered collection of properties, each of which has a name and a value is called _________

A. String

B. Object

C. Serialized Object

D. Array

What is the correct answer?

4

The web development environment (JavaScript) offers which standard construct for data validation of the input entered by the user.

A. Controlled loop constructs

B. Case checking constructs

C. Validation constructs

D. All of the mentioned

What is the correct answer?

4

What will be the output of the following JavaScript code?
function height()
{
var height = 123.56;
var type = (height>=190) ? tall : short;
return type;
}

A. 123.56

B. 190

C. tall

D. short

What is the correct answer?

4

What is the observation made in the following JavaScript code?
var count = [1,,3];

A. The omitted value takes undefined

B. This results in an error

C. This results in an exception

D. The omitted value takes an integer value

What is the correct answer?

4

Consider the following code snippet.
for(var p in o)
console.log(o[p]);

The above code is equivalent to which code?

A.

for (var i = 0;i < a.length;i++)
console.log(a[i]);

B.

for (int i = 0;i < a.length;i++)
console.log(a[i]);

C.

for (var i = 0;i <= a.length;i++)
console.log(a[i]);

D.

for (var i = 1;i < a.length;i++)
console.log(a[i]);

What is the correct answer?

4

What will be the output of the following JavaScript code?
var arr=[1,2,3];
var rev=arr.reverse();
document.writeln(rev);

A. 1, 2, 3

B. 3, 2, 1

C. 3

D. 1

What is the correct answer?

4

The script tag must be placed in __________

A. the head tag

B. the head or body

C. the title or head

D. after the body tag

What is the correct answer?

4

What will be the output of the following JavaScript code?
var a=5 , b=1
var obj = { a : 10 }
with(obj)
{
alert(b)
}

A. 10

B. Error

C. 1

D. 5

What is the correct answer?

4

One of the special feature of an interpreter in reference with the for loop is that ___________

A. Before each iteration, the interpreter evaluates the variable expression and assigns the name of the property

B. The iterations can be infinite when an interpreter is used

C. The body of the loop is executed only once

D. the iteration is finite when an interpreter is used

What is the correct answer?

4

What will be the output of the following Javascript code?
var a = 10;
do {
a += 1;
console.log(a);
} while (a < 5);

A. 11121314

B. 1112

C. 12345

D. 11

What is the correct answer?

4

Which is a more efficient JavaScript code snippet?
Code 1 :
for(var num=10;num>=1;num--)
{
document.writeln(num);
}

Code 2 :
var num=10;
while(num>=1)
{
document.writeln(num);
num++;
}

A. Code 1

B. Code 2

C. Both Code 1 and Code 2

D. Cannot Compare

What is the correct answer?

4

What is the difference between the two lines given below ?
!!(obj1 && obj2);
(obj1 && obj2);

A. Both the lines result in a boolean value True

B. Both the lines result in a boolean value False

C. Both the lines checks just for the existence of the object alone

D. The first line results in a real boolean value whereas the second line merely checks for the existence of the objects

What is the correct answer?

4

What will be the output of the following JavaScript code?
var obj=
{
length:20,
height:35,
}
if (breadth' in obj === false)
{
obj.breadth = 12;
}
console.log(obj.breadth);

A. 20

B. 12

C. undefined

D. error

What is the correct answer?

4

Among the keywords below, which one is not a statement?

A. debugger

B. with

C. if

D. use strict

What is the correct answer?

4

What will be the output of the following JavaScript code?
const obj = {prop: 12};
Object.preventExtensions(obj);
console.log( Object.isExtensible(obj));

A. 12

B. false

C. true

D. error

What is the correct answer?

4

JavaScript is a _______________ language.

A. Object-Oriented

B. High-level

C. Assembly-language

D. Object-Based

What is the correct answer?

4

What will be the output of the following Javascript code?
<script>
var x = 5;
var y = 2;
var z = x % y;
document.getElementById("demo").innerHTML = z;
</script>


A. 0

B. 1

C. 2

D. 5

What is the correct answer?

4

What will be the output of the following JavaScript code?
int a=4;
int b=1;
int c=0;
If(a==b)
document.write(a);
else if(a==c)
document.write(a);
else
document.write(c);

A. 4

B. 1

C. Error

D. 0

What is the correct answer?

4

What will be the output of the following JavaScript code?
function output(option)
{
return (option ? yes : no);
}
bool ans=true;
console.log(output(ans));

A. Yes

B. No

C. Runtime error

D. Compilation error