🕹Создаем ИИ в игре на JavaScript
Screeps — игра-песочница, в которой нужно создавать искусственный интеллект для ваших персонажей на JS.
Тем самым вы можете управлять вашими войсками, чтобы проходить эту игру.
Перейти к изучению
#javascript
‼️ Сегодня закрывается регистрация на курс JS Bootcamp: Deep Dive into React!
❗️Курс проходит на английском языке
🔗Успей подать заявку!
❓Пропустили презентацию курса?
▶️Ищите её в нашей группе Training Center (EN)
❗️Напоминаем: Вступительный экзамен состоится 17 февраля. Письмо с подробностями о тесте отправим завтра. Обязательно проверьте папку спам или напишите нам на [email protected], если не получите письмо.
#DSR_courses#JSBootcamp#JavaScript#dsr_training_center
Asinxron JavaScript (2-qism) || Async / await
Promiseda ketma-ket .then() methodini ko'p ishlatishdan saqlanish uchun Async/ await dan foydalanish tavsiya qilinadi.
async function fetchData(){
const response = await fetch("https://jsonplaceholder.typicode.com/todos/1")
const res = await response.json()
console.log(res);
}
Async / await da xatoliklar bilan ishlash uchun try / catch dan foydalanamiz
async function fetchData(){
try{
const response = await fetch("https://jsonplaceholder.typicode.com/todos/1")
const res = await response.json()
if(!res.ok){
throw new Error("show erorr")
}
console.log(res);
}
catch(err){
console.log(err);
}
}
Async kalit so'zi bilan boshlangan har qanday fungsiya bizga promise qaytarishini xisobga olsak xatoliklar bilan fungsiya chaqirilgan joyda ham ishlash mumkin.
async function fetchData(){
const response = await fetch("https://jsonplaceholder.typicode.com/todos/1")
const res = await response.json()
if(!res.ok){
throw new Error("show erorr")
}
return res
}
fetchData().then((data)=>{
console.log(data)
}).catch((err)=>{
console.log(err);
});
#javascript#docs
☑️@valisherbotirov
Asinxron JavaScript || Promise
JavaScriptda Promiseni new Promise() konstruktoriga argument sifatida o'zida resolve va reject argumentlarini qabul qilgan fungsiya berish bilan yaratamiz.
const myPromise = new Promise((resolve, reject) => {
let age = 21;
setTimeout(() =>{
if(age > 20)
resolve("Done processing")
else
reject("Error processing")
},2000)
})
Promisedan qaytgan malumotlarni then va catch methodlari bilan tutib olib qayta ishlaymiz
myPromise.then((res) =>{
console.log(res)
}).catch((err) =>{
console.log(err)
})
Agar promise fulfilled muvaffaqiyatli bo'lsa malumotlarni then methodi bilan, agar xatolik rejected bo'lsa unda catch methodida xatolikni tutib olishimiz mumkin!
#javascript#docs
☑️@valisherbotirov
#javascript#cheatsheet
👨💻 JavaScript CheatSheet 1-qism
Yana qaysi texnologiyalar bo‘yicha Cheat Sheet📄 yuklashimizni xohlaysiz? Fikrlaringizni izohlarda qoldiring! 👇
💻@dasturlash_hayoti— dasturchilar va dasturlash hayotini yoritib boradigan loyiha!
#JavaScript#Beginners
🧰
JavaScript for Beginners
The JavaScript for Beginners course aims to teach students who are new to JavaScript the fundamentals of the programming language. The course is taught by Darragh O’Neill a Udemy Instructor who has has received excellent reviews on the platform and has at present a 4.7 star rating.
The course also contains several mini-projects and challenges so we can apply the JavaScript syntax that we have learnt. The course has overs 13+ hours of content and by the end of this course students will be familiar with all the fundamental aspects of the JavaScript language including data types, variables, let, const var, arrays, objects, functions, manipulating the DOM and more.
🔗Link
-----
Canal principal:@repo_science
Cupones: @freecoupons_reposcience
-----
A collection of free single-purpose online tools for web developers.
https://tiny-helpers.dev/
Follow @dragonmachinedreams
#programming#webdev#javascript
Генеративная серия «Risonanza» Алессандро Фьоре (Whitekross). Простые минималистичные формы сплетаются в уникальных цветовых ритмах, которые создает алгоритм художника-программиста. Этот проект исследует, как сложное рождается из самого простого: абстрактное и экспрессионистское искусство - из набора простых линий и форм, созданных компьютером.
#digitalart#javascript#абстракционизм
▫️Sintonia Digital Art▫️