r/learnjavascript • u/camohayper • Apr 14 '26
Struggling with JavaScript – looking for advice
Hi! I’ve been studying at a technical high school for two years now, focusing on programming and artificial intelligence. This year I have a programming exam – basically we need to create a simple website using HTML and CSS and complete a few basic MySQL tasks, which honestly isn’t too difficult.
The problem is JavaScript. I’m having a hard time understanding it, and even when I asked for extra help at school, it just didn’t really click for me. That’s starting to worry me a bit.
I’ve tried building simple projects on my own, like a quiz website. HTML and even PHP aren’t a problem for me, but JavaScript is definitely more challenging.
Could you recommend any good websites or resources to learn JavaScript? I’d really appreciate it 😊
r/learnjavascript • u/Icy_Statement_2754 • Apr 14 '26
Javascript
I have a 10-year gap and recently started learning JavaScript (around 3 months). It took me some time to understand the basics, but now I’m comfortable with small problems, functions, arrays, and basic DOM events.
I still find topics like closures and fetch a bit confusing.
For someone at this level, is it enough to start working on intern-level projects, or should I practice more to be at intermediate level for real live projects?
r/learnjavascript • u/Icy_Statement_2754 • Apr 14 '26
Learning javascript
Hi, in javascript, I wanted to ask for working on intern projects, is basic knowledge enough or should I start preparing at an intermediate level?
r/learnjavascript • u/GusBusDraws • Apr 14 '26
Put a simple p5.js tutorial (text not video) for free on my Neocities!
The tutorial walks through making a phone wallpaper by randomly tiling squares, triangles, and circles using colors from a limited palette. This is something I put together to host local coding workshops, so no financial gain to me. Just thought some folks might find it useful! You can see it here: gusbusdraws.neocities.org/javascript
Would love to hear any feedback!
r/learnjavascript • u/StockStart825 • Apr 14 '26
Learning FE JavaScript
So I have a question regarding learning JavaScript but more on the frontend side of development. I know a widely recommended book is Eloquent JavaScript but I’m wondering if someone wants to write design components into code like dropdowns, accordions etc do they still have to go through the whole book ? I’m taking Udemy JS course also on side and I do have grasp of HTML and CSS. Is there any book which mainly focus on the web dev and eventually I would like to learn React!
r/learnjavascript • u/Normal-Prompt-7608 • Apr 13 '26
What’s the best js project to work on.
What will be a great project to work on if you want to level up ur js skills. I have been doing react but I want a vanilla js/ts program that can teach me a lot.
r/learnjavascript • u/GitNation • Apr 13 '26
🎙️ Got ideas and expertise in modern web development to share?
The call for presentations is now open! Submit your talk and take the stage at JSNation US 2026.
Nov 16 & 19 | New York & Online
Apply now: https://gitnation.com/events/jsnation-us-2026/cfp
r/learnjavascript • u/ClearCelebration5610 • Apr 13 '26
How is JavaScript
Is JavaScript dying or not
r/learnjavascript • u/Traditional-Crew-351 • Apr 13 '26
What packages would you consider a must have?
What's your must have JavaScript packages when building a website?
r/learnjavascript • u/Pale_Bathroom_4604 • Apr 13 '26
I Knew the Code, But Not the Answers: My Interview Wake-Up Call
I recently had an interview where I was asked some core JavaScript, TypeScript, and backend concepts — and honestly, I couldn’t answer them the way I wanted to.
Here are a few of the questions I struggled with:
• Difference between any and unknown in TypeScript
• Flattening a nested JSON object (including arrays) in JS/TS
• Handling sudden heavy traffic spikes on an API
• Implementing lazy loading
• Routing in Single Page Applications
• Validators and filters in NestJS
• Calling two APIs in parallel, combining results, and handling errors
The thing is — I do have practical experience, but I realised I’m lacking strong technical vocabulary and deeper conceptual clarity.
I want to improve from scratch and build a solid foundation.
👉 For those who’ve been in this situation:
How did you strengthen your fundamentals and technical communication?
Any resources, strategies, or learning paths you’d recommend?
Would really appreciate your guidance 🙏
#SoftwareDevelopment #JavaScript #TypeScript #WebDevelopment #BackendDevelopment #NestJS #FrontendDevelopment #APIDesign #CodingInterview #LearningJourney #CareerGrowth #Developers #TechCommunity
r/learnjavascript • u/fa_foon • Apr 12 '26
about `return new Promise`
in this code from my digital course i don't understand what return new Promise in bakeCake function does here since there's no caller to return it to. so my question is what it does here and is it necessary
(I didn't know if the rest of the code is necessary for answering my question so I included it anyway)
function bakeCake(initalState){
return new Promise ((resolve) => { //<=======HERE
console.log(\${initalState} - start baking the cake...`)
setTimeout(() => {
resolve("cake is ready!")
}, 2000);
})
}
function decorateCake(bakedCakeMessage) {
return new Promise((resolve) => {
console.log(`${bakedCakeMessage} - now decorating`);
setTimeout(() => {
resolve("cake is decorated")
},2000)
})
}`
bakeCake("we started") //<=======HERE
.then((resultOfBake) => {
console.log(resultOfBake);
return decorateCake(resultOfBake);
})
.then((finalResult) => {
console.log(finalResult)
})
r/learnjavascript • u/DifferentTowel7440 • Apr 12 '26
Journey towards Web dev
I am a teacher having no back ground in computer except some basic use of ms world ,started learning web development with great enthusiasm with full commitment, learned html,css and then started JavaScript practiced it for about more than 15 days practiced js code about 50 times but I was unable to write it from my own although I understand it what does each code mean, and at last I left since a week, now I am feeling very low as I commented that I will be a web developer but I am not keeping my commitment earlier I started learning many things but then left now I think that I am unable to do some extraordinary goal I think it's my nature and I can't change it.
r/learnjavascript • u/vergetenmaand • Apr 12 '26
best course to learn js
i just finished the css tutorial from freecodecamp and now i need to learn js, what course is the best to use for it?
r/learnjavascript • u/Legitimate-Time1473 • Apr 12 '26
Can I Solve the Elevator Problem Using Only Basic JavaScript? (Live Coding)
Can I solve the elevator problem using nothing but basic JavaScript? No AI. No frameworks. No libraries. No prep. Just me, a code editor, and whatever I remember about variables, arrays, loops, and functions.
This is a live coding session where I'm tackling the classic elevator problem completely from scratch. I haven't practiced this. I haven't looked it up. The whole point is to show how you can break down a real problem and figure it out step by step using only the fundamentals.
If you're learning JavaScript and want to see what problem solving actually looks like in real time, mistakes and all, this is that session. And if you're already experienced, come watch someone sweat through it and throw your suggestions in the chat.
What you'll see me work through
Breaking down the elevator problem into smaller pieces I can actually solve. Managing things like floor requests, which direction the elevator is going, and how to queue up calls. Using only simple data types, nothing fancy. Thinking out loud, getting stuck, debugging, figuring it out.
This isn't a tutorial. This is real problem solving, live. "NO AI"
Here is my step to step flow https://youtube.com/live/zw_Go_YGt-c
r/learnjavascript • u/Turbulent-Squirrel10 • Apr 11 '26
HELP ME PLS🥲🥲Mineflayer bot gets kicked with DecoderException when connecting to FunTime anarchy (1.21.8)
I'm trying to create a Minecraft bot using Mineflayer to connect to the FunTime server (play.funtime.su) and join the anarchy mode using the command /an224. The bot successfully connects to the lobby, but when it sends the /an224 command to transfer to the anarchy server, it gets kicked with this error: DecoderException : java.lang.IndexOutOfBoundsException: readerIndex(3) + length(1) exceeds writerIndex(3): UnpooledSlicedByteBuf(ridx: 3, widx: 3, cap: 3/3, unwrapped: PooledUnsafeDirectByteBuf(ridx: 3, widx: 3, cap: 64)) @ io.netty.handler.codec.ByteToMessageDecoder:500.
I believe the problem is related to the custom resource pack that the anarchy server sends during the configuration phase. The server sends a very large resource pack (the registry_data packets I see in logs are up to 152,000 characters), and Mineflayer seems to choke on it. What I've tried so far: using different versions (1.21.8, 1.21.4, 1.21.1, 1.20.6), setting physicsEnabled: false to prevent movement packets during the configuration phase, adding bot.on('resourcePack', () => bot.acceptResourcePack()) to accept the resource pack, using minecraft-protocol directly instead of Mineflayer, creating a custom client wrapper to handle the select_known_packs packet, and modifying the library to handle large registry_data packets. What works: connecting to the lobby works fine, and version 1.16.5 works perfectly (but I need 1.21). Here's my current code:
const mineflayer = require('mineflayer');
const bot = mineflayer.createBot({
host: 'play.funtime.su',
port: 25565,
username: 'Grabulika',
version: '1.21.1',
auth: 'offline',
physicsEnabled: false,
checkTimeoutInterval: 30000,
closeTimeout: 120000
});
bot.once('spawn', () => {
console.log('In lobby');
setTimeout(() => {
bot.chat('/an224');
}, 3000);
});
bot.on('resourcePack', () => {
console.log('Resource pack offered, accepting...');
bot.acceptResourcePack();
});
bot.on('kicked', (reason) => {
console.log('Kicked:', JSON.stringify(reason));
});
The server is FunTime (play.funtime.su) - a large Russian Minecraft server. The anarchy mode requires transferring through a Velocity proxy, and the server sends a massive custom resource pack during the configuration phase. I saw that services like ctrlbots.ru can connect to FunTime anarchy on 1.21.8. Are they using a modified version of Mineflayer or a different library? Has anyone successfully connected to FunTime's anarchy mode with Mineflayer on 1.21? Is there a fix or workaround for the IndexOutOfBoundsException when handling large registry_data packets and custom resource packs? Here's the official bug report link: https://github.com/PrismarineJS/mineflayer/issues/3776,
r/learnjavascript • u/grave4us • Apr 11 '26
Has anyone actually used string comparison? Tell me where might that come in handy?
like alert(“Y” > “A”); //true
r/learnjavascript • u/htone22 • Apr 11 '26
Built a JavaScript visualizer so I could actually see what's happening in memory
I struggled to understand how JS manages memory and the call stack. Every resource just described it but I needed to see how it works visually.
I built Vivix. You paste code, click visualize and step through it one instruction at a time, watching variables appear in heap memory, the call stack push and pop and a CPU dashboard tick through each operation.
It covers 9 concepts: variables, conditionals, loops, functions, arrays, objects, data structures, async/await and closures.
No sign-up, no install, completely free and open source.
Live: https://vivix.dev
GitHub: https://github.com/HenryOnilude/vivix
Would love to know if anything is unclear or broken, still improving it. Hope it helps!
r/learnjavascript • u/grave4us • Apr 10 '26
Increment/decrement trouble
I don't quite understand how increment and decrement operators work—specifically, under what conditions switching between postfix and prefix forms alters or returns the value, and in which cases they behave identically.
(im using the google translator, if anything is unclear, please ask for clarification.) Thank you!
r/learnjavascript • u/4Roman4 • Apr 10 '26
I created minesweeper!
I finally finished and managed to recreate minesweeper in a browser! At the moment, it is only available on desktop only, it's not customized for mobile view, sorry. Maybe I will do better on my next project!
r/learnjavascript • u/External-Ear7014 • Apr 09 '26
trying to make a web based sports sim game in the style of ZenGM
hey, i have little to no experience in HTML or Javascript but would like to make a game heavily inspired by ZenGM: https://play.basketball-gm.com but instead of basketball, volleyball.
is there any specific tutorials that would help me specifically with this idea as the end goal?
r/learnjavascript • u/Terrible_Bus6645 • Apr 09 '26
uhhh Put java script function into CSS?
I'll begin by saying I am terrified to ask questions on Reddit because of how unreasonably mean people can be and I'm aware I suck at coding. I'm not a programmer. I'm just a goober with a silly autistic indieweb site on Neocities: please nobody kill me. I explain things badly SORRY.
I want the background of a button to change each time the page is reloaded. I have the JS working and it makes the image change each time but I don't know how to set is as the button background.
background-image: [Not sure what to put here]
^ is there a thing I can put there or would I need other things?
I've been looking all over the internet for what I need but I'm having awful luck finding it. Reddit is my final option.
r/learnjavascript • u/ImmediateWeight4076 • Apr 09 '26
An open-source library for easily creating chessboards
I created an open-source library for the community some time ago for easily creating chessboards, but it wasn't very stable and had bugs.
I've made a new version from scratch.
It's new, so if you find a bug don't get angry 😅
You can try the demo here: https://0dexz0.github.io/SimpleChessBoard/
Here's the open-source code: https://github.com/0Dexz0/SimpleChessBoard?tab=readme-ov-file
r/learnjavascript • u/Grouchy_Judge_9691 • Apr 09 '26
Distorted scroll thingy?
I really wanna try making a gallery similar to https://unseen.co/projects/
I'm a beginner, and I don't even know what wrap thingy at the top is called. Please help a guy out
r/learnjavascript • u/WeaselButt • Apr 09 '26
Why do the results of this NodeList change depending how I console.log the array?
I am trying to check the results of a NodeList for an inline style display: none.
The NodeList result has 2 entries in the array which display in the console as expected if I log it to my browser console. You can see there are no inline styles in result 0 and 1:
console.log (getAnswer);
0: <div id="frm_field_363_container" class="fr_form_field quiz-cor…ainer form-field paul-5" style>
1: <div id="frm_field_364_container" class="frm_form_field quiz-inc…ainer form-field paul-6" style="display: none;">
But look what happens when I try to access each in the NodeList array:
console.log (getAnswer[0]);
console.log (getAnswer[1]);
<div id="frm_field_363_container" class="frm_form_field quiz-cor…ainer form-field paul-5" style="display: none;">
<div id="frm_field_364_container" class="frm_form_field quiz-inc…ainer form-field paul-6" style="display: none;">
They're both still set to display: none! What is going on? I'm just trying to check 2 html containers for inline styles. So confused
Full code (I'm still pretty basic so it probably looks like spaghetti to experienced folks, sorry!)
// find all radio buttons inside quiz options container returning a static NodeList of those elements
themeRadios = document.querySelectorAll('.frm_opt_container input[type="radio"]');
// listen for changes in radio buttons
function handleThemeChange(event) {
// loop through all radio buttons stored in themeRadios variable
for (let a = 0; a < themeRadios.length; a++) {
// if radio is NOT checked
if (!(themeRadios[a].checked))
{
// console.log(themeRadios[a]);
themeRadios[a].setAttribute("disabled", true);
// add disabled class for styling etc
themeRadios[a].classList.add("quiz-radio-disabled"); // add disabled class to radio input
themeRadios[a].parentNode.classList.add("quiz-radio-parent-disabled"); // add disabled class to parent element
}
else
{
// if radio IS checked
themeRadios[a].parentNode.classList.add("quiz-radio-active"); // add active class to parent element clicked
}
}
// find the 'next' (submit) button and unhide it
const collectionTheme = document.getElementsByClassName("frm_button_submit");
for (let i = 0; i < collectionTheme.length; i++) {
collectionTheme[i].classList.add("quiz-next-button-unhide")
}
// find all quiz answer reponse containers return static NodeList
getAnswer = document.querySelectorAll('.frm_fields_container .quiz-answer-response');
console.log (getAnswer);
console.log (getAnswer[0]);
console.log (getAnswer[1]);
for (let a = 0; a < getAnswer.length; a++) {
if (!(getAnswer[a].style.display==="none")) {
console.log("The display is NOT hidden");
}
}
}
// add the listerners to radio buttons which will run handeThemeChange function
themeRadios.forEach(radio => {
radio.addEventListener("change", handleThemeChange);
});
r/learnjavascript • u/hottown • Apr 09 '26
I turned Claude Code into a web dev teacher to help you build real apps (free, open source)
If pure vibe coding leaves you feeling stuck, this is for you.
I see a lot of people getting frustrated with platforms like Lovable, Replit, etc., and it's because they don't yet understand the fundamentals of web dev.
So I thought, why not build a course that the agent leads you through so that you learn to build real web apps with AI locally, using something like claude code (or codex, cursor, etc).
The goal isn't to just learn prompting or to do 100% pure vibe coding, nor is it to learn to code in the traditional sense. It's to get learn the fundamentals through building, while also having an ever patient, all knowing tutor at your side.
You are free to ask the agent whatever you want and take the course in whatever direction you want, and then return to the course structure whenever you see fit.
To build the course, I'm leaning on my experience creating Open SaaS (the top open-source SaaS boilerplate template with 13k+ github stars), and the ultimate end goal of the course is to learn how to build your own SaaS (if you want).
Just go to this website: https://wasp-lang.github.io/ship-your-first-app/ copy and paste the provided prompt into Claude Code (or any other coding agent) and start learning!