- Selenium
- JMeter
- DevOps
- VERSION CTRL
- ONLINE QUIZ
- Number System MCQ - 1
- Number System MCQ - 2
- Number System MCQ - 3
- Simplification MCQ - 1
- Average MCQ - 1
- Simple Interest MCQ - 1
- Compound Interest - MCQ
- Percentage - MCQ
- Ratio and Proportion - MCQ
- Profit and Loss - MCQ
- Time, Speed, and Distance - MCQ
- Time, and Work - MCQ
- Boats and Streams - MCQ
- General Knowledge Quiz - Indian Polity
- General Knowledge Quiz - History
- General Knowledge Quiz - Geography
- GK Quiz - Indian Polity - 2
- GK Quiz - Banking and Finance
- GK Quiz - Economics
- GK Quiz- Merger and Acquisition
- GK Quiz- International Bodies
- English Grammar quiz-1
- English Grammar quiz-2
- S/W PROJECT MANAGEMENT
- PROTRACTOR
- Java -Tutorials
- MORE
Javascript quiz on variables
Check these javascript variables MCQs (multiple choice questions) and quiz for free and evaluate your expertise on JS variables.
This MCQ test covers topics like declaration and initialization of JS variables - var, let, and const.
Instructions
Topic- JS variables
The test consists of 14 questions.
No negative marking for this test.
No Time limit
The pass percentage is 70%
The correct answer with a description will be displayed after the answer has been marked.
Submit the test to calculate your score once you are done with all the questions.
Complexity Level- Moderate
Q1: Variables defined with let cannot be redeclared.
Select True or False.
Select True or False.
Q2: Select whether the below JS code is valid or not:
let x = "Hello Peter Doe";
let x = 0;
let x = "Hello Peter Doe";
let x = 0;
Q3: Select whether the below JS code is valid or not:
var x = "John Doe";
var x = 0;
var x = "John Doe";
var x = 0;
Q4: Variables defined with const cannot be Reassigned.
Select True or False:
Select True or False:
Q5: Variables defined with const can be Redeclared.
Select True or False:
Select True or False:
Q6: Select whether the below JS code is valid or not:
const PI = 3.141592653589793;
PI = 3.14;
const PI = 3.141592653589793;
PI = 3.14;
Q7: Select whether the below JS code is valid or not:
const PI = 3.141592653589793;
PI = PI + 10;
const PI = 3.141592653589793;
PI = PI + 10;
Q8: A value must be assigned to a const variable when it is declared
Select True or False:
Select True or False:
Q9: Select whether the below JS code is valid or not:
const PI;
PI = 3.14159265359;
const PI;
PI = 3.14159265359;
Q10: Select whether the below JS code is valid or not:
const cars = ["Ford", "Honda", "BMW"];
cars[0] = "Nissan";
const cars = ["Ford", "Honda", "BMW"];
cars[0] = "Nissan";
Q11: Select whether the below JS code is valid or not:
const cars = ["Ford", "Honda", "BMW"];
cars = ["Toyota", "Skoda", "Audi"];
const cars = ["Ford", "Honda", "BMW"];
cars = ["Toyota", "Skoda", "Audi"];
Q12: Select whether the below JS code is valid or not:
var x = 2;
var x = 3;
var x = 2;
var x = 3;
Q13: Select whether the below JS code is valid or not:
const x = 2;
{
const x = 3;
}
{
const x = 4;
}
const x = 2;
{
const x = 3;
}
{
const x = 4;
}
Q14: What will be the console output of the below javascript code?
const a=34;
let b=56;
console.log(a=b);
const a=34;
let b=56;
console.log(a=b);