r/learnjavascript 12h ago

Looking for a Study Partner – React, TypeScript, Node.js & React Native

Upvotes

I’m looking for a study partner who wants to learn and revise JavaScript, React, TypeScript, Node.js, and React Native from the basics to an interview-ready level.

What I’m Looking For

- Start from the basics and gradually move to advanced topics.

- Cover everything needed for technical interviews.

- Practice coding, concepts, interview questions, and projects together.

- Stay consistent and keep each other motivated.

About Me

I already know some of JavaScript, React, TypeScript, Node.js, and React Native, but I’ve forgotten quite a lot of the basics. I want to start from the beginning, revise everything properly, and build my knowledge again from start to end.

I have already started studying and I’m eager to continue. I’m mainly looking for someone who is also serious about learning and can study together consistently.

Time Zone

I’m in IST (Indian Standard Time), but I don’t have a fixed time limit.

If you’re interested, DM me your time zone and the time you’re usually available, and let me know when you can start.

Looking for someone who is genuinely interested in learning together rather than just joining for a few days.

Dicord ChatGrp


r/learnjavascript 21h ago

Is JavaScript: The Definitive Guide still relevant?

Upvotes

Or has JavaScript changed so much since then that some information in it might be false?


r/learnjavascript 18h ago

Day 8 — Adding Power-Ups to My Browser Game

Upvotes

Day 8 of my browser game development journey.

Today I worked on adding power-ups to my JavaScript game.

I'm experimenting with:

• Temporary speed boosts

• Extra points

• Health recovery

• Random power-up spawning

• Collecting and removing items

• Mobile-friendly controls

I'm trying to understand the logic behind these mechanics instead of just copying a tutorial.

What other power-up would you add to the game?


r/learnjavascript 1d ago

JavaScript visual debugger for practicing DSA and LeetCode with your own code?

Upvotes

Most websites I found either only let you choose from a limited number of fixed implementations of the same algorithms, or require you to learn their own mini-framework to visualize your code.

So I made a visual debugger, inspired by another one called Python Tutor.

It uses a forked version of a JS interpreter called sval to keep track of variables, the call stack, and all the other information needed to visualize and debug your code.

It only supports JavaScript, but it has genuinely helped me solve a few pesky LeetCode problems caused by silly bugs.

I’ll make it open source as soon as I can tidy up the codebase and solve a few dependency issues.


r/learnjavascript 1d ago

How should I handle optional parameters with database defaults?

Upvotes

I'm writing a service function for a personal project

Right now I have something like

export async function createApplicationService(
  userId,
  companyName,
  role,
  appliedDate,
  status,
  salary,
  link,
  nextAction
)

The only fields that I really want to require are companyName and salary The other fields have default values defined in my database, so I don't want the user to have to explicitly pass them every time.

What's the best way to structure this so that I only insert the parameters that were actually provided, while letting the database handle the defaults for everything elseI'm writing a service function for a personal project where I'm creating an application tracking system.
Right now, I have something like:
export async function createApplicationService(
userId,
companyName,
role,
appliedDate,
status,
salary,
link,
nextAction
)

The only fields that I really want to require are companyName and salary. The other fields have default values defined in my database, so I don't want the user to have to explicitly pass them every time.
What's the best way to structure this so that I only insert the parameters that were actually provided, while letting the database handle the defaults for everything else


r/learnjavascript 2d ago

New to js, not sure why script did not work

Upvotes

Hi!

I am attempting to follow the introductory

example for D3 JS:

https://d3js.org/getting-started

I am trying to do it

locally so it is the version

on that page,

'D3 in vanilla HTML' section

'UMD + local' code tab

I am new to JS but not new to programming.

I think the offered code example is

incomplete so I added html, head,

title, 2 meta, and body tags.

I changed d3.js to d3.v7.js

in the script src because the download

is actually for that file name.

I also add Hello world text to the body.

When I try to load it, I only see Hello

world.

I think its supposed to also draw that

graphic as you can see in the reference.

If anyone can point out to me what is wrong,

I appreciate it. Thank you.

<!DOCTYPE html>

<html>

<head>

<title>D3 intro example</title>

<meta charset="utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1">

</head>

<body>

Hello world.

<div id="container"></div>

<script src="d3.v7.js"></script>

<script type="module">

// Declare the chart dimensions and margins.

const width = 640;

const height = 400;

const marginTop = 20;

const marginRight = 20;

const marginBottom = 30;

const marginLeft = 40;

// Declare the x (horizontal position) scale.

const x = d3.scaleUtc()

.domain([new Date("2023-01-01"), new Date("2024-01-01")])

.range([marginLeft, width - marginRight]);

// Declare the y (vertical position) scale.

const y = d3.scaleLinear()

.domain([0, 100])

.range([height - marginBottom, marginTop]);

// Create the SVG container.

