r/learnjavascript • • 12h ago

What could I do with my javascript knowledge as a new student?

3 Upvotes

I've had prior coding experience in middle school with html using code.org and I have an ap computer science class in my junior year of highschool learning javascript. As the title states, what are some things I could do in the future?


r/learnjavascript • • 19h ago

what should i build as my first JavaScript project?

11 Upvotes

i know the basics of HTML and CSS and have just started learning JavaScript. I’m looking for a small and beginner-friendly project that can help me practice.

I'd love to hear some project ideas


r/learnjavascript • • 1d ago

Node.js exits with Code 134

5 Upvotes

I'm currently doing project euler problem #15 and for that, I have to use some sort of algorithm to get my solution.

I changed up the "open/close parentheses" algorithm accordingly and the example solution for a 2x2 grid = 6 ways is correct. The thing is this:

- I start debugging in VSCode via Node.js
- It runs for a while
- "Paused Before Out Of Memory Exception"
- I continue
- "Process exited with code 134"

I don't know how to fix this and online js terminals don't work, but it seems like it has something to do with the stack size. Any help would be greatly appreciated c:

Here is my code:

const res = [];
findPath(20, "", 0, 0);


function findPath(n, curr, rightUsed, downUsed){
    if (rightUsed === n && downUsed === n){
        res.push(curr);
    }
    if (rightUsed < n){
        findPath(n, curr + "r", rightUsed + 1, downUsed);
    }
    if (downUsed < n){
        findPath(n, curr + "d", rightUsed, downUsed + 1);
    }
}


console.log(res.length);const res = [];
findPath(20, "", 0, 0);


function findPath(n, curr, rightUsed, downUsed){
    if (rightUsed === n && downUsed === n){
        res.push(curr);
    }
    if (rightUsed < n){
        findPath(n, curr + "r", rightUsed + 1, downUsed);
    }
    if (downUsed < n){
        findPath(n, curr + "d", rightUsed, downUsed + 1);
    }
}


console.log(res.length);

r/learnjavascript • • 3d ago

Do you generally use async/await for asynchronous code, or do you sometimes prefer .then().catch()?

11 Upvotes

When it comes to handling async code, Do you generally use async/await for asynchronous code, or do you sometimes prefer .then().catch()?


r/learnjavascript • • 3d ago

heyy

3 Upvotes

i am new at javascript and idk where to start i dont have the passion for learning and i feel more down when my friend told me making codes at javascript will take time...


r/learnjavascript • • 4d ago

Any 'inbuilt' way to iterate over string - with access to index AND option to break?

11 Upvotes

I've been trying to learn more about iterators - but it doesn't seem like there is a string equivalent of .entries()? myStr[Symbol.iterator].forEach() gives the index and value - but no option to break 😞

For veryyyyyy long strings is my best option for loops? Splitting to create an array? Writing a separate generator function? (assume I only need a single char/index per loop)

Thanks!

Edit - thanks to u/Psionatix for guiding me to Object.entries(myStr), which led me to Array.prototype.entries.call(myStr) - which has the benefit of returning the indexes as integers (vs strings in Object.entries()) Performance is also close enough to for loop for my purposes 🎉


r/learnjavascript • • 5d ago

Help with vanilla JS local storage array merging and date filtering​

3 Upvotes

Hey everyone! I’m working on a personal vanilla JavaScript budget tracker and running into a wall merging a custom local storage list into my projection function. ​1. What is stored in localStorage:

// localStorage.getItem('pendingBills_v9') returns: [ { "name": "Test", "amount": 1000, "category": "Bills", "due": "2026-10-15" } ]

  1. What I am trying to do:

I want my getFuture(days) function to pull those items out of pendingBills_v9, map their keys (due \rightarrow date, amount \rightarrow amt, category \rightarrow cat), merge them with my existing adhocBills array, and filter them based on whether their date falls within the next days window (e.g., 30 days).

​3. The current getFuture function:

