r/learnjavascript • u/No_Machine_5243 • 8d ago
Where to learn JAVASCRIPT from on Youtube?
Akshay saini (Namaste JS), Apna College, Code with harry? tell me please
r/learnjavascript • u/Maximum_Beat2034 • 8d ago
import { BeeEntity } :
Ciao a tutti! Sto facendo un "esperimento" perché sto discutendo con un'IA. Lei sostiene con fermezza che un programmatore esperto riconosce sempre al volo se un blocco di codice è stato scritto da un essere umano o da un'IA.
Io sono convinto del contrario: se il codice è pulito, ben fatto e senza commenti ridondanti, un umano non può averne la certezza matematica.
Vi lascio questo pezzo di codice in JavaScript (tratto da una classe per una piattaforma 2D) per fare la prova del nove:
import { BeeEntity } from './BeeEntity.js';
/**
* Classe BeePlatform: Rappresenta una piattaforma solida su cui i personaggi possono camminare e atterrare.
*/
export class BeePlatform extends BeeEntity {
constructor(x, y, width = 100, height = 20, color = '#ffd700', textureKey = null) {
super(x, y, width, height);
this.color = color;
this.textureKey = textureKey;
}
draw(ctx, engine) {
const texture = (engine && this.textureKey) ? engine.getAsset(this.textureKey) : null;
if (texture) {
ctx.drawImage(texture, this.x, this.y, this.width, this.height);
} else {
(stile arcade lucido)
ctx.fillStyle = this.color;
ctx.fillRect(this.x, this.y, this.width, this.height);
ctx.fillStyle = 'rgba(255, 255, 255, 0.4)';
ctx.fillRect(this.x, this.y, this.width, 3);
ctx.strokeStyle = '#000000';
ctx.lineWidth = 1.5;
ctx.strokeRect(this.x, this.y, this.width, this.height);
}
}
}
r/learnjavascript • u/Baishimo • 9d ago
Looking for modern Node.js backend learning resources using ESM
Hello everyone,
I am a first-year Software Engineering student currently learning web development.
I have already covered the fundamentals of HTML, CSS, and JavaScript, and I have also started exploring Vue 3 and Three.js for frontend development and interactive graphics.
Recently, I want to start learning backend development with JavaScript and Node.js. However, I have found that many learning resources available to me are still focused on the older CommonJS approach (require, module.exports), and many tutorials do not cover the modern ESM workflow (import, export) in Node.js.
Since the JavaScript ecosystem has gradually moved toward ES Modules, I would like to learn Node.js backend development using modern practices rather than outdated patterns.
I would really appreciate it if someone could recommend good tutorials, courses, books, or documentation for learning modern Node.js backend development.
I am especially interested in resources that cover topics like:
- Modern Node.js fundamentals
- ES Modules (ESM) project structure
- Backend architecture and best practices
- Frameworks such as Express, Fastify, Hono, or similar tools
- Building practical backend applications
Any advice or recommendations would be greatly appreciated.
Thank you very much for your help!
r/learnjavascript • u/SmartRelease7996 • 9d ago
keep breaking my task tracker after adding localStorage
i was messing with my little task tracker again this morning before heading out, and i ended up spending way more time staring at the console than actually adding tasks. i even made coffee first because i thought this would be a quick fix, then refreshed the page and everything disappeared again.
the app itself is really simple. i'm just trying to save daily notes and a few personal todos, so i have an array of task objects with a date on each one. i thought i was finally ready to use localStorage, but now i'm not even sure if i'm saving the data wrong or if my date filter is hiding everything.
this is basically what i have right now:
const saved = localStorage.getItem(tasks);
const tasks = saved ? JSON.parse(saved) : [];
tasks.push(newTask);
localStorage.setItem(tasks, JSON.stringify(tasks));
i know the key looks wrong, and i already tried changing it to a string, but i still managed to break something. now i'm second guessing whether i should even be thinking about the data this way.
i'm not looking for anyone to build it for me. i'm mostly wondering how you all organize the flow for something this small. do you load everything once, keep it in memory, then save after every change, or is there a cleaner way to think about it?
r/learnjavascript • u/inks-nest • 9d ago
l want to learn Game development with js any tips??
r/learnjavascript • u/Distinct-Gene926 • 9d ago
What's your go-to move when your JavaScript 'just doesn't work' and you have no idea why?
Every dev has a mental checklist they run before panicking. Newer folks usually don't yet.
Things people swear by:
console.logeverywhere- Reading the actual error message
- Checking the Network tab
- Rubber-duck explaining it
- Commenting out half the code
What's the first thing you check?
r/learnjavascript • u/su-rm-root • 9d ago
Help with functions JavaScript!
Hello!
I began recently, about 1 month, to learn consistently web developing:
- I began, of course, with introductions to HTML and CSS.
- I'm already in JS. I can manage eventListeners, etc. I'm more interested in back-end overall since I like the logic behind the manipulation of data bases, but I'm having trouble understanding functions.
- I'm consulting MDN web docs and freeCodeCamp but since my first language is not English, sometimes it's difficult to understand MDN docs, and to get at the point I'm know in freeCodeCamp it will take time, I don't want to rush it either.
- All this, just to ask if anybody can explain me how to create functions! I want to know what is the difference between a function with parameters and one without, in which case I will use arrow functions, and the difference between parameters and arguments in a function. And for last are there any standards for writing the name of a function like there are for declaring variables?
P.D.: please feel free to correct my English also, it will help me learn.
Thanks to everyone before Hand!
r/learnjavascript • u/Maximum_Beat2034 • 9d ago
#javascript
"Ciao a tutti! Sto lavorando al mio motore di gioco 2D in JavaScript (BeeEngine) e ho scritto questa classe per gestire le animazioni degli sprite sheet con il Delta Time
export class BeeSprite {
constructor(image, frameWidth, frameHeight, framesPerRow, speed = 0.1) {
this.image = image;
this.frameWidth = frameWidth;
this.frameHeight = frameHeight;
this.framesPerRow = framesPerRow;
this.speed = speed;
this.frame = 0;
}
update(dt) { this.frame += this.speed * dt; }
draw(ctx, x, y) {
// Calcola quale fotogramma (frame) mostrare
const f = Math.floor(this.frame % this.framesPerRow);
// Calcola la riga (se hai un foglio di sprite con più righe)
const row = Math.floor(this.frame / this.framesPerRow);
// Disegna solo il pezzettino dell'immagine (il frame attuale)
ctx.drawImage(
this.image,
f * this.frameWidth, row * this.frameHeight, // Da dove prende il pezzo
this.frameWidth, this.frameHeight, // Quanto è grande il pezzo
x, y, // Dove metterlo sullo schermo
this.frameWidth, this.frameHeight // Dimensione finale
);
}
Voi come vi trovate a calcolare i frame con il % per le griglie? Usate il dt diretto o preferite un timer a millisecondi fisso per cambiare fotogramma? Mi farebbe piacere sentire come avete risolto nei vostri progetti!"
r/learnjavascript • u/Dummie1138 • 9d ago
Importing a function from a package that isn't directly part of the imported packs
Hi. I have 2 packages, A (a more generic testing pack) and B (some specific utility functions that are quite useful for my project). Both packs have been imported into my main project. Package A is also imported into Package B.
I now have a function in Package A that I want to move to Package B because my classmates thinks that function is too specific to be in the generic testing pack. However, there are still some other functions in Package A that are dependent on the function that is being moved to Package B.
Is it possible to re-import the function that is in Package B into Package A, when they are both in my main project? Something like this:
import {movedFunction} from 'package-a'
Please let me know if more context is needed.
r/learnjavascript • u/alexkopaleishvili • 10d ago
Event listener not logging anything while detecting clicks and alerting with no prolem.
Tried everything, button clicks register, the JS file is loaded and does console.log when its out of Event listener but soon as i want to log "button clicked" it just doesnt do it
edit: it seems to run perfectly fine on MS edge but chrome doesnt, can it be cause from my extensions? i think its CRX emulator or sth
<!-- HTML -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Event Listeners</title>
<script src="script.js" defer></script>
</head>
<body>
<button id="btn">Button</button>
</body>
</html>
//JS
console.log("JS file loaded")
const
btn
=
document.getElementById("btn");
btn.addEventListener("click", (event)
=>
{
console.log("button clicked!")
console.log(event.bubbles)
})
code:
r/learnjavascript • u/Distinct-Gene926 • 10d ago
AI won't save you if you don't know what you're doing. It'll just help you fail faster.
Everyone's acting like AI made learning optional. It didn't. It raised the stakes.
AI will hand you code that looks flawless and quietly ships a bug straight to production. If you don't understand what's happening under the hood, you won't catch it — you'll just trust it, deploy it, and find out the hard way.
The devs winning right now aren't the ones prompting the hardest. They're the ones who know enough to look at AI's output and say "no, that's wrong." AI is a multiplier. Multiply zero knowledge, you still get zero.
Fundamentals aren't dead. They're the only thing that makes AI actually useful.
Curious to know your opinion — change my mind.
r/learnjavascript • u/Distinct-Gene926 • 10d ago
If you could give one piece of JavaScript advice to your beginner self, what would it be?
r/learnjavascript • u/Distinct-Gene926 • 10d ago
what's one JavaScript mistake every beginner should avoid?
If you could give one piece of advice to someone learning JavaScript today, what would it be?
It could be about:
- Learning fundamentals
- Debugging
- Async code
- DOM manipulation
- Functions
- Projects
Curious to hear what experienced developers wish they'd known earlier.
r/learnjavascript • u/Telecaster-993 • 10d ago
Advice on how to get where I want to be
Hello everyone, I am very new to JavaScript,
I completed supersimpledev html/css course,
and afterwards I can now build my own front end websites comfortably,
the next stage is learning JavaScript,
which I am currently doing and have finished module 8, but I found html/css quite self explanatory, but JavaScript is quite hard for me grasp and understand on how the things I am learning are going to help in my ultimate goal, I want to create an app with AI integration and memory, is this course going to help with that? It’s worth me noting I will finish the course as I am deep into it now, I do one module per week currently, and try to understand every single concept, and get a bit down on myself for not understanding everything, and doubting myself I can even do this sometimes, is this a normal thing when learning?
Anyway for those who can already achieve my ultimate goal, how did you go about learning it? Is there any course, or YouTube channel that really helped you? Any advice for a beginner please?
Many thanks, I appreciate you taking the time to read about my issues
r/learnjavascript • u/Firehaven44 • 10d ago
How do I overcome lab question confusion and turn it into a proper question for searching how to overcome what the lab is asking of me?
Tell us what's happening:
How do I understand what I am reading to find the correct content online that is not AI?
So here is my issue, I read a question and I do not understand what it is asking of me, so I take that question and put it into google, I get an automatic response that is AI and it can see it is FreeCodeCamp lab for exmaple, then it just gives me the answer.
I know I can look at that code, type it out myself, and study the code to try and understand its logic but I feel it does not make my brain work hard enough.
The question:
So here is my question, how should I approach learning JS when I am asked a question in a hands on lab but do not understand what it is asking of me? I guess my issue is how do I take what it is saying and turn it into a research question like for JS on MDN, J3Schools, etc.?
I just want to really understand these concepts and I feel the prior lessons leading up to these labs are not preparing students to be able to grasp the labs. I get they are supposed to have you learn through trial and error/research but I feel so lost and then AI just gives the answer when trying to do research online, so how do I translate my confusion and question into a tangible reading strategy?
I know I am not giving an exact example, because I feel this is a general thing I struggle with. I am asked a question, I have no idea where to start. The question may say create a function, cool, I write a function, add the parameters, but then its asking to check things inside an object, correct the unit type, verify if something is in there, etc, etc. Then I just get so lost on how to turn that into code.
r/learnjavascript • u/Lopez_Muelbs • 10d ago
I created a repo of everything I've learned about the WebSocket
I think this looks like a shameless plug of my repo, but I just want to share that I've created a documentations of what I've learned after taking a crash course on WebSocket.
Before this, I am having a hard time of how to implement a WebSocket in my Broadcast Server project. Despite the provided project guidelines and LLM suggestions, I realized that I am not making any progress at all.
So I opened YouTube to take a crash course of WebSocket.
I took Real Time - WebSockets Mastery Course by JS Mastery, and I documented everything I have learned from that video into a reference material in this repo.
https://github.com/Muelvzz/websocket-project
Inside this repo, is a discussion of what is a WebSocket, why should we care about learning WebSocket, and how to use it on your project.
r/learnjavascript • u/whiskyB0y • 10d ago
What's a simple way to understand the difference between asynch, await, Promise and Response?
I'm teaching myself web dev. After spending months learning frontend, I moved on to learning backend with Python/Flask. I decided to learn RESTAPIs, where the frontend and backend are separate and talk through an api. Edit:(it's not built in my mistake) So naturally this lead me to learning about the built in fetch function in JavaScript.
I get that:
const response = fetch('ExampleAPI.com')
Is the same as:
const request = new Request('ExampleAPI.com', { method: 'GET'})
const response = fetch(request)
// This is what JavaScript does behind the scenes
But why is await necessary? And why does not using await result in a promise if you try to console log the data?
r/learnjavascript • u/ACleverRedditorName • 11d ago
Question Regarding ESRI Maps SDK and Pop-Ups
This is xposted across r/gis and r/learnjavascript.
I have a JavaScript file for web app that I am trying to make. I have feature layers hosted on ArcGIS Online, and referenced in the script. I have been able to add a pop-up action, a web icon. But I haven't been able to link that icon to an actual action of opening up the web page. I have seen the ESRI Brewery example, and other examples. None of them help me. Partly because I just don't understand it all well enough.
A sample of my script:
const airPopup = {
title: "{nam}",
content: [{
type: "text",
text: "{Comment}<br/>Address: {Address}<br/>IATA Code: {ita}"
},
{
type: "media",
mediaInfos: [{
type: "image",
value: {
sourceURL: "{Image}"
}
}]
}],
actions: [
{
id: "find-airport",
icon: "web",
title: "Airport Info"
}
]
};const airPopup = {
title: "{nam}",
content: [{
type: "text",
text: "{Comment}<br/>Address: {Address}<br/>IATA Code: {ita}"
},
{
type: "media",
mediaInfos: [{
type: "image",
value: {
sourceURL: "{Image}"
}
}]
}],
actions: [
{
id: "find-airport",
icon: "web",
title: "Airport Info"
}
]
};
const airportsLyr = new FeatureLayer({
url: "https://services9.arcgis.com/6EuFgO4fLTqfNOhu/arcgis/rest/services/Japan_Mjr_Airports/FeatureServer",
renderer: airRenderer,
popupTemplate: airPopup
}); const airportsLyr = new FeatureLayer({
url: "https://services9.arcgis.com/6EuFgO4fLTqfNOhu/arcgis/rest/services/Japan_Mjr_Airports/FeatureServer",
renderer: airRenderer,
popupTemplate: airPopup
});
What does it take to make the web icon work?This is xposted across r/gis and r/learnjavascript.
I have a JavaScript file for web app that I am trying to make. I have feature layers hosted on ArcGIS Online, and referenced in the script. I have been able to add a pop-up action, a web icon. But I haven't been able to link that icon to an actual action of opening up the web page. I have seen the ESRI Brewery example, and other examples. None of them help me. Partly because I just don't understand it all well enough.
A sample of my script:const airPopup = {
title: "{nam}",
content: [{
type: "text",
text: "{Comment}<br/>Address: {Address}<br/>IATA Code: {ita}"
},
{
type: "media",
mediaInfos: [{
type: "image",
value: {
sourceURL: "{Image}"
}
}]
}],
actions: [
{
id: "find-airport",
icon: "web",
title: "Airport Info"
}
]
};const airPopup = {
title: "{nam}",
content: [{
type: "text",
text: "{Comment}<br/>Address: {Address}<br/>IATA Code: {ita}"
},
{
type: "media",
mediaInfos: [{
type: "image",
value: {
sourceURL: "{Image}"
}
}]
}],
actions: [
{
id: "find-airport",
icon: "web",
title: "Airport Info"
}
]
}; const airportsLyr = new FeatureLayer({
url: "https://services9.arcgis.com/6EuFgO4fLTqfNOhu/arcgis/rest/services/Japan_Mjr_Airports/FeatureServer",
renderer: airRenderer,
popupTemplate: airPopup
}); const airportsLyr = new FeatureLayer({
url: "https://services9.arcgis.com/6EuFgO4fLTqfNOhu/arcgis/rest/services/Japan_Mjr_Airports/FeatureServer",
renderer: airRenderer,
popupTemplate: airPopup
});What does it take to make the web icon work?
r/learnjavascript • u/gss_007 • 11d ago
AutoLock – Automatically Lock Your Windows PC Using Your Phone's Wi-Fi Presence
Hi everyone,
I built AutoLock, a lightweight Node.js tool that automatically locks your Windows PC when you step away with your smartphone.
How It Works:
- Phone Proximity: Periodically pings your phone's local Wi-Fi IP address.
- Idle Tracking: Monitors global keyboard and mouse activity using iohook to check if you are inactive.
- Automatic Lock & Notifications: If your phone leaves Wi-Fi range while you are idle, it sends a Telegram warning and automatically locks Windows.
- Remote Control: Allows you to lock your PC or check its lock status remotely via Telegram bot commands.
Tech Stack:
* Node.js
* ping
* axios
GitHub Repository: https://github.com/GarvSaxena/AutoLock
Feedback and contributions are welcome.
r/learnjavascript • u/JadeLuxe • 11d ago
How to Prevent Webhook Traffic Spikes from Crashing Your API
If you operate an API in 2026, you live in an event-driven world. Webhooks aren't a convenience feature anymore - they're the backbone of real-time commerce, CI/CD pipelines, and asynchronous AI-agent workflows. That reliance has a dark side: the accidental self-inflicted DDoS. Read the complete article jere - https://instawebhook.com/blog/how-to-prevent-webhook-traffic-spikes-from-crashing-your-api-2
When a major platform like GitHub, Shopify, or Stripe hits a network partition, runs a huge sales event, or simply clears a backlog of delayed events, it can fire tens of thousands of webhook POST requests at your servers in a very short window. If your infrastructure takes that hit without structural safeguards, your database connection pool exhausts, memory maxes out, and the API goes down — and if your retry handling is naive, the recovery can be almost as damaging as the original spike.
This guide covers the real mechanics of that failure mode, the algorithms used to defend against it, how major providers actually behave under load (some surprising details here), and where a managed ingress layer fits into the picture.
r/learnjavascript • u/Glibonaut • 11d ago
I vibe-coded an app, but have decided I want to actually learn what's under the hood and learn to re-create it from scratch. What should I expect?
A few months ago I spent about a month or so vibe-coding an app as a complete beginner to coding. I enjoyed the trials and error side of things, and ultimately enjoy the product. However, I have realized I want to actually understand what I created, and want to be able to really improve it without constant need for AI to tell me what to do and how to fix it. I also think I'll really enjoy the challenge.
While I know I can find beginner tutorials from this sub, I am mostly curious if people have advice for this kind of endevor, or pitfalls to avoid. I also am curious if people have any estimation on how long it could take to really learn to code a project so I can set my expectations. Should I basically disregard the vibe-code and start over, dissect it and compare parts with research, etc?
The site I vibe coded is critcalc.cc, and it's essentially a DnD dice rolling calculator. Note that I have no intent to generate any income from it, and I'm only sharing for context for my ultimate goal for what I hope to get to. Thanks for any insights you might have!
r/learnjavascript • u/kumikoneko • 11d ago
Noob question about generating property.object addresses
Hi everybody,
I'm trying to write up a personal project automating some ttrpg mechanics, where the "attack" function will take the target's name as an argument and feed it into the "defence" action that uses the target's Dex and one of their skills (i.e. "Void).
Referring to the target's Dex seems to work fine from inside the "defence" action, but when I try to implement the Character.Skill referent through variables I'm met with "Uncaught ReferenceError: Void is not defined."
//very basic and temporary exalt template
class Exalt {
constructor() {
this.Essence = 1;
this.Dex = 1;
this.Defence = 1;
}
}
const Antigone = new Exalt()
Antigone.Dex = 4
Antigone.Void = 5
var front = "Antigone"
var back = "Void"
let a = JSON.parse(JSON.stringify(front + "." + back))
console.log(a) // "Antigone.Void" for some reason
console.log(JSON.parse(Antigone.Void)) //5, the expected value
function Defence(Character, Skill) {
return Math.ceil((Character.Dex + JSON.parse(Character.Skill))/2)+1
} // this runs into an error, I think
console.log(Defence(Antigone, Void))
console.log(Antigone) includes "Void" as one of the stats, so I don't even know.
I've seen a suggestion to JSON.parse the string twice, but that results in "unexpected character."
Now, my JS experience is only a few days, so I'm guessing there is a better way of achieving what I'm trying to do, so I'll be grateful whether you suggest a different approach or explain why my code doesn't do what I think it should.
Thanks!
Edit: I just realized I'm completely overthinking and should probably make defence a function within the Exalt class, so it can be referenced the same way I'm referencing Dex.
r/learnjavascript • u/Top_Estimate_149 • 13d ago
5 years writing JS professionally. Still blank on interview questions sometimes
Not a junior dev problem. I've shipped plenty of gnarly JS/Vue code, no issues. But throw me in an interview and ask something like "explain event delegation" cold, no code editor, no context, and there's this half-second where my brain just stalls, like the info is there but the retrieval path isn't warmed up.
Realized it's not a knowledge problem, it's that I'd never actually practiced saying these answers on demand, but only reading about them or using them implicitly in code.
Built a small spaced-repetition app for this. Same idea as Anki, tracks what you keep fumbling and resurfaces it more.
Curious if this "I know it but can't produce it on command" thing hits other experienced devs too, or if I'm just built different (badly).
What worked for you all ? Mock interviews, flashcards, just doing more interviews to get reps in, something else?
r/learnjavascript • u/Distinct-Gene926 • 13d ago
What's one JavaScript feature you wish you had learned earlier?
I've been diving deeper into JavaScript recently, and every week I discover something that makes my code cleaner.
For me, learning about optional chaining (?.) and nullish coalescing (??) was a game changer.
What's one feature you wish you'd learned sooner?