Home
Current Affairs January 2024

What is the correct answer?

4

An expression that can legally appear on the left side of an assignment expression. is a well known explanation for variables, properties of objects, and elements of arrays. They are called ___________

A. Properties

B. Prototypes

C. Lvalue

D. Definition

Correct Answer :

C. Lvalue


Explanation: lvalue is a historical term that means an expression that can legally appear on the left side of an assignment expression. In JavaScript, variables, properties of objects, and elements of arrays are lvalues.

Related Questions

What is the correct answer?

4

Do functions in JavaScript necessarily return a value?

A. It is mandatory

B. Not necessary

C. Few functions return values by default

D. some functions do not return any value

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

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 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

JavaScript Code can be called by using ____________

A. RMI

B. Triggering Event

C. Preprocessor

D. Function/Method

What is the correct answer?

4

JavaScript _________ when there is an indefinite or an infinite value during an arithmetic computation.

A. Prints an exception error

B. Prints an overflow error

C. Displays Infinity

D. Prints the value as such

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

If you have a function f and an object o, you can define a method named m of o with

A. o.m=m.f;

B. o.m=f;

C. o=f.m;

D. o=f;

What is the correct answer?

4

What kind of expression is new Point(2,3)?

A. Primary Expression

B. Object Creation Expression

C. Invocation Expression

D. Constructor Calling Expression

What is the correct answer?

4

Among the following, which one is a ternary operator?

A. +

B. :

C. ^

D. ?:

What is the correct answer?

4

The reduce and reduceRight methods follow a common operation called __________

A. filter and fold

B. inject and fold

C. finger and fold

D. fold

What is the correct answer?

4

What are the three important manipulations done in a for loop on a loop variable?

A. Updation, Incrementation, Initialization

B. Initialization,Testing, Updation

C. Testing, Updation, Testing

D. Initialization,Testing, Incrementation

What is the correct answer?

4

What will be the output of the following JavaScript code?

A. 125

B. 25

C. 5

D. Error

What is the correct answer?

4

What will be the output of the following JavaScript code?
Int a=1;
if(a>10)
{
document.write(10);
}
else
{
document.write(a);
}

A. 10

B. 0

C. 1

D. Undefined

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

Assume that we have to convert false that is a non-string to string. The command that we use is (without invoking the new operator).

A. false.toString()

B. String(false)

C. String newvariable=false

D. Both false.toString() and String(false)

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 output of the following Javascript code?
<script>
txt1 = “ one”;
txt1 += “two”;
document.getElementById("demo").innerHTML = txt1;
</script>


A. onetwo

B. one two

C. error

D. undefined

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 will be the output of the following Javascript code?
function range(int length)
{
int a=5;
for(int i=0;i<length;i++)
{
console.log(a);
}
}
range(3);

A. 5

B. 555

C. 3

D. error

What is the correct answer?

4

What will happen if a return statement does not have an associated expression?

A. It returns the value 0

B. It will throw an exception

C. It returns the undefined value

D. It will throw an error

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

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?
const obj1 =
{
property1: 21
}
const descriptor1 = Object.getOwnPropertyDescriptor(obj1, 'property1');
console.log(descriptor1.configurable);
console.log(descriptor1.enumerable);

A. true 21

B. true false

C. true true

D. false false

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

To determine whether one object is the prototype of (or is part of the prototype chain of) another object, one should use the ____________

A. isPrototypeOf() method

B. equals() method

C. === operator

D. ==opertor

What is the correct answer?

4

The object has three object attributes namely ________

A. Class, parameters, objects extensible flag

B. Prototype, class, objects parameters

C. Prototype, class, objects extensible flag

D. Native object, Classes and Interfaces and Objects extensible flag

What is the correct answer?

4

JavaScript can be written __________

A. directly into JS file and included into HTML

B. directly on the server page

C. directly into HTML pages

D. directly into the css file

What is the correct answer?

4

What will be the output of the following JavaScript code?
int a=1;
if(a!=null)
return 1;
else
return 0;

A. 1

B. 0

C. runtime error

D. compiler error

What is the correct answer?

4

What will be the output of the following JavaScript code?
function info()
{
int a=1;
int b=2;
return a*b;
}
document.write(info());

A. 1

B. 2

C. 3

D. error