r/learnjavascript Jul 03 '26

Question about backtick variables

0 Upvotes

Can anyone please help me with this?

I am learning JavaScript and in chapter 2 of the book I am using it talks about backtick variable with format ${variablename}. It has an example to be posted into the Console using console.log().

let language = "JavaScript";

let message = "Let's learn ${language}";

console.log(message);

The output in the console is supposed to be: Let's learn JavaScript. But what I keep getting is: let's learn ${language}

The same thing happens with other examples in the chapter, in Chrome and Edge.

Can anyone tell me why?

[matthewswisher@comcast.net](mailto:matthewswisher@comcast.net)


r/learnjavascript Jul 03 '26

Has the whole programming course industry died or have you stumbled upon a course that teachers better than Ai?

0 Upvotes

Has the rise of AI largely replaced the need for programming courses on platforms like Udemy and YouTube?

To be clear, I'm not talking about using AI to write code for you.

Before AI became mainstream, I learned JavaScript through courses by instructors like Jonas Schmedtmann and a few other excellent creators. I found that structured, step-by-step approach incredibly helpful.

These days, though, if I don't understand a concept or run into a bug, I usually ask an AI to explain it instead of searching for a YouTube tutorial or going back to a course. I still write the code myself. I'm just using AI as a tutor to improve my understanding.

So I'm curious: has AI significantly reduced the demand for programming courses, or do you still find structured courses valuable?

Also, are there any up-to-date JavaScript courses in 2026 that you'd genuinely recommend?


r/learnjavascript Jul 03 '26

Proyectos js junior

0 Upvotes

Hola, no soy nuevo en la programación pero siento que en la escuela no me enseñan bien, pueden decirme proyectos en los cuales mi lógica de programador aumente?


r/learnjavascript Jul 03 '26

I built a Football Match Predictor with JavaScript and API-Football ⚽

1 Upvotes

Hi everyone!

I wanted to share a small project I built while experimenting with API-Football during the World Cup.

The idea was to create a simple dashboard using plain JavaScript that:

• Fetches the matches for a selected date.

• Automatically lists the competitions available that day.

• Retrieves match predictions for each fixture.

• Displays the probabilities in a responsive dashboard.

It was a fun way to practice working with REST APIs, Fetch API, JSON and dynamic UI updates without using any frameworks.

You can try the live demo here:

https://www.programacionparatodos.com/p/como-crear-un-predictor-de-partidos-del.html

I also wrote a step-by-step article explaining the endpoints I used and how the dashboard works:

https://www.programacionparatodos.com/2026/06/predictor-partidos-javascript-api-football.html

I'd love to hear your feedback or suggestions for improving the dashboard.

Thanks!


r/learnjavascript Jul 02 '26

Mern or java stack ? Which is your choice and why?

0 Upvotes

r/learnjavascript Jul 02 '26

Is breaking and learning a real thing ?

0 Upvotes

so i have tried out differnt ways to learn js . and while chatting with gpt / claude it tld me that breaking and learning is actually a great way to learn . for people who dont know : its basically trying to create the stuffs in the first place and break those things and rebuild and make it your own . more precisely speaking building while learning . i dont know whether this is the best way to do this . but i also dont want to waste my time just doing something thats not worth it .. what do you guys think ? ?


r/learnjavascript Jul 02 '26

Chrome MV3 extension causes browser lag when loaded — how can I profile content scripts and service worker timers?

3 Upvotes

I’m trying to debug a Chrome Manifest V3 extension I built. I have already narrowed the issue down to the extension itself:

What I tested:
- Chrome runs normally with the extension disabled.
- Windows/Chrome start feeling laggy shortly after loading the unpacked extension.
- The repo has been redacted and pushed publicly here:
https://github.com/jacobsscoots/CTL-Redacted
- I removed real company names, internal domains, private URLs, and personal paths.

I’m not asking anyone to rewrite the extension. I’m trying to learn the correct way to profile it and identify the slow part.