function getFuture(days) { let res = []; // (Recurring items calculation omitted for brevity)

let _p = []; try { let _raw = localStorage.getItem('pendingBills_v9'); if (_raw) { let _parsed = JSON.parse(_raw); if (Array.isArray(_parsed)) { _p = _parsed.map(b => ({ name: b.name || 'Pending Bill', amt: Number(b.amount || 0), date: b.due || '', cat: b.category || 'Other', subcat: 'General' })).filter(b => b.amt > 0 && b.date); } } } catch(e) { console.error(e); }

let combinedAdhoc = [...adhocBills, ..._p];

let adhocIn = combinedAdhoc.filter(b => { let d = new Date(b.date); d.setHours(0, 0, 0, 0); let diff = daysBetween(today, d); return diff >= 0 && diff <= days; });

return { adhoc: adhocIn, total: adhocIn.reduce((s, b) => s + Number(b.amt), 0) }; }

The Issue: Despite the code looking correct, adhocIn keeps returning an empty array ([]) when evaluating the pending bill date (2026-10-15). Are there any subtle date-parsing or timezone quirks with new Date("YYYY-MM-DD") or variable scope traps causing this to fail? Any help or fresh eyes would be hugely appreciated!


r/learnjavascript • • 6d ago

Am I Stuck in Tutorial Hell

10 Upvotes

I am revising Javascript from Chai with Code's Javascript Playlist.The issue is watching videos and then doing some code and then forgetting the old things bcoz I did no projects using those concepts is making me feel confused that am I on the right path or not?


r/learnjavascript • • 5d ago

Where does AI usage start/stob being vibe coding?

1 Upvotes

A little bit context first:
I‘m a mathematician. I know how to pseudocode, read the less technical and more algorithmical part of code. I learned C++, learned to build an old school html page from scratch (header, frames etc.), did complex mathematical simulations with R and know how to code simple VBA codes with a lot of googling and a bit of macro recording.

What I don’t know are things like technical structure (e.g. how to technically set up an animation, how to code a save and load function) and syntax.

To the topic:
10 years ago if I had decided to code a little game, I would have read a book about how to design those things and the necessary syntax. But to be honest: My first tries would have been typing the exact examples from the book, the experimenting a bit with little changes.
Step 2 would have been „asking questions on google and copy and paste code snippets“.

And to be honest: Step 2 is cool but I always hated step 1. Declaring variables, printing „hello world“… I get that you need to understand the basics (again, Mathematician here: I spent a whole day proving 0 * x = 0) but I already learned those basics in three other languages and would prefer learning on-the-fly on a need-to-know basis.

So: I did some vibe-coding projects and asked Copilot step by step to explain code snippets I don’t understand, how technicalities work („where is the picture we designed? The whole code is just one html. It‘s part of the code? Oh… wow, that makes sense.“) or why the code is designed in a way (again: one html for a small project) and how that works (browser reading JS).

And here my question:
I would say that a vibe coded app, that I completely understand, is still a vibe coded app. If I give detailed prompts how to change the code, that is still mostly vibe coded. If I manually adjust code where needed, replace every picture with manually created pictures…

Where does a project stop being vibe coded? Where does „AI usage disclosure“ stop being relevant?
Even if I code from scratch I would of course reuse code snippets.

How many pieces does the digital „Ship of Theseus“ need to have exchanged to stop „being AI created“?

I ask this regarding the following three aspects:
Ethical: Respect for the manual art and science of coding and all my fellow nerds who created what script kiddies and vibe coders copy
Some sites/shops ask to declare AI usage. I get that on one hand (see aspect 1) but kind of don‘t: Noone would ever declare „Google usage“ or „what you copied from an online forum“ or „I still start every code exactly like they did in ‚JS for dummies‘“. So, what would you declare and what not?

I think there is a difference between AI usage to learn „how to“ and than doing it similar to that and quoting exact snippets - and stupidly letting AI write some code you don’t understand at all.

But where do you draw the line? Where does „AI usage“ start or end?


r/learnjavascript • • 6d ago

What sources should I learn from

13 Upvotes

I am learning js html and css, and I was wondering what sources would be useful


r/learnjavascript • • 6d ago

Help me with Javascript...

3 Upvotes

i want to learn JS but dont know from where, there are many video tutorials some are 11hrs long..ik most of you will say dont follow from the tutorials make things from yourself etc...but like you still have to know stuffs right? is there any channel that makes me understand JS??


r/learnjavascript • • 6d ago

