/r/javascript

Photograph via //r/javascript

Chat about javascript and javascript related projects. Yes, typescript counts. Please keep self promotion to a minimum/reasonable level.

All about the JavaScript programming language.

Subreddit Guidelines


Specifications:


Resources:


Related Subreddits:

r/LearnJavascript

r/node

r/typescript

r/reactjs

r/webdev

r/WebdevTutorials

r/frontend

r/webgl

r/threejs

r/jquery

r/remotejs

r/forhire


/r/javascript

2,400,187 Subscribers

0

[AskJS] Websocket issue with setInterval

I have completed a project which is basically an .io game written in JS it's multiplayer using Websocket. The issue I am facing is that when players connect a setInterval starts to update frontend simultaneously on all players. But the Interval never stops even after disconnection. The messages keep piling up slowing down the server.

5 Comments
2025/02/02
08:58 UTC

0

[AskJS] How would statically analyze an api call in js file?

I’m doing a technical project but I haven’t the slightest clue how to statically analyze an api call in a js file. I know you do it dynamically during runtime but how would I do it statically from click handler to api call to return of data. Help my professor demands for research topic!!!

4 Comments
2025/02/02
03:12 UTC

0

[AskJS] CRA or vite for new developer

Hi everyone,

I am a very green developer. I learned last year and at the time they had taught CRA (even though they knew they would need to start teaching vite next term, they just hadn't changed over).

I am wondering if you think it would be worth the effort for me to learn vite? I am doing a webapp for my partners business, it's really simple but I do want to get it up asap. Not sure if learning vite will take me a long time or how easy it is to you. At the same time, I want the webapp to run long term and worry with things becoming deprecated with CRA. And maybe it is a good opportunity to simply learn vite so I can continue with it.

Any input and thoughts help. Again my knowledge base is very beginner so please let me know your thoughts.

Much appreciated!

11 Comments
2025/02/01
18:40 UTC

0

Showoff Saturday (February 01, 2025)

Did you find or create something cool this week in javascript?

Show us here!

0 Comments
2025/02/01
08:01 UTC

0

[AskJS] What's the state of the art approach in user fingerprinting without a paid API call?

[This post refers to JS in the browser, as in a React app]

Basically, we want to check if people are being truthful about how many devices they are using our service on. It's B2B and sold per-seat, so we don't want any kind of captchas or autobans -- just want to know if a client is breaking their service agreement by sharing logins, etc.

Obviously my initial thought was to use IP/User Agent combo, but surely there's a better way to do this in 2025 without a lot of lift?

8 Comments
2025/01/29
20:12 UTC

2

WTF Wednesday (January 29, 2025)

Post a link to a GitHub repo or another code chunk that you would like to have reviewed, and brace yourself for the comments!

Whether you're a junior wanting your code sharpened or a senior interested in giving some feedback and have some time to spare to review someone's code, here's where it's happening.

Named after this comic

1 Comment
2025/01/29
08:00 UTC

6

[AskJS] Building a 100% Free Coding Platform with 2D Game Dev Tutorials – What Features Do You Want?

Hey r/webdev, r/learnjavascript, and r/gamedev! 👋

I’m working on a free coding platform (imagine Codecademy meets freeCodeCamp) with a premium design, mixing 2D game development in JavaScript to make learning interactive and fun. The goal? To create an engaging, accessible resource with zero paywalls.

What’s the plan?

  • Free interactive courses: HTML/CSS, JavaScript, Python, and more.
  • Modern UI: Dark/light mode, code playgrounds, and shareable certificates.
  • Community-driven: Forums, collaborative projects, and peer feedback.

But I need YOUR help to make this better!

  1. What features would make this your go-to platform for learning?
  2. What pain points in existing platforms should we fix? (e.g., outdated content, lack of hands-on projects, poor community support)
4 Comments
2025/01/29
01:23 UTC

0

[AskJS] Indentation: 2 or 4 spaces? What’s the real industry standard in 2025?

What’s actually being used in your production codebases right now? Let’s break it down:

  • JS/TS
  • CSS/SCSS
  • JSX/HTML and other markup

Are you cool with switching between different formats (in terms of spacing) or does it drive you crazy?

30 Comments
2025/01/28
11:03 UTC

0

[AskJS] As far as job market goes, is Python or Javascript/Full stack more in demand?

Any opinions are appreciated.

27 Comments
2025/01/27
18:39 UTC

2

Your /r/javascript recap for the week of January 20 - January 26, 2025

Monday, January 20 - Sunday, January 26, 2025

###Top Posts

scorecommentstitle & link
4955 commentsThings people get wrong about Electron
344 commentsA WebAssembly compiler that fits in a tweet
2152 commentsFramework Fatigue: The Real Reason Developers Get Angry About New Tech
176 commentsThe Little I Know About Monads
177 commentsSliders & ranges | first release | testing
110 commentsWhat we Learned from Scaling Websockets for our React App
110 commentsBuild your first WebAssembly project
114 commentsWe launched free online frontend meetups
911 commentsValidating React forms easily without third-party libraries
87 commentsAsync Iterator over an `IDBDatabase`

 

###Most Commented Posts

scorecommentstitle & link
031 comments[AskJS] [AskJS] Which OOP style to use in current-gen JS?
024 comments[AskJS] [AskJS] Hello devs!. I need your guidance, JavaScript or Java?
012 comments[AskJS] [AskJS] How can I avoid unnecessary async overhead with async callbacks
06 comments[AskJS] [AskJS] What are you top choices for third-party libs/components?
05 commentsMy attempt to convert a module from SQLite3 to MySQL. Not quite there..

 

###Top Ask JS

scorecommentstitle & link
22 comments[AskJS] [AskJS] Fullstack app structure
12 comments[AskJS] [AskJS] Chrome Extension Development: Managing Cross-Script Communication for AI Integration
01 comments[AskJS] [AskJS] Morphing Animation in JS like in Powerpoint

 

###Top Showoffs

scorecomment
1/u/KooiInc said Although it seems JS 'temporal' is finally making its entry, here's [a Date helper](https://github.com/KooiInc/ticktock) I'm working on, called TickTock. It's work in progress.
1/u/ByteOnIceNYC said [Free localization key generator in Figma](http://figma.gleef.eu) to simplify localization by automating key management directly within product design.

 

###Top Comments

scorecomment
56/u/PatattMan said > One hour of Netflix at 4K is roughly 7 GB, a typical Call of Duty update regularly clocks in more than 300 GB. In practice, we have not seen end users care about binary size more than they do about ...
50/u/vherus said If you want to do OOP, just use classes. Who cares that it’s syntactic sugar? They put classes in to be used 🤷‍♂️ I don’t use OOP much at all these days but I don’t see the problem with any approach ...
45/u/Sshorty4 said The problem for me was not learning new libraries or frameworks but complete mindset shift with every framework, “we do OOP now, now we do declarative, now we do reactive, now we do functional, now we...
28/u/DavidJCobb said The points this article has chosen to counter are: * Electron pits JavaScript code against native code. Counterargued by saying that Electron, a thing marketed entirely off of its accessibility t...
27/u/Mearkat_ said Think for me it's mostly the RAM usage rather than the amount of storage space it takes up

 

1 Comment
2025/01/27
10:07 UTC

8

[AskJS] Fullstack app structure

I'm starting a new project that requires a frontend, backend, and some shared code.

I'm currently thinking of: using Next for the frontend, Express for the backend, and using npm shared modules to share code between them.

Is this a reasonable approach? Or is it worth going all-in on a single framework for both frontend and backend.

6 Comments
2025/01/26
20:18 UTC

1

[AskJS] Chrome Extension Development: Managing Cross-Script Communication for AI Integration

I'm implementing a Chrome extension that handles communication between content scripts and background scripts, focusing on monitoring and managing state across different contexts. The core implementation involves maintaining reliable message passing channels while handling asynchronous communication flows.

I've encountered several architectural challenges around maintaining consistent state and reliable message delivery between scripts. I'm particularly interested in learning about proven patterns and approaches for:

  1. Efficient message passing between content and background scripts
  2. State synchronization across different execution contexts
  3. Handling asynchronous communication reliably

Would appreciate insights from developers who have experience with similar Chrome extension architectures or comparable JavaScript implementations. What patterns or approaches have you found most effective for managing cross-script communication in extensions?

2 Comments
2025/01/26
06:49 UTC

Back To Top