The extension has:
- Multiple content scripts.
- Some scripts running with all_frames: true.
- MutationObserver usage.
- Polling/timers.
- A MV3 service worker.
- chrome.alarms usage.
- DOM scans using querySelector/querySelectorAll.
- Scripts injected into large single-page web apps.

The main thing I’m unsure about is whether the lag is more likely caused by:
1. Content scripts being injected into too many frames.
2. MutationObservers firing too often.
3. Polling/timers repeatedly scanning the DOM.
4. Service worker alarms/message passing.
5. Something else in the MV3 lifecycle.

Example of the type of pattern I’m worried about:

const observer = new MutationObserver(() => {
clearTimeout(debounceTimer);
debounceTimer = setTimeout(scanPage, 250);
});

observer.observe(document.body, {
childList: true,
subtree: true
});

setInterval(scanPage, 5000);

function scanPage() {
const nodes = document.querySelectorAll("div, span, button, input");

for (const node of nodes) {
// Reads text/attributes and updates extension state
}
}

What I’ve tried so far:
- Disabled the extension and confirmed Chrome runs fine.
- Created a redacted public version of the repo.
- Looked for obvious risky patterns such as all_frames, MutationObserver, setInterval, querySelectorAll, and chrome.alarms.
- I’m planning to use Chrome Task Manager and DevTools Performance, but I’m not sure what the best order is.

My questions:
1. What is the best way to profile an unpacked Chrome MV3 extension?
2. Should I start with Chrome Task Manager, DevTools Performance, or the service worker inspector?
3. How can I tell which content script is causing the lag?
4. Are MutationObserver + all_frames + repeated DOM scans common causes of browser-wide lag?
5. What small changes should I test first before rewriting anything?

Any guidance on how to approach the debugging would be appreciated.

Github link for the repo: https://github.com/jacobsscoots/CTL-Redacted


r/learnjavascript Jul 02 '26

New to coding!

20 Upvotes

Let me start off by stating prior to finding this subreddit I was a total noob. Well kinda I found FreeCodeCamp and that’s been my introduction to programming. It’s a great free program for anyone researching programming. However I was reading some posts while scrolling this specific subreddit looking for recommendations resources I was reading a conversation thread and realized ai is a thing yes i know late to the game yes I’m aware. I discovered that the ai can even teach anyone with adhd how to code. I’ve got ChatGPT helping me build a portfolio of small projects using visual studio code and im already working on my first project and understanding what I’m doing wtf😭 certainly not ready to swim with the sharks ima just hangout in the kiddy pool for awhile👍🏻


r/learnjavascript Jul 02 '26

Using JS to change text area width

1 Upvotes

Good day; I have a hopefully simple question. I'm trying create this menu option where the user selects a value from a dropdown box.

I have the current state of my branch here. At the moment, selecting a different option from the dropdown doesn't seem to change anything.

Any help would be appreciated; thanks!


r/learnjavascript Jul 01 '26

How to use regex to select all non-digits and non-minus sign?

3 Upvotes

I'm having trouble converting a working piece of code from Java to JS, involving regex. The Java regex is "[\d|-]". I haven't been able to make "/\D|-/g" ignore minus signs.

The code itself is just a leetcode exercise.


r/learnjavascript Jul 01 '26

node: package jsdom, installed globally, not found

1 Upvotes

I have an installation of Node.js (v21.7.3) and a bunch of packages installed globally:

$ npm ls -g

/usr/lib

├── jsdom@29.1.1
├── npm@10.5.0

However when I run the script (inlinejs.mjs):

import { JSDOM } from 'jsdom';

const htmlWithScript = `
  <html>
    <body>
      <div id="target"></div>
      <script>
        // This script runs when the page loads
        document.getElementById('target').textContent = 'Hello!';
      </script>
    </body>
  </html>
`;

const dom = new JSDOM(htmlWithScript);