const svg = d3.create("svg")

.attr("width", width)

.attr("height", height);

// Add the x-axis.

svg.append("g")

.attr("transform", `translate(0,${height - marginBottom})`)

.call(d3.axisBottom(x));

// Add the y-axis.

svg.append("g")

.attr("transform", `translate(${marginLeft},0)`)

.call(d3.axisLeft(y));

// Append the SVG element.

container.append(svg.node());

</script>

</body>

</html>


r/learnjavascript 1d ago

Why does AI keep “fixing” my JavaScript until it’s unrecognizable from the code I started with?

Upvotes

I have noticed something really interesting while using AI to debug my JS code. For instance, I will give it some code. Then AI modifies it. I find another issue. Then I ask AI to fix it. AI modifies something else. Then I bring the 'previous AI-modified version' back and somehow we end up in an endless loop of AI correcting AI, it's crazy ik.

The weirdest part is that most times the original code was closer to what I actually needed. And honestly, this has made me realize sometimes the biggest challenge isn't getting AI to write code but it's getting it to change ONLY what you actually asked it to change. At what point does AI-assisted coding stop being debugging and start becoming more than code roulette?

Has anyone else experienced this? How do you prevent AI from unnecessarily rewriting working parts of your code?


r/learnjavascript 2d ago

Why does JavaScript suddenly feel 10× harder when you stop following tutorials?

Upvotes

I can understand the basics, follow a tutorial, and even solve small exercises but when I open a blank VS Code window and try to build something myself, my brain goes: '404 - knowledge not found.” 😂

Is this actually normal or am I just glitching at this point? 😭

What was the one thing that finally made JavaScript click for you ; building projects, debugging your own mistakes, reading other people’s code, or something else? I’m curious what actually worked for you guys who went from 'I’m following tutorials' to 'I can confidently build this myself.'


r/learnjavascript 2d ago

I am in a loop of learning js

Upvotes

so basically i am learning web dev from past 3 year but i completed html css but i start js and then in few days i get exams i quit for a week or 2 , then again i start it from the start i am the loop from past 3 years 😭. Any one plz help me out before i used to do it using youtube tutorials but now i am using gpt to explain me each and everything and now it questions i solve those but idk what to do i am stuck. if any one can help out. If any one was in the same loop help how u got out of it


r/learnjavascript 3d ago

3 engineers spent 40 minutes on my code and none of it was praise

Upvotes

My code worked. That was the only good thing anyone said about it. Nested conditionals 4 deep, no error handling, everything in one function. I have been writing javascript for a year and nobody had ever looked at it before. Self taught through Boot.dev and DataCamp, and nobody had read a line of my code before that call. How did you learn the part that is not making it run.


r/learnjavascript 2d ago

Is it common for a function to return another function and call it inside a callback?

Upvotes
const stop = useIntersectionObserver(
    ref,
    ([entry]) => {
      if (entry.isIntersecting) {
        setLoaded(true);
        stop(); // one-shot: stop observing once we've committed to loading
      }
    },
    { rootMargin: '200px' }, // start loading 200px before it scrolls in
  );

In the snippet, I noticed that useIntersectionObserver returns a function, which is assigned to the variable stop, and that returned function is then called inside the callback passed to useIntersectionObserver.

Actually, I'm not asking about useIntersectionObserver itself. I just want to ask about the pattern:

Function A returns Function B, and then Function B is called inside Function A's callback.

I've never written a function with that kind of structure before.

How often do you write functions like this?


r/learnjavascript 3d ago

10 React.js Questions that you definitely should practice before your live-coding interviews.

Upvotes

If you have a React interview coming up, then this might be of some help to you!

Here are 10 problem lists that you can consider practicing to brush up your react.js concepts before your machine coding round.

1. Counter with increment, decrement, and reset. (Might be the ice-breaker for freshers but rarely asked for experienced role)

Feels too easy to be a real question. But a fast-click test on the increment button often catches people using the wrong kind of state update.

Practice counter here

2. Build your own debounce hook. (Definitely Practice this one)

It must wait until the value stops changing for a bit, cancel any pending timer if the component unmounts, and handle the delay itself changing partway through.

Debouncing Practice

3. Return the value from one render ago.

Sounds simple. What people miss: it must return undefined on the first render, and it can't cause an extra re-render by itself.

Practice Hook

4. Shopping cart with useReducer. (Please do practice useReducer hook, I was asked to build a form entirely using useReducer + will also be useful when you deal with Redux)

Add, change quantity, remove, clear — four actions through one reducer. Good test of whether you use useReducer or just keep adding more useState.

Build Shopping cart

(Frontend Mentor has a plain HTML/CSS/JS version if you want to compare)

Build Shopping cart from frontend mentor

5. Traffic light that cycles on its own. (Great for clearing the concept of clearing intervals and timeouts)

