Dear candidates you will find MCQ questions of JavaScript here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question
<script>
let x = "Hello, IncludeHelp!";
document.getElementById("test").innerHTML = x.slice(-13,-1);
</script>
<script>
const myArray = ['h', 'e', 'l', 'l', 'o'];
document.write(myArray[0]);
document.write(myArray[1]);
</script>
<script>
let cars = ['Honda', 'Hyundai'];
cars.push('Mahindra');
document.write(typeof cars + " " + cars);
</script>
<script>
let cars1 = ['Honda', 'Hyundai'];
let cars2 = cars1;
cars1.push('Mahinda');
document.write(cars1 + "---" + cars2);
</script>
<script>
var values = [10, 20, 30, 40];
var result = values.reduceRight(function(x,y){
return (x + y);
});
document.write("Result: " + result);
</script>
<script>
var cars = ["Honda","Hyundai","Mahindra"];
var result = cars.shift();
document.writeln("Result: ", cars);
</script>
<script>
var cars = ["Honda","Hyundai","Mahindra"];
var result = cars.unshift("Toyota", "Tata");
document.writeln("[", result, "] ", cars);
</script>