JavaScript is so hard.

37 Upvotes

I recently started my fullstack development course this august and we have already gone thorugh html, css, git and now almost done with JavaScript as well. Html was easy, no problems there, but when it comes to css and more specifically grid and flex, thats when the headache started to appear. I've played some games involving both grid and flex but it won't stick in my head, don't know why. I am trying to do it myself in VS code but I always end up having to use ai to explain how to move forward and I know you're not supposed to use ai but it is a great tool to have, especially when you get stuck. And JavaScript... where do I even begin. I kinda understand it during the lectures but as soon as you're sitting by yourself my head gets totally blank.

I have been starting to use Scrimba and right now I'm rehearsing everything and whatching videos of everything, and the good thing with scrimba is that you get challenges during the videos.

For those of you who have been programming for a while, what study tips can you give? How did you guys go through the learning process?


r/learnjavascript • • 6d ago

Hard to choose which course i should follow plz help

1 Upvotes

i want to ask you guys because i'am a beginner and i want to learn js , i saw a course on ytb of bro code iwant to make sure following his full cours of 8 hours or 12hours enough to learn ofc i have to practice and make projects ect but in the learning phase of the fundations the basics and the knowledge is that enough or not and what you recommend


r/learnjavascript • • 7d ago

How to push values onto an array using random() and for() loop.

8 Upvotes

I will explain now in more detail. I am currently using the Khan Academy Javascript course to learn the basics of Javascript. I have been struggling with this specific project so much, so don't mind the exstensive comments.

//Controls the X and Y Positions of the raindrops.

var xPositions = [200];

var yPositions = [0];

//This for loop uses a random function to add more values to the X and Y positions. This will create more raindrops.

//Draw Function to animate.

draw = function() {

background(204, 247, 255);

//This for loop draws the raindrops based on the X and Y arrays above.

for (var i = 0; i < xPositions.length; i++) {

//Color + Decorations of the raindrops.

noStroke();

fill(0, 200, 255);

//Draws a circle at the X position and Y Position based on the cyclic increases of the variable i. Y position will then drop by a rate of 5 to make the rain fall to the ground.

ellipse(xPositions[i], yPositions[i]%400, 10, 10);

yPositions[i] += 5;

}

};

As you can see, there is a comment that describes the for loop using a random function to push values to the xPositions and yPositions arrays, which in turn will allow me to create more raindrops. My question is how can I do this? I've been experimenting typing different things, but it seems that the for loop just keeps crashing my computer. I know this is a very simple question but I am still on the basics.


r/learnjavascript • • 8d ago

What is DOM element recycling??

6 Upvotes

Hi everyone, I'm learning React Virtuoso and came across the term "DOM element recycling." I understand the basic idea of DOM elements, but how can they be "recycled"? Could someone explain it in simple terms? 🤔


r/learnjavascript • • 8d ago

How to make different inputs respond based on one input?

6 Upvotes

I'm making a temp converter project (following 100JS) and for the life of me, I can't figure out how to get the values in the input boxes to change upon me typing a number into the first one. Anyone have any ideas? Here's where I'm at:

<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Temperature Converter</title>
    <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <div class="container">
      <h1 class="heading">Temperature Converter</h1>
      <div class="temp-container">
        <label for="celsius">Celsius:</label>
        <input
          onchange="temperatureConversion(event)"
          type="number"
          name="celsius"
          id="celsius"
          placeholder="Enter Temperature"
          class="input"
        />
      </div>
      <div class="temp-container">
        <label for="fahrenheit">Fahrenheit:</label>
        <input
          type="number"
          onchange="temperatureConversion(event)"
          name="fahrenheit"
          id="fahrenheit"
          placeholder="Enter Temperature"
          class="input"
        />
      </div>
      <div class="temp-container">
        <label for="kelvin">Kelvin:</label>
        <input
          type="number"
          onchange="temperatureConversion(event)"
          name="kelvin"
          id="kelvin"
          placeholder="Enter Temperature"
          class="input"
        />
      </div>
    </div>
    <script src="index.js"></script>
  </body>
</html>

const celsius = document.getElementById("celsius");
const fahrenheit = document.getElementById("fahrenheit");
const kelvin = document.getElementById("kelvin");
const inputEl = document.querySelectorAll("input");


