Daily JavaScript
15 subscribers
1 photo
1 link
Daily examples, coding challenges, and useful tips for developers.
Download Telegram
📌 Test 3:
for (var i = 0; i < 3; i++) {
setTimeout(() => console.log(i), 1000); } Ushbu kod konsolda nima chiqaradi?
Anonymous Quiz
67%
0, 1, 2
17%
3, 3, 3
0%
0, 0, 0
17%
Error (ReferenceError)
📌 Test 4:
const arr = [1, 2, 3, 4];
console.log(arr.map(x => x * 2)); console.log(arr.filter(x => x % 2 === 0)); console.log(arr.reduce((a, b) => a + b)); Ushbu kod konsolda nima chiqaradi?
Anonymous Quiz
100%
[2, 4, 6, 8], [2, 4], 10
0%
[1, 2, 3, 4], [1, 3], 24
0%
[2, 4, 6, 8], [1, 3], 24
0%
[1, 4, 9, 16], [2, 4], 10
📌 Test 5:
console.log(a);
var a = 5; console.log(b); let b = 10; Ushbu kodning natijasi qanday bo‘ladi?
Anonymous Quiz
0%
undefined 10
0%
5 10
100%
undefined ReferenceError
0%
ReferenceError ReferenceError
Vazifa:
unique_in_order nomli funksiya yozing. Bu funksiya argument sifatida berilgan ketma-ketlikni (string yoki arrayni) qabul qiladi va bir xil qiymat yonma-yon kelgan bo‘lsa, faqat bittasini qoldirib, asl tartibni saqlagan holda yangi ro‘yxat qaytaradi.

Masalan:

uniqueInOrder('AAAABBBCCDAABBB') == ['A', 'B', 'C', 'D', 'A', 'B']
uniqueInOrder('ABBCcAD') == ['A', 'B', 'C', 'c', 'A', 'D']
uniqueInOrder([1,2,2,3,3]) == [1, 2, 3]
```

yechimi commentga yozing!
💻 Our Software Project Journey

Our team started a new project two months ago.
The main goal was to build a simple application for managing online accounts.
First, we created a repository on GitHub and started writing code in JavaScript.
Our developer wrote the main function, while the designer worked on the interface.
After one week, we had our first commit and tested it in the environment.
Then, we started our first sprint with clear tasks from the project backlog.
Our deadline was tight, but the teamwork helped us stay organized.
Every week, we received feedback from stakeholders and made small updates.
During the review meeting, the project manager praised our progress.
Finally, we delivered all deliverables before the final deadline, and the application went live!
2. Where did the team create the repository?
Anonymous Quiz
0%
A) On Bitbucket
0%
B) On GitLab
100%
C) On GitHub
0%
D) On VS Code
4. What programming language did the team use?
Anonymous Quiz
0%
A) Python
0%
B) Java
100%
C) JavaScript
0%
D) C#
6. What helped the team stay organized during the sprint?
Anonymous Quiz
100%
A) Teamwork
0%
B) Feedback
0%
C) Coffee
0%
D) Stakeholders
🧠 Understanding JavaScript Execution and Data Types

When we write JavaScript code, every statement must follow the correct syntax. If the syntax is wrong, the compiler or the browser shows an error.
During execution, the JavaScript engine reads each expression and performs it step by step. This process happens in the runtime environment.

A variable can store any kind of value — a string, number, or boolean, and each of these is called a data type. When we create a variable using let or const, we perform an assignment. For example:

let age = 25;


Here, we assigned a number value to the variable age.

Some data in JavaScript are immutable, meaning they cannot be changed, like strings. Others are mutable, such as arrays and objects, which we can modify using methods like push() or pop().

When we work with data, we often need to filter, map, or loop through them using forEach. The map method creates a new array without changing the original one, while forEach usually causes a mutation, modifying existing data.

Understanding these concepts helps developers write clean, efficient, and bug-free code. Every function, loop, and variable plays an important role in the execution process of a program.
4. Which of the following is a data type?
Anonymous Quiz
0%
A) Loop
100%
B) Boolean
0%
C) Compiler