This section covers the questions for Variables and Data Types to clear all your concepts.
Question 1
JavaScript is a:
Compiled language
Interpreted Language
Both compiled and interpreted language
None of the Above
Question 2
Which keyword is used to declare a variable that cannot be reassigned?
var
let
const
static
Question 3
Which of the following variable names are correct according to JavaScript? (Multiple Choices may be correct)
let 1name;
let #name;
let _name;
let $_name;
Question 4
What happens when we console.log() a variable?
It debugs the entire code
The log will go inside the variable, extract their information and show it on the console.
It creates a memory block in system
It is used to delete the variable's block of memory
Question 5
What is the difference between var, let, and const?
var is block-scoped, let and const are function-scoped.
var is function-scoped, let and const are block-scoped.
var and let are block-scoped, const is function-scoped.
All are block-scoped.
Question 6
Which of the following is a primitive data type in JavaScript?
Array
Object
Symbol
Function
Question 7
What is the output of the following code?
let x;
console.log(typeof x);
null
undefined
object
string
Question 8
Which of the following is a valid way to interpolate a variable into a string?
"My age is " + age;
My age is ${age};
"My age is ${age}";
Both a and b
Question 9
How do you check the type of a variable in JavaScript?
Using typeof
Using instanceof
Using Object.prototype.toString.call()
All of the above
Question 10
What is the output of the following code?
console.log(5 + 5 + "5");
"105"
15
NaN
"55"
There are 10 questions to complete.