What will be the output of the following JavaScript code? var arr=[1,2,3]; var rev=arr.reverse();
View Question
What will be the output of the following JavaScript code?
var values=[“one”,”two”,”Three”];
var ans=values.shift();
document.writeln(ans);
What will be the output of the following JavaScript code? var values=["one","two","Three"]; var ans=values.shift();
View Question
What will be the output of the following JavaScript code?
int sum=0;
var arr = [10,15,20,30];
arr.forEach(function myFunction(element)
{
sum= sum+element;
});
document.writeln(sum);
What will be the output of the following JavaScript code? int sum=0; var arr = [10,15,20,30]; ...
View Question
What will be the output of the following JavaScript code?
var values=[1,2,3,4]
var ans=values.slice(1);
document.writeln(ans);
What will be the output of the following JavaScript code? var values=[1,2,3,4] var ans=values.slice(1);
View Question
What will be the output of the following JavaScript code?
var val1=[1,2,3];
var val2=[6,7,8];
var result=val1.concat(val2);
document.writeln(result);
What will be the output of the following JavaScript code? var val1=[1,2,3]; var val2=[6,7,8];
View QuestionThe method or operator used to identify the array is __________
a) isarrayType() b) == c) === d) typeof Answer: d Explanation: The typeof operator is used to ...
View QuestionThe reduce and reduceRight methods follow a common operation called __________
a) filter and fold b) inject and fold c) finger and fold d) fold Answer: b Explanation: The reduceRight() ...
View QuestionThe 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 ...
View Question
What will be the shift() output of the following JavaScript code?
var a = [];
a.unshift(1);
a.unshift(22);
a.shift();
a.unshift(3,[4,5]);
a.shift();
a.shift();
var output = a.shift();
document.writeln(output);
What will be the shift() output of the following JavaScript code? var a = []; a.unshift(1);
View Question
What will be the possible output of the following JavaScript code?
var a = [1,2,3,4,5];
a.slice(0,3);
What will be the possible output of the following JavaScript code? var a = [1,2,3,4,5]; a.slice(0,3); a) ...
View Question