string a = hi;
string b =there;
alert(a+b);
hi
there
hithere
undefined
C. hithere
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)
make computations in HTML simpler
minimize storage requirements on the web server
increase the download time for the client
increase the loading time of the website
isarrayType()
==
===
typeof
Class, parameters, objects extensible flag
Prototype, class, objects parameters
Prototype, class, objects extensible flag
Native object, Classes and Interfaces and Objects extensible flag
function info()
{
int a=1;
int b=2;
return a*b;
}
document.write(info());
1
2
3
error
var a=5 , b=1
var obj = { a : 10 }
with(obj)
{
alert(b)
}
10
Error
1
5
function printArray(a)
{
var len = a.length, i = 0;
if (len == 0)
console.log(Empty Array);
else
{
do
{
console.log(a[i]);
} while (++i < len);
}
}
Prints the numbers in the array in order
Prints the numbers in the array in the reverse order
Prints 0 to the length of the array
Prints Empty Array
debugger
with
if
use strict
var pow=new Function(num1,num2,return Math.pow(num1,num2));
document.writeln(pow(2,3));
2
3
8
error
var add=new Function(num1,num2,return num1+num2);
document.writeln(add(2,5));
2
5
Error
7
function output(object)
{
var place=object ? object.place : Italy;
return clean:+ place;
}
console.log(output({place:India}));
clean:India
clean:Italy
error
undefined
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
<script>
document.getElementById("demo").innerHTML = typeof "John"
</script>
integer
number
string
error
var arr = [7, 5, 9, 1];
var value = Math.max.apply(null, arr);
document.writeln(value);
7
5
1
9
RMI
Triggering Event
Preprocessor
Function/Method
var a=5 , b=1
var obj = { a : 10 }
with(obj)
{
alert(b)
}
10
Error
1
5
for(var num=10;num>=1;num--)
{
document.writeln(num);
}
var num=10;
while(num>=1)
{
document.writeln(num);
num++;
}
Code 1
Code 2
Both Code 1 and Code 2
Cannot Compare
Ignores the statement
Prompts to complete the statement
Throws an error
Shows a warning
var grand_Total=eval(10*10+5);
10*10+5
105 as a string
105 as an integer value
Exception is thrown
Object-Oriented
High-level
Assembly-language
Object-Based
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
if(a!=null)
if (!a)
if(a!null)
if(a!==null)
var values=[1,2,3,4]
var ans=values.slice(1);
document.writeln(ans);
1, 2, 3, 4
2, 3, 4
1, 3, 4
error
isPrototypeOf() method
equals() method
=== operator
==opertor
in
exist
within
exists
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
filter and fold
inject and fold
finger and fold
fold
var grade='E';
var result;
switch(grade)
{
case 'A':
result+=10;
case 'B':
result+= 9;
case 'C':
result+= 8;
default:
result+= 0;
}
document.write(result);
10
0
18
17
The interpreter stops its work
The interpreter throws another exception
The interpreter jumps to the nearest enclosing exception handler
The interpreter throws an error
Volatile variable
Mutable variable
Immutable variable
Dynamic variable