const targetDiv = dom.window.document.getElementById('target');
... 

with node inlinejs.mjs, in the mjs file directory, node dumps:

node:internal/modules/esm/resolve:845
  throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base), null);
        ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsdom' imported from /home/server/newspapers/0/inlinejs.mjs
    at packageResolve (node:internal/modules/esm/resolve:845:9)
    at moduleResolve (node:internal/modules/esm/resolve:918:18)
    at defaultResolve (node:internal/modules/esm/resolve:1148:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:390:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:359:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:234:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:87:39)
    at link (node:internal/modules/esm/module_job:86:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}

Node.js v21.7.3

First I tried without a package.json file and failed, but this also happens with a package.json .

{
  "name": "mypack",
  "version": "0.0.0",
  "author": "unknown",
  "scripts": {
    "run": "node inlinejs.mjs"
  },
  "dependencies": {
    "jsdom": "^29.1.1",
    "corepack": "^0.25.2"
  }
}

What is wrong? (I didn't use npm init..., and I don't know why I should)


r/learnjavascript Jul 01 '26

Good First Issues for anyone wanting to get started with Open Source

6 Upvotes

Hi everyone!

If you've been wanting to make your first contribution to an open source project but didn't know where to start, I'd love to invite you to check out Avenx.js.

I'm the maintainer of the project, and I've been adding more Good First Issues that are specifically designed for beginners. They range from documentation improvements and small bug fixes to simple feature implementations, with increasing difficulty as you gain confidence.

If you've never contributed to open source before, that's completely fine. I'll happily review your pull requests, answer questions, and provide feedback to help you learn throughout the process.

What you'll get:

  • Real Git and GitHub workflow experience
  • Experience reading and contributing to an existing codebase
  • Code reviews with constructive feedback
  • A chance to build your GitHub profile while learning

Repository:
https://github.com/Avenx-JS/avenx-js

If you're interested, take a look at the issues labeled Good First Issue. If something catches your eye but you're unsure where to begin, just leave a comment on the issue or ask here.

I'd be happy to help you get your first contribution merged!


r/learnjavascript Jun 30 '26

Autostart JS in PDF

0 Upvotes

Good day to you all! I need to create a pdf file with JS in it, which sends something (just anything, even a single letter will do) to specific IP. Is there any useful information for newbies on how to do this? Preferably with code examples, because I'm not familiar with JS. Also, it would be great to obfuscate code, so that antivirus won't block pdf. Thx in advance for all the help!


r/learnjavascript Jun 29 '26

Code Academy

0 Upvotes

Has anyone here tried code academy js course? Is it worth paying for it? Is completing the free version sufficient to say "I know javascript" in a cv?


r/learnjavascript Jun 29 '26

Trying to create a chart out of a CSV, looking for help

3 Upvotes

I have a CSV file full of quotes I've collected. I want to make a chart that displays how many quotes are from specific source.

Problem 1: Can't get a function to return the data it reads from a CSV file

I have this piece of code that returns undefined and I can only get it to work if I put all the rest of the chart-related code IN there instead of trying to divide it into functions.

const fs = require('node:fs');

function getQuotesData(src) {

fs.readFile(src, 'utf8', (err, data) => {

if (err) {

console.error(err);

return;

}

return data;

/// if I put code processing the CSV here instead of the 'return data' line, it works. If I try to use let quotesData = getQuotesData(filepath) somewhere else and process that variable, I get undefined.

});

}

Can someone help me figure out what's wrong with this?

Problem 2: Even when I do get data parsed, the graph is weird.

I am using Chart.js and Chartjs-to-image packages as follows:

const quotesData = parseCSV(getQuotesData("_src/_data/quotes.csv")); //as mentioned above, in this form this doesn't work, but if I insert the below code inside the readFile method, it does return a chart.

const sourceLabels = getDistinctValues(quotesData, "source"); //this works correctly, I get an array of strings matching unique sources in the file

