function output(option)
{
return (option ? yes : no);
}
bool ans=true;
console.log(output(ans));
Yes
No
Runtime error
Compilation error
A. Yes
var arr=[1,2,3];
var rev=arr.reverse();
document.writeln(rev);
1, 2, 3
3, 2, 1
3
1
var o = new Object();
var o = Object();
var o;
var o= new Object;
Object o=new Object();
Floating numbers
Representation of functions that returns a value
is not present in JavaScript
Form feed
Keywords
Declaration statements
Data types
Prototypes
Updation, Incrementation, Initialization
Initialization,Testing, Updation
Testing, Updation, Testing
Initialization,Testing, Incrementation
in
exist
within
exists
var add=new Function(num1,num2,return num1+num2);
document.writeln(add(2,5));
2
5
Error
7
if (!a[i]) continue;
Skips the defined elements
Skips the existent elements
Skips the null elements
Skips the defined & existent elements
var tensquared = (function(x) {return x*x;}(10));
Yes, perfectly
Error
Exception will be thrown
Memory leak
void
int
function
main
while (a != 0)
{
if (a == 1)
continue;
else
a++;
}
The continue keyword restarts the loop
The continue keyword skips the next iteration
The continue keyword skips the rest of the statements in that iteration
The continue keyword breaks out of the loop
Function prototype
Function literal
Function calling
Function declaration
function f() {};
Function f
A custom constructor
Prototype of a function
Not valid
Ignores the statement
Prompts to complete the statement
Throws an error
Shows a warning
var a = [1,2,3,4,5];
a.slice(0,3);
Returns [1,2,3]
Returns [4,5]
Returns [1,2,3,4]
Returns [1,2,3,4,5]
Before each iteration, the interpreter evaluates the variable expression and assigns the name of the property
The iterations can be infinite when an interpreter is used
The body of the loop is executed only once
the iteration is finite when an interpreter is used
isPrototypeOf() method
equals() method
=== operator
==opertor
It returns the value 0
It will throw an exception
It returns the undefined value
It will throw an error
RMI
Triggering Event
Preprocessor
Function/Method
var string2Num=parseInt(123xyz);
123
123xyz
Exception
NaN
isarrayType()
==
===
typeof
Ignores the statement
Prompts to complete the statement
Throws an error
Shows a warning
An integer
A String
An object
Floating point
var txt1 = good;
var txt2 = day;
document.getElementById(demo).innerHTML = txt1 + txt2;
good day
goodday
error
undefined
decrements the total length by 1
increments the total length by 1
prints the first element but no effect on the length
updates the element
make all of the own properties of that object non configurable
to configure and bring a writable property
lock down objects into a known state and prevent outside tampering
to include new properties into the object
const obj1 =
{
property1: 21
}
const descriptor1 = Object.getOwnPropertyDescriptor(obj1, 'property1');
console.log(descriptor1.configurable);
console.log(descriptor1.enumerable);
true 21
true false
true true
false false
Keywords
Declaration statements
Data types
Prototypes
var values=[one,two,Three];
var ans=values.shift();
document.writeln(ans);
one
two
three
error
00
0x
0X
Both 0x and 0X