

- Main
- Catalog
- Computer science
- Advertising on the Telegram channel «Web Development - Javascript Courses»
Advertising on the Telegram channel «Web Development - Javascript Courses»
Get free resources to learn web development , html , CSS , JavaScript , reactjs , wordpress , Php , nodejs, etc.
Channel statistics
Full statisticschevron_right
let num = 10;
if (num % 2 === 0) {
console.log("Even");
} else {
console.log("Odd");
}{}
🔍 Q2. How do you reverse a string?
let text = "hello";
let reversedText = text.split("").reverse().join("");
console.log(reversedText); // Output: olleh{}
🔍 Q3. Write a function to find the factorial of a number.
function factorial(n) {
let result = 1;
for (let i = 1; i <= n; i++) {
result *= i;
}
return result;
}
console.log(factorial(5)); // Output: 120{}
🔍 Q4. How do you remove duplicates from an array?
let items = [1, 2, 2, 3, 4, 4];
let uniqueItems = [...new Set(items)];
console.log(uniqueItems);{}
🔍 Q5. Print numbers from 1 to 10 using a loop.
for (let i = 1; i <= 10; i++) {
console.log(i);
}{}
🔍 Q6. Check if a word is a palindrome.
let word = "madam";
let reversed = word.split("").reverse().join("");
if (word === reversed) {
console.log("Palindrome");
} else {
console.log("Not a palindrome");
}{}
💬 Tap ❤️ for more!
function outer() {
let count = 0;
return function inner() {
count++;
console.log(count);
}
}
const counter = outer();
counter(); // 1
counter(); // 2
{}
This is useful for data privacy but watch for memory leaks with large closures.
2. Explain event delegation.
Event delegation attaches one listener to a parent element to handle events from child elements via event.target, improving performance by avoiding multiple listeners.
Example:
document.querySelector('ul').addEventListener('click', (e) => {
if (e.target.tagName === 'LI') {
console.log('List item clicked:', e.target.textContent);
}
});
{}
3. What is the difference between == and ===?
⦁ == checks value equality with type coercion (e.g., '5' == 5 is true).
⦁ === checks value and type strictly (e.g., '5' === 5 is false).
Always prefer === to avoid unexpected coercion bugs.
4. What is the "this" keyword?
this refers to the object executing the current function. In arrow functions, it's lexically bound to the enclosing scope, not dynamic like regular functions.
Example: Regular: this changes with call context; Arrow: this inherits from parent.
5. What are Promises?
Promises handle async operations with states: pending, fulfilled (resolved), or rejected. They chain with .then() and .catch().
const p = new Promise((resolve, reject) => {
resolve("Success");
});
p.then(console.log); // "Success"
{}
In 2025, they're foundational for async code but often paired with async/await.
6. Explain async/await.
Async/await simplifies Promise-based async code, making it read like synchronous code with try/catch for errors.
async function fetchData() {
try {
const res = await fetch('url');
const data = await res.json();
return data;
} catch (error) {
console.error(error);
}
}
{}
It's cleaner for complex flows but requires error handling.
7. What is hoisting?
Hoisting moves variable and function declarations to the top of their scope before execution, but only declarations (not initializations).
console.log(a); // undefined (not ReferenceError)
var a = 5;
{}
let and const are hoisted but in a "temporal dead zone," causing errors if accessed early.
8. What are arrow functions and how do they differ?
Arrow functions (=>) provide concise syntax and don't bind their own this, arguments, or super—they inherit from the enclosing scope.
const add = (a, b) => a + b; // No {} needed for single expression
{}
Great for callbacks, but avoid in object methods where this matters.
9. What is the event loop?
The event loop manages JS's single-threaded async nature by processing the call stack, then microtasks (Promises), then macrotasks (setTimeout) from queues. It enables non-blocking I/O.
Key: Call stack → Microtask queue → Task queue. This keeps UI responsive in 2025's complex web apps.
10. What are IIFEs (Immediately Invoked Function Expressions)?
IIFEs run immediately upon definition, creating a private scope to avoid globals.
(function() {
console.log("Runs immediately");
var privateVar = 'hidden';
})();
{}
Less common now with modules, but useful for one-off initialization.
💬 Double Tap ❤️ For MoregetElementById, querySelector, innerHTML, textContent, style
• Events: Event Listeners (click, submit, keydown), Event Object
• Asynchronous JavaScript: Callbacks, Promises, async/await, Fetch API
• ES6+ Features: Template Literals, Destructuring, Spread/Rest Operators, Classes
• Error Handling: try...catch
• Modules: import/export
💡 Build interactive web projects consistently. Practice problem-solving.
💬 Tap ❤️ for more!Reviews channel
4 total reviews
- Added: Newest first
- Added: Oldest first
- Rating: High to low
- Rating: Low to high
Catalog of Telegram Channels for Native Placements
Advertising on the Telegram channel «Web Development - Javascript Courses» is a Telegram channel in the category «Интернет технологии», offering effective formats for placing advertising posts on TG. The channel has 52.8K subscribers and provides quality content. The advertising posts on the channel help brands attract audience attention and increase reach. The channel's rating is 17.8, with 4 reviews and an average score of 5.0.
You can launch an advertising campaign through the Telega.in service, choosing a convenient format for placement. The Platform provides transparent cooperation conditions and offers detailed analytics. The placement cost is 25.2 ₽, and with 13 completed requests, the channel has established itself as a reliable partner for advertising on Telegram. Place integrations today and attract new clients!
You will be able to add channels from the catalog to the cart again.
Комментарий