Home
Current Affairs January 2024

What is the correct answer?

4

The type of a variable that is volatile is _______________

A. Volatile variable

B. Mutable variable

C. Immutable variable

D. Dynamic variable

Correct Answer :

B. Mutable variable


Explanation: The variables whose values can be changed are called mutable variable types. In JavaScript, only objects and arrays are mutable, not primitive values.

Related Questions

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?
function printprops(o)
{
for(var p in o)
console.log(p + : + o[p] +
);
}

A. Prints the contents of each property of o

B. Returns undefined

C. Prints only one property

D. Prints the address of elements

What is the correct answer?

4

What will be the output of the following Javascript code?
var a= 0;
var b = 0;
while (a < 3)
{
a++;
b += a;
console.log(b);
}

A. 135

B. 123

C. 013

D. 01

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 happens in the following javaScript code snippet?
var count = 0;
while (count < 10)
{
console.log(count);
count++;
}

A. The values of count are logged or stored in a particular location or storage

B. The value of count from 0 to 9 is displayed in the console

C. An error is displayed

D. An exception is thrown

What is the correct answer?

4

What is the observation made in the following JavaScript code?
if (!a[i]) continue;

A. Skips the defined elements

B. Skips the existent elements

C. Skips the null elements

D. Skips the defined & existent elements

What is the correct answer?

4

The function definitions in JavaScript begins with _____________

A. Identifier and Parentheses

B. Return type and Identifier

C. Return type, Function keyword, Identifier and Parentheses

D. Identifier and Return type

What is the correct answer?

4

The primary purpose of the array map() function is that it __________

A. maps the elements of another array into itself

B. passes each element of the array and returns the necessary mapped elements

C. passes each element of the array on which it is invoked to the function you specify, and returns an array containing the values returned by that function

D. pass the elements of the array into another 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

Which is an equivalent code to invoke a function m of class o that expects two arguments x and y?

A. o(x,y);

B. o.m(x) && o.m(y);

C. m(x,y);

D. o.m(x,y);

What is the correct answer?

4

A function with no return value is called ___________

A. Procedures

B. Method

C. Static function

D. Dynamic function

What is the correct answer?

4

What will be the output of the following JavaScript code?
function equalto()
{
int num=10;
if(num===10)
return true;
else
return false;
}

A. true

B. false

C. runtime error

D. compilation error

What is the correct answer?

4

What will be the output of the following JavaScript code?
var grade='A';
var result;
switch(grade)
{
case 'A':
result+=10;
case 'B':
result+= 9;
case 'C':
result+= 8;
default:
result+= 0;
}
document.write(result);

A. 10

B. 27

C. 8

D. 0

What is the correct answer?

4

Consider the following code snippet.
while (a != 0)
{
if (a == 1)
continue;
else
a++;
}

What will be the role of the continue keyword in the above code snippet?

A. The continue keyword restarts the loop

B. The continue keyword skips the next iteration

C. The continue keyword skips the rest of the statements in that iteration

D. The continue keyword breaks out of the loop

What is the correct answer?

4

A function definition expression can be called as __________

A. Function prototype

B. Function literal

C. Function calling

D. Function declaration

What is the correct answer?

4

In the following switch syntax, the expression is compared with the case labels using which of the following operator(s)?
switch(expression)
{
statements
}

A. ==

B. equals

C. equal

D. ===

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 will be the output of the following JavaScript code?
const object1 = {
property1: 20
};
console.log(Object.is(object1));

A. 20

B. true

C. false

D. error

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 be the output of the following Javascript code?
int size=5;
int a=5;
int size=4;
for(int j=size;j>=0;j--)
{
console.log(a);
a=a-2;
}

A. 5555

B. 5321

C. 531-1

D. 531

What is the correct answer?

4

What will be the output of the following JavaScript code?
int a==2;
int b=4;
int ans=a+b;
print(ans);

A. 2

B. 6

C. 0

D. error

What is the correct answer?

4

What is the prototype represents in the following JavaScript code snippet?
function f() {};

A. Function f

B. A custom constructor

C. Prototype of a function

D. Not valid

What is the correct answer?

4

What will be the output of the following JavaScript code?

A. 7.25

B. -7.25

C. 7

D. -7

What is the correct answer?

4

What will be the output of the following JavaScript code?
var string1 = 123;
var intvalue = 123;
alert( string1 + intvalue );

A. 123246

B. 246

C. 123123

D. Exception

What is the correct answer?

4

Consider the following code snippet :
var grand_Total=eval(10*10+5);

The output for the above statement would be :

A. 10*10+5

B. 105 as a string

C. 105 as an integer value

D. Exception is thrown

What is the correct answer?

4

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


A. 5

B. 10

C. 50

D. Error

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

Consider the following code snippet :
var string2Num=parseInt(123xyz);

The result for the above code snippet would be :

A. 123

B. 123xyz

C. Exception

D. NaN

What is the correct answer?

4

What will be the output of the following JavaScript code?
var a1 = [,,,];
var a2 = new Array(3);
0 in a1
0 in a2

A. true false

B. false true

C. true true

D. false true

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