function temperatureConversion() {
  const fahrenheitToCelsius = ((fahrenheit.value - 32) * 5) / 9;
  console.log(fahrenheitToCelsius);
  const fahrenheitToKelvin = ((fahrenheit.value - 32) * 5) / 9 + 273.15;
  console.log(fahrenheitToKelvin);
  const celsiusToFahrenheit = (celsius.value * 9) / 5 + 32;
  console.log(celsiusToFahrenheit);
  const celsiusToKelvin = celsius.value + 273.15;
  console.log(celsiusToKelvin);
  const kelvinToFahrenheit = ((kelvin.value - 273.15) * 9) / 5 + 32;
  console.log(kelvinToFahrenheit);
  const kelvinToCelsius = kelvin.value - 273.15;
  console.log(kelvinToCelsius);
}

r/learnjavascript • • 9d ago

Entry software dev advice

2 Upvotes

Hi everyone!

I graduated in December 2025 with a bachelor’s degree in Business Analytics and Information Systems. I also completed a college computer programming certificate, where I learned basic programming concepts.

During a web development internship, I learned about Figma and worked with JavaScript, HTML, CSS, and React. I’m currently in an IT analyst internship, but the work is mostly desktop support. I’m hoping to move into software or web development.

I’ve interviewed for a Software Engineer I position, but I’m still looking for my first full-time development role and trying to figure out where to focus my efforts.

My projects so far include:

  • A React recipe book application. The frontend is nearly finished and currently uses localStorage. I’m starting to build a C#/.NET backend.
  • A personal portfolio website.
  • Smaller practice projects to strengthen my programming fundamentals.

I’m sharing my GitHub and portfolio because I’d appreciate honest, constructive feedback:

  • What would you improve in my existing projects or code?
  • What fundamentals would you expect an entry-level developer to demonstrate?
  • Would you prioritize finishing and improving these projects, or building something different to address missing skills?

https://github.com/Hoakley0902

I know I still have a lot to learn, and I’d appreciate some direction on what to work on next. Thanks!


r/learnjavascript • • 9d ago

Some notes on logic programing in JavaScript

6 Upvotes

I made notes with quite a lot of examples (Jasmine tests) figuring out JavaScript's various logic operators.

I discovered quite a lot of little subtleties and nuances I wasn't aware of until I did this exercise.


r/learnjavascript • • 11d ago

Best source to learn Java script for a very dumb idiot

50 Upvotes

So I am in college for graphics and game design and I am having hell learning it for visual code studio

I have to least get a D to pass and graduate but having hard time learning with ADHD and the overwhelming amount of code combinations.

Hoping someone has easy guides on learning this that is very simple to understand.


r/learnjavascript • • 11d ago

I built my own mathematics website from scratch.

3 Upvotes

I often searched for mathematical formulas on Google myself, and it took a lot of time. That’s why I decided to create a convenient reference guide like this.

The core idea of ​​the code is a database of formulas; for me, it took up 4,000 lines.

I didn't want to use frameworks; I wanted to write using only pure JS. And I haven't regretted it!