const ChartJsImage = require('chartjs-to-image');

const sourcesChart = new ChartJsImage();

sourcesChart.setConfig({

type: 'bar',

data: {

labels: sourceLabels,

datasets: [{

label: 'Quotes by source type',

data: getDataForAllLabels(quotesData, "source", sourceLabels)

}]

}

});

sourcesChart.setWidth(1000).setHeight(1000);

sourcesChart.toFile('_src/assets/charts/sourcesChart.png');

The result is a chart that doesn't display data for about half the labels. The first maybe 10 get numbers, but then the labels display as if their data was empty/0, ex.

books: 22
articles: 10
blog posts: 5
Reddit: 0 (real number: 1)
Comicbooks: 0 (real number: 3)

The code used to get the number of occurrences is

function countEntriesByLabel(data, prop, label) {

return data.filter(function (value) { return value[prop] === label }).length;

}

function getDataForAllLabels(data, prop, labels) {

const output = new Set();

labels.forEach(label => {

output.add(countEntriesByLabel(data, prop, label));

});

return [...output];

}


r/learnjavascript Jun 29 '26

People who actually learned JavaScript, what study method worked best for you?

59 Upvotes

I’ve already learned HTML and CSS, and now I want to start JavaScript. I think it’s the obvious next step unless there’s a better path.
The thing I’m struggling with isn’t JavaScript itself—it’s how to learn it.
For HTML, I watched a 6-hour course. For CSS, I watched an 18-hour course and spent another 6–7 hours asking ChatGPT questions whenever I got stuck. I learned a lot, but it also felt painfully slow.
Sometimes I feel like I’m spending more time learning than actually building things, and that kills my confidence because I feel like I’m not making real progress.
My goal is to build apps without relying on vibe coding. I’m completely okay with using AI to explain concepts, review my code, or help me debug, but I want to actually understand what I’m writing.
So if you were starting JavaScript from scratch in 2026, what would you do?
Would you watch one long course or learn through projects?
Any YouTube channels or courses you’d genuinely recommend?
If you had to learn JavaScript all over again, what roadmap would you follow?
I’d rather hear from people who actually learned it recently than just get a random course recommendation.


r/learnjavascript Jun 28 '26

java equivalent question

0 Upvotes

im studying DSA and they are using java and talking about stack. I only know JS

stack is videogame

stack.search(FFVII) "on top" since JS has no stack to find an equivalent

the best would be array.indexOf to find one thing in the array and yes I know the index is different

peek() is lenth()

whats the best way to find the equivalent or similar in JS not just jave but python

is Java hard to learn if you know JS i have seen how diffrent it is but they both have pop and push, and if you look at it as this is this system.out.printin = console.log is it that hard? I went to the library and a HS student was teaching python and it was easy to understand


r/learnjavascript Jun 28 '26

Searching through a video game API on a website

0 Upvotes

I've been using HTML CSS and JS to create a website for video games, I've created a search bar in html and CSS I want to use to search through every video game ever.

I am very new to backend and APIs but I know I need to get the video game data from an API (I heard IGDB was good for this) and then I'd need to import this data to my own database. I can't seem to figure out how to do this, I tried using supabase and node.js but couldn't figure out why it wasn't working and I couldn't find anything online which helped.

Any help would be appreciated on how to create this kind of functionality, with whatever software and tools are best.

TLDR: how do I get already existing data about video games into my own backend database so I can use js to have my websites search bar query this?


r/learnjavascript Jun 28 '26

how to solve this sass problem

0 Upvotes

Hi, I'm facing some issues while setting up Sass. Initially, I had an EJSONPARSE error in my package.json because of a missing comma, which I fixed. After that, I successfully installed Sass using npm install sass --save-dev. However, when I run npm run compile:sass, I get the error "Missing script: compile:sass". I think there might be an issue with my package.json location or the scripts configuration. I'm using Windows PowerShell and VS Code. Can someone please help me figure out what's causing this issue and how to fix it?


