π Welcome to Code.io! π
We're excited to have you here! π
This is your go-to space for everything coding-related. What to expect:
πΉ Daily Coding Challenges π§©
πΉ Programming Tips & Tutorials π
πΉ Tech News & Updates π
πΉ Community Support β Ask questions, share ideas, and collaborate! π Donβt forget to turn on notifications to stay updated on the latest content!
Letβs code, learn, and grow together! πͺ
β€1
1. What is the difference between var, let, and const in JavaScript?
Anonymous Quiz
8%
A)var is block-scoped, let is function-scoped, and const can be re-assigned.
83%
B)var is function-scoped, let is block-scoped, and const is constant and cannot be re-assigned.
0%
C)var and let are the same, but const is used only for objects.
8%
D)var, let, and const are all the same in terms of scope.
2. What will the following code log to the console?console.log(2 + '2');
Anonymous Quiz
69%
A) 22
15%
B) 4
8%
C) undefined
8%
D) Error
3. What does === do in JavaScript?
Anonymous Quiz
8%
A) Compares only values, ignoring the type.
67%
B) Compares both value and type
0%
C) Assigns values to variables.
25%
D) Returns a boolean indicating if two values are equal.
let a = 10;
function foo() {
a = 20; console.log(a); } foo(); console.log(a);
function foo() {
a = 20; console.log(a); } foo(); console.log(a);
Anonymous Quiz
22%
A) 10 and 10
56%
B) 20 and 10
22%
C) 20 and 20
0%
D) Error
5. What is a JavaScript closure?
Anonymous Quiz
0%
A) A function that defines a loop.
100%
B) A function that returns another function and retains access to the outer functionβs variables.
0%
C) A function that is used to close open tabs in a browser.
0%
D) A JavaScript method that allows for asynchronous operations.