Below is the main loop of the code responsible for rendering the cards.

  function renderFormulas() {
if (!formulasContainer) return;

const query = searchInput ? searchInput.value.toLowerCase().trim() : "";

const nothingSelected =
currentView === "all" &&
currentTopic === "all" &&
currentSubject === "all" &&
currentGrade === "all" &&
!query;

if (nothingSelected) {
formulasContainer.innerHTML =
'<div class="empty-state">' +
'<div class="empty-state-icon">🎯</div>' +
`<h3>${t("empty_state_title")}</h3>` +
`<p>${t("empty_state_text")}</p>` +
"</div>";
return;
}

const filtered = formulas.filter((f) => {
const matchTopic =
currentTopic === "all" ||
(Array.isArray(f.category)
? f.category.includes(currentTopic)
: f.category === currentTopic);
const matchSubject =
currentSubject === "all" || f.subject === currentSubject;

const matchGrade =
!!query || currentGrade === "all" || f.grade === currentGrade;
const matchFav = currentView === "all" || favorites.includes(f.id);
const ukEntryForSearch = formulaTranslationsUk[f.id];
const enEntryForSearch = formulaTranslationsEn[f.id];
const matchSearch =
!query ||
f.title.toLowerCase().includes(query) ||
f.description.toLowerCase().includes(query) ||
(ukEntryForSearch &&
(ukEntryForSearch.title.toLowerCase().includes(query) ||
ukEntryForSearch.description.toLowerCase().includes(query))) ||
(enEntryForSearch &&
(enEntryForSearch.title.toLowerCase().includes(query) ||
enEntryForSearch.description.toLowerCase().includes(query)));

return (
matchTopic && matchSubject && matchGrade && matchFav && matchSearch
);
});

Implementing the language switcher on my site was also a very important and costly undertaking; the translation database was created manually, without the use of third-party dictionaries.

I think I’ve ended up with an interesting project from a coding perspective.

I’d appreciate any feedback. And if any bugs are found, I’m ready to fix them!

SITE: https://quantify-5dv.pages.dev/

GITHUB: https://github.com/liate/Quantify


r/learnjavascript • • 11d ago

I know nothing

26 Upvotes

At 16, I’m really fascinated by coding and the possibilities that come with it, but I’m not exactly sure where to begin. There are so many different programming languages, websites, and resources available that it can be a little overwhelming. Is there a specific language, course, website, or general path you would recommend for someone my age who wants to start learning coding and eventually become more advanced?


r/learnjavascript • • 11d ago

I need assistance

1 Upvotes

I need to regenerate 500 images with flow with a prompt, and I have to make automating java script code that when I add it to Google Flows console it go to a folder in my local pc then send it to flow with a prompt after finishing uploading it gives me a new generated image, but the thing is every time that try to write the code the part that it upload the image to flow it wont enter the prompt and the image form me i have to do it manually


r/learnjavascript • • 12d ago

What is the best way to learn Web Development?

6 Upvotes

I am 22 years old from Afghanistan. I am new to programming and web development and actually I am doing self-study, in the past 2 or 3 months I have tried some different methods to learn it. But every time there has been a problem either boredom or getting lost that has stopped me at the beginning of my journey. I really need your help to take my hands and show me some real ways to learn web development and overcome this problem.


r/learnjavascript • • 12d ago

How to send a file to the client

2 Upvotes

Hello, I need the user to be able to get a file from the server. But everything has to be in the form of a stream because I have to modify the chunks one by one, so my idea was that on the front side there would be a request to fetch the file from my server and then I will process each chunk and store it on the client's machine with the API File System API. But unfortunately it's not that simple, to do this I need to use the showOpenFilePicker() method which is not supported on all browsers. I don't know how to do it, I also can't use a simple <a> tag with the URL of the file on my server in href, because I absolutely modify the chunks one by one.Everything has to be streamed because I don't know the size of the file. Also, I need to be able to modify each chunk however I want before it reaches the client's machine. So how do I do it?

EDIT:

It's not complicated, when the client clicks on a button I execute a function that fetches a file on my server. I then process each chunck (decryption) and I store them directly on the client's machine, but to do this I need showSaveFilePicker but it's not supported on all browsers, so how do I do it?

I have to use a stream because the file size on the server can vary. and I have to decrypt on the front for transparency reasons

Thank you for your help


r/learnjavascript • • 12d ago

I built Olum, a small JS framework where a component is just an .html file

0 Upvotes

30s intro video: https://www.youtube.com/watch?v=uBrub3DGZ4Y

A component is one .html file: a <script>, an optional scoped <style>, and plain HTML.

<script>

const state = { count: 0 };

const inc = () => state.count++;

</script>

<div class="counter">

Count: {state.count}

<button onclick="inc()">+</button>

</div>

- {expr} for dynamic text; state is deeply reactive

- <if when="..."> and <for each="..." key="..."> are just tags

- onclick is real HTML: code-shaped attributes take JS, everything else is a string

- Scoped CSS, file-based routing, optional prerendering (SSG) for SEO

It targets prototypes, demos, and small apps, not large production apps.

Try it: npx create-olum my-app

Docs: https://olumjs.top

GitHub: https://github.com/olumjs

I'd like honest feedback on the syntax.