in
exist
within
exists
A. in
filter and fold
inject and fold
finger and fold
fold
var arr = [7, 5, 9, 1];
var value = Math.max.apply(null, arr);
document.writeln(value);
7
5
1
9
var val1=[1,2,3];
var val2=[6,7,8];
var result=val1.concat(val2);
document.writeln(result);
1, 2, 3
Error
1, 2, 3, 6, 7, 8
123
If the object inherits enumerable properties
The object does not have the properties present in the integer array indices
The delete keyword is never used
Object.defineProperty() is not used
Class, parameters, objects extensible flag
Prototype, class, objects parameters
Prototype, class, objects extensible flag
Native object, Classes and Interfaces and Objects extensible flag
debugger
with
if
use strict
function tail(o)
{
for (; o.next; o = o.next) ;
return o;
}
No, this will throw an exception as only numerics can be used in a for loop
No, this will not iterate
Yes, this will work
No, this will result in a runtime error with the message Cannot use Linked List
var a= 0;
var b = 0;
while (a < 3)
{
a++;
b += a;
console.log(b);
}
135
123
013
01
7.25
-7.25
7
-7
The property will be stored in a cache
The loop will not run
That property will not be enumerated
The property will be enumerated
Alternative to if-else
Immediate if
If-then-else statement
Switch statement
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
void
int
function
main
switch(expression)
{
statements
}
==
equals
equal
===
x = ~-y;
w = x = y = z;
q = a?b:c?d:e?f:g;
x = ~(-y); w = (x = (y = z));
q = a?b:(c?d:(e?f:g));
x = a?b:(c?d:(e?f:g));
q = ~(-y); w = (x = (y = z));
x = (x = (y = z));w = ~(-y);
q = a?b:(c?d:(e?f:g));
x = ~(-y); w = (x = (y = z));
q = (c?d:(e?f:g));
string a = hi;
string b =there;
alert(a+b);
hi
there
hithere
undefined
function output(option)
{
return (option ? yes : no);
}
bool ans=true;
console.log(output(ans));
Yes
No
Runtime error
Compilation error
switch(expression)
{
statements
}
==
equals
equal
===
Properties
Prototypes
Lvalue
Definition
in
exist
within
exists
const object1 = {};
a = Symbol('a');
b = Symbol.for('b');
object1[a] = 'harry';
object1[b] = 'derry';
const objectSymbols = Object.getOwnPropertySymbols(object1);
console.log(objectSymbols.length);
0
2
1
Error
Updation, Incrementation, Initialization
Initialization,Testing, Updation
Testing, Updation, Testing
Initialization,Testing, Incrementation
var count = [1,,3];
The omitted value takes undefined
This results in an error
This results in an exception
The omitted value takes an integer value
var text = testing: 1, 2, 3; // Sample text
var pattern = /d+/g // Matches all instances of one or more digits
text==pattern
text.equals(pattern)
text.test(pattern)
pattern.test(text)
var person =
{
name: Rahul,
getName: function()
{
nreturn this.name;
}
}
var unboundName = person.getName;
var boundName = unboundName.bind(person);
document.writeln(boundName());
runtime error;
compilation error
Rahul
undefined
int a=1;
if(a!=null)
return 1;
else
return 0;
1
0
runtime error
compiler error
var add=new Function(num1,num2,return num1+num2);
document.writeln(add(2,5));
2
5
Error
7
An integer
A String
An object
Floating point
o = {x:1, y:{z:[false,null,]}};
s = JSON.stringify(o);
p = JSON.parse(s);
Object Encapsulation
Object Serialization
Object Abstraction
Object Encoding
isarrayType()
==
===
typeof