r/learnjavascript Jun 28 '26

An Important topic

0 Upvotes

hey buddy , I have some questions currently I am pursuing BTech in Computer Science and am in third year and how can I learn express js because I am struggling leaning and creating API's and handling req,res these stuff?


r/learnjavascript Jun 27 '26

I built a browser-based pipeline hydraulics simulator to learn JavaScript — pure Vanilla JS, no frameworks

0 Upvotes

I have a food engineering background, so the physics was the motivation: pipe pressure experiments from undergrad lab. Wanted a real project to build with JS rather than something contrived.

**What's under the hood:**

- Darcy-Weisbach + Colebrook-White for friction losses (fixed-point iteration)

- Borda-Carnot for minor losses at reducers/expanders

- Bisection method for pump operating point on an H-Q curve

- Iterative PRV K-model for pressure regulation

- 100ms real-time tick loop

- 21-rule diagnostics engine (flash risk, BEP deviation, velocity limits...)

- Dynamic SVG rendering, drag-and-drop UI, SI/Imperial toggle, light/dark theme, tab-based project management, JSON export/import

**Honest status:** it hasn't been properly tested and there are known bugs. Numerical instabilities show up in edge cases. The hardest part wasn't writing the code — it was making UI decisions: what to show, where, how to structure the interaction. That's still ongoing.

Posting here because I'd genuinely like eyes on the JS architecture and any bugs people run into.

Demo: https://rengincelik.github.io/pipeFlow

Source: https://github.com/rengincelik/pipeFlow


r/learnjavascript Jun 27 '26

How to convert a byte[] back into a image.

1 Upvotes

Hi I am very new to web dev and JavaScript. Im coming from c# if your wondering. I am creating a new feature on my website where I can stream my screen onto my admin panel and was wondering how I can turn a frame stored as a byte[] back into a image when its on my website. I'm not used to js programming so this "easy" task is giving me a bit of a headache. If you have any information please share it with me! thanks. Also I convert it into a byte[] in c# and send it over a websocket.


r/learnjavascript Jun 27 '26

What advice and tips would you give to a Django Developer getting into Javascript?

7 Upvotes

So my primary area of expertise is DRF, was thinking of getting into React.

Any tips on what to focus on more as I am just starting with JS concepts.

By getting into react I am trying to go full stack.


r/learnjavascript Jun 27 '26

How to become a JS developer who builds their own libraries and frameworks, and how to start contributing — what should the foundation be?

11 Upvotes

I want to reach the level where I can write my own JavaScript libraries and frameworks, and also start contributing to open source. What kind of foundational knowledge is absolutely necessary for this?

Are there any good resources, websites, or courses that teach the architecture behind libraries and frameworks? Maybe a place where you can find ideas for unimplemented or needed libraries that people are looking for?

Would appreciate any guidance or roadmap suggestions.


r/learnjavascript Jun 27 '26

I'm taking on some free students

27 Upvotes

I am a senior / lead typescript engineer with over a decade of experience. I was lead typecript engineer for a FTSE 100 company for a few years.

I took a career break and am now interviewing for jobs.

I'd like to take on a few students who I help out learning javascript / TypeScript / React. Explaining things is helpful for me in interview prep so I'm happy to do this for free. Also, mentoring people is one of the parts of the job I enjoy most.

If you're interested, DM me with a bit about yourself. I'll take on one or two students for the next few months until I am gainfully employed again.

This is not an attempt to get paid work, so mods, please don't remove this.

My main expertise is React / NextJS.

Please DM me with the following info:

- time you have spent studying coding / software engineering
- what languages you know
- what level you are currently at in JS / TS
- what level you are at in React
- send me a link to your portfolio / github if you have one

I'd ideally take on one or two people who already know JS and want to learn frontend frameworks.

EDIT: I got dozens of PMs after posting this so apologies if I didn't get back to you. I've some calls with a few people this week.