Telegram Web
Please open Telegram to view this post
VIEW IN TELEGRAM
#js
Topshiriq:
Massivdagi har bir elementni sonini aniqlash.

Yechim:
function countElements(arr) {
return arr.reduce((acc, element) => {
acc[element] = (acc[element] || 0) + 1;
return acc;
}, {});
}

// Misol uchun
const tags = ["#javascript", "#react", "#patterns", "#css", "#interview", "#javascript", "#css"]
console.log(countElements(tags));

Natija:
{
"#javascript": 2,
"#react": 1,
"#patterns": 1,
"#css": 2,
"#interview": 1
}


Bu JavaScript funktsiyasi berilgan massivdagi har bir elementni sanaydi va natijani obyekt (object) ko'rinishida qaytaradi. Funksiyada reduce metodidan foydalanilgan. reduce metodi massivdagi har bir elementni bitta qiymatga o'zlashtirish imkonini beradi.

Sizda qanday yechim bor, izohlarda yozib qoldiring 💬

Do'stlarga ulashing 🚀

Bizga qo'shiling 👉🏼 @Frontend 👈🏼
Please open Telegram to view this post
VIEW IN TELEGRAM
This media is not supported in your browser
VIEW IN TELEGRAM
Geolokatsiyani aniqlash va uni xaritada ko'rsatish 🗺

Geolocation
API yordamida foydalanuvchining koordinatalarini olishingiz va keyin ularni xaritadan joyni topish uchun ishlatishingiz mumkin.

        <p class="status"></p>
<iframe class="map" src=""></iframe>
<button class="button">Men qayerdaman?</button>


const button = document.querySelector(".button"),
map = document.querySelector(".map"),
status = document.querySelector(".status");

button.addEventListener('click', findLocation);

function findLocation() {
if (!navigator.geolocation) {
status.textContent = 'Ваш браузер не дружит с геолокацией...';
} else {
navigator.geolocation.getCurrentPosition(success, error);
}

function success(position) {
const { longitude, latitude } = position.coords;
map.src = `https://www.openstreetmap.org/export/embed.html?bbox=${longitude}%2C${latitude}&amp;layer=mapnik`;
}

function error() {
status.textContent = 'Baribir topaman!:0';
}
}


👉🏼 @Frontend 👈🏼
#vue #amaliyot

💼 Lavozim: Frontend Vue dasturchi

NDC(ndc.uz) IT kompaniyasi Frontend VueJS bo'yicha Internship e'lon qiladi!

🌐 Batafsil o'qing

Vakansiyalar: 👉🏼 @frontendVacancy
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
This media is not supported in your browser
VIEW IN TELEGRAM
Kursni bitirib ishga kirolmay yurganlar bilan ish haqida suhbat qilib qolsang 😁

👉🏼 @Frontend 👈🏼
Please open Telegram to view this post
VIEW IN TELEGRAM
JavaScript bilimingizni turli darajadagi misollar orqali kuchaytiring.

Bu saytlar orqali fikrlashingizni, bilimingizni yanada oshiring:

▫️ LeetCode
▫️ CodeWars
▫️ CodinGame
▫️ GeeksForGeeks
▫️ Programmr
▫️ TopCoder Challenges
▫️ CodeForces
▫️ SoloLearn
▫️ KickStart — Google’s Coding Competitions
▫️ CodeChef
▫️ CodeGym
▫️ CodePen Challenges

Siz yana qanday saytlarni bilasiz? Izohlarda qoldirishingiz mumkin! 💬

👉🏼 @Frontend 👈🏼
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
#devtools #ai

Web dasturchilar uchun top AI yordamchilari

1. Sketch2Code
2. Durable
3. ChatGPT
4. Code Mentor
5. Copilot by GitHub
6. Copilot

👉🏼 @Frontend 👈🏼
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
This media is not supported in your browser
VIEW IN TELEGRAM
#game #devtools

🎮 Frontend'ni o'yin o'ynab o'rganing

Frontend'ni o'rganishda top 5 ta bepul o'yin:

🧟‍♂️ “Flexbox Zombies” - u sizga CSS Flexbox-ni o’rganishga yordam beradi. Ushbu o’yinda siz Hoodie nomli personajni boshqarishingiz kerak, u Flexbox kodini ishlatadi.

🥕 “CSS Grid Garden” - sizga CSS Grid-ni o’rganishga yordam beradi. Ushbu o’yinda siz sabzavot bog’ini rivojlantirish uchun CSS kodini yozasiz.

🍽 “CSS Diner” - Ushbu o’yin orqali, siz CSS-ni o’rganishda yordam beradigan bir qator topshiriqlar orqali o’z CSS mahoratingizni oshirishingiz mumkin.

🏹 “CodeCombat” - o’yin Python va JavaScript dasturlash tillarini o’rganishga yordam beradi. U yerda 400 dan ortiq darajalar mavjud.

🥊 "Coding Fantasy" Bu platforma sizga HTML, CSS va JavaScript-ni o’rganishga yordam beradigan bir qator o’yinlarni taklif qiladi.

👉🏼 @Frontend 👈🏼
Please open Telegram to view this post
VIEW IN TELEGRAM
2025/07/06 15:04:08
Back to Top
HTML Embed Code: