1 Crore+ students have signed up on EduRev. Have you? Download the App |
Which of the following is a valid JavaScript data type?
How do you output a message to the console in JavaScript?
What is the output of the following JavaScript code?
var x = 10;
var y = "5";
console.log(x + y);
What is the output of the following JavaScript code?
var x = 5;
console.log(x++);
What is the output of the following JavaScript code?
var x = 10;
var y = 5;
console.log(x += y);
What is the output of the following JavaScript code?
var x = "Hello";
console.log(x.length);
What is the output of the following JavaScript code?
var x = [1, 2, 3];
x.push(4);
console.log(x.length);
What is the output of the following JavaScript code?
var x = 10;
if (x === "10") {
console.log("Equal");
} else {
console.log("Not equal");
}
What is the output of the following JavaScript code?
function multiply(a, b) {
return a * b;
}
var result = multiply(2, 3);
console.log(result);
What is the output of the following JavaScript code?
var x = 5;
function increment() {
var x = 10;
x++;
}
increment();
console.log(x);
What is the output of the following JavaScript code?
var x = 5;
function update() {
x = 10;
}
update();
console.log(x);
What is the output of the following JavaScript code?
var x = 5;
function multiplyByTwo(x) {
return x * 2;
}
var result = multiplyByTwo(x);
console.log(result);
What is the output of the following JavaScript code?
function greet(name) {
console.log("Hello, " + name + "!");
}
greet("John", "Doe");