The layout is already built — you just write the timing. It usually breaks on cleanup: clearing the interval when the component unmounts or re-renders.

Manage traffic light problem

6. Search box where slow responses can't overwrite fast ones.

A classic race condition. If a request fires on every keystroke, an old slow response can arrive after a newer one and overwrite it with stale data.

Solve this

7. Nested comment thread, replies inside replies. (If you want to move to advance concepts)

Needs a component that renders itself for each nested reply, plus a function that can find and update one comment anywhere in the tree without mutating it.

Build nested comment in react

8. Stop a list from re-rendering rows that didn't change. (Must practice, you'll definitely be asked about optimization in react, do go through the concept of useCallback)

Right now, an unrelated counter on the page makes every row re-render. Fix it with React.memo — it has to actually stop the re-renders, not just look fine.

Practice Memoization in react

9. Keep a callback's identity stable across renders.

Three counters currently all re-render on any single click, because their click handlers get recreated every render. Needs useCallback plus the functional setState form — using only one of the two still fails.

Practice useCallback

10. Multi-step signup form with useReducer.

Account info → profile → review. Each step is validated before you can hit Next, and going back can't lose what you already typed.

Form validation using useReducer

(Frontend Mentor has a version of this same idea, no React needed: Multi step form)

Curious what else people have been asked in these rounds — feels like everyone gets a slightly different mix of the same problems.

Please let me know in the comments your thoughts and do share what according to you are some must go through concepts before any react interview, I'm preparing a notion docs on the list of react interview questions, so will add it there so that it can be useful for everyone.


r/learnjavascript 3d ago

Place for new javascript learners myself?

Upvotes

Everyone, I greet.

Rare-Trees-5280, I am.

First post, this is.

New to javascript and learning it, I am.

If people knew where there are online forums and communities where new learners can ask questions, I am wondering.

For your consideration, I thank in advance.


r/learnjavascript 4d ago

How to learn fast web development without time waste

Upvotes

I am a self-learner who has primarily learned web development through YouTube. So far, I have studied HTML, CSS, JavaScript, PHP, Git, and GitHub, and I have also built several mini projects. However, despite learning these technologies, I still struggle to create even simple projects on my own without following tutorials.

Looking back, I feel that I did not use my time effectively. I spent nearly five years trying to learn HTML, CSS, and JavaScript, but I was not consistently focused, which prevented me from developing a strong understanding of these technologies. Because of this, I often feel regret about the time I lost.

Now, I want to make serious progress over the next few months. My goal is to reach a level where I can build projects independently, strengthen my problem-solving skills, and become qualified for a web development internship or an entry-level job. I would appreciate a clear and practical roadmap that can help me become internship-ready as quickly as possible.


r/learnjavascript 4d ago

In flight is not an in memory cache

Upvotes

This week I made an npm package (Inflight) to solve the concurrent repetitive queries to database or cache

Reached +500 weekly downloads

The idea is to cache the Promise of a db query (Not the response of the query).

So in a high concurrency system, where the same data (like: cr7 or messi profile) is requested by many users at the same time, only one query goes to cache or database.

some interesting benchmarks:

  • Duration: 30s
  • Cache TTL: 5s
  • Concurrency: 100
  • Unique keys: 10
Metric With Inflight Without Inflight
Query Per Second ~1,130,360 ~174,950
Total queries 33,911,000 5,248,600
DB calls 60 517
Cache calls 3,391,021 5,248,600

**Insights:*\*

  • DB calls saved: **56x*\*
  • Cache calls saved: **10x*\*
  • Total queries growth: **6.5x*\* (5.2M → 33.9M)

more benchmarks here: https://github.com/ademmenh/inflight/tree/main/benchmarks

npm package: https://www.npmjs.com/package/@inflightjs/inflight

github repo: https://github.com/ademmenh/inflight (PRs, issues, starts)


r/learnjavascript 4d ago

🏃 Day 7: I Built a Mobile Runner Game with HTML, CSS & JavaScript

Upvotes

Day 7 of my browser game development journey! 🚀

Today I built a simple mobile-friendly Runner game using HTML, CSS and JavaScript.

I'm practicing:

• 🏃 Player movement

• ⬆️ Jump mechanics

• 🚧 Obstacle spawning

• 💥 Collision detection

• 🏆 Score system

• 📱 Touch controls

• ⚡ Increasing difficulty

7 days of building small browser games has helped me understand JavaScript much better.

What should I build next?

1️⃣ Car Racing

2️⃣ Platformer

3️⃣ Ludo

4️⃣ Boss Battle

5️⃣ Something completely new

Drop your choice below! 👇

🎮 Game: [YOUR GAME LINK]

💻 Source code: [YOUR GITHUB LINK]


r/learnjavascript 4d ago

Job Search get Interview Call

Upvotes

Passed Two week Iam applying for many job but nothing happen

Can anybody Just Tell me How to apply In a Day is there is any particular Time to apply or we need to Daily Update our Profile or How I will get a call can u just Tell me the steps U follow for your Interview process 

For My first job Im go with referal so I dont know how to get an Interview Call

And how to search In Nakuri It show only less number of jobs for mern stack developer so can u tell me how can i search

Because I dont have job switch experience So I dont know how to get a call. so Can you tell me how you switch experience It will usefull for me to get a job 


r/learnjavascript 4d ago

Is there are way to modify canvas methods?

Upvotes

I want to invert the y-axis, and make it invisble to the user so I can forget about it, rather than always call my method.

I could make a facade object and duplicating all the methods and passing them through, but tedious!

I tried a Proxy object, but didn't work at all - is it because it is native?

I tried monkeypatching, renaming moveTo() and lineTo(P, and replacing them with mine (which inverts the y-axis then calls them), but got strange results: lines shifted to right.

Maybe I just shouldn't do what I'm trying to do?

UPDATE canvas already has a way to do this: https://stackoverflow.com/questions/4335400/in-html5-canvas-can-i-make-the-y-axis-go-up-rather-than-down/33499668#33499668

context.transform(1, 0, 0, -1, 0, canvas.height)

BTW I did google a lot before asking, but I searched how to implement my solution, not the problem. After asking here, I googled the text of this post, and found several answers. It's common because math and graphics have opposite y-axis conventions.


r/learnjavascript 5d ago

What is an instance (like in a library)

Upvotes

Like I use libraries and hear about X instance Y instace for example

Axios Instance, Lexicals editor instance, I can only think of 2 examples right now but you get the idea.


r/learnjavascript 5d ago

Any good coding Games?

Upvotes

Hey, im learning Javascript right now and im curious If anyone knows a good coding Game(preferably on Steam) or a Website to learn Javascript in a playfull or interesting Manner. Thaanks :)


r/learnjavascript 5d ago

Learning JavaScript, advice?

Upvotes

I joined this sub a few days ago, after stumbling across lovable, and prompted a couple of rougelike games, learned that it was all in typescript, (I know I am a ways away) and have been having a lot of fun this week, spending multiple hours a day, learning the basics. I’ve tried a few times over the years with Objective-C and python, but could never figure things out, but this time I feel like I’m in the right headspace and really making sure I understand. I’m using VS code, and a Coursera corse, I’ve also bookmarked the Odin project.
Anyone have best practices or advice? I plan to use JS to help with an IT job and build games or apps for fun. Thanks for reading!


r/learnjavascript 5d ago

Looking for some advise

Upvotes

Hi, hope you're doing well. I'm here looking for some advice from the community. I want to get into backend dev in Javascript, I start reading Javascript crash course by nick morgan, but I think the book was maybe to easy, so I start reading eloquent Javascript, and I am looking for a good node.js book to start study with while I am reinforcing my JS knowledge.

I have been seaching for a while but many books are too old or too advance for me, any good recomendation?

Btw, I think to take the MDN front-end developer course, although my main goal is backend. Thank you for your time.

P.D.

English is my my first language, so I'm sorry if this is a grammatical mess.


r/learnjavascript 5d ago

I'm learning JavaScript event Lister Why i feel Hard and whenever I start learning That feels dificult to me

Upvotes

Please someone suggest me to learn effectively and how can I understand that concept ?


r/learnjavascript 5d ago

I've become a big fan of splice

Upvotes

As part of my project to write notes of what I learn practicing contemporary browser JavaScript by creating webapp games, I've written some notes and examples on Array Literals.

This was inspired by creating a "hardware-agnostic, framework-free" webapp solitaire card game, Loot the Loop (a game designed by Wil Su, part of what's made this project fun is that besides learning contemporary JavaScript, I've discovered lots about contemporary solitaire card game design).

TL:DR — In the past I've tended to use shift, unshift, pop, push... which are ok, but concat is an antipatern. Just learning splice does all the above while making arrays much simpler.


r/learnjavascript 6d ago

🧠 Day 6: I Built a Memory Match Game with HTML, CSS & JavaScript

Upvotes

Day 6 of my browser game development journey! 🚀

Today I built a Memory Match game using HTML, CSS and JavaScript.

I'm practicing:

• 🃏 Card flipping

• 🧠 Matching logic

• ⏱️ Move/timer system

• 🏆 Score tracking

• ✨ Animations

• 📱 Mobile-friendly controls

Each game is helping me understand JavaScript and browser game development better.

What should I add next?

1️⃣ Difficulty levels

2️⃣ Timer challenge

3️⃣ More card themes

4️⃣ Leaderboard

Drop your choice below! 👇

🎮 Game: \[YOUR GAME LINK\]

💻 Source code: \[YOUR GITHUB LINK\]