Skip to main content
The 2025 Developer Survey results are in. Explore insights into technology and tools, careers, community and more. View results.

All Questions

Filter by
Sorted by
Tagged with
3 votes
1 answer
77 views

I made a webpage that simulates sharks eating fish in the torrid world of Wa-tor

I've been self-studying HTML/CSS/JS. I read about Wa-tor. It's a population dynamics simulation which simulates fish and sharks breeding and predating. This seemed cool so I decided to implement it....
Jeff's user avatar
  • 33
2 votes
0 answers
165 views

How do I create an "Environment Variable Setter"?

I have a NodeJS/Typescript project. In server.js, I want to set my environment variables from a .env file. To achieve this, I am ...
ptk's user avatar
  • 121
0 votes
1 answer
61 views

Avoiding verbose compositional class design

I've written some code which features Eric Elliot's javascript factory function mixin composition (https://medium.com/javascript-scene/javascript-factory-functions-with-es6-4d224591a8b1), but since ...
Li Brary's user avatar
4 votes
2 answers
381 views

web scraper for emails and links

I created a class to scrape URLS, parse and validate emails and get internal links. How can I achieve the SOLID principles in this class written in Javascript to make a web scraper? ...
biel sala's user avatar
2 votes
1 answer
133 views

Tile and grid abstraction

This question is a small subset of the problem I am trying to solve. I am trying to learn to break problems into better abstractions. The original problem I am trying to solve is: Write a JS ...
CodeYogi's user avatar
  • 5,177
2 votes
0 answers
47 views

Method for creating and traversing a BST while also getting its depth and width

This is a class for creating and traversing a BST while also getting its depth and width. I feel like this can be factored down into something more elegant and shorter I also feel like the overall ...
Rick's user avatar
  • 586
1 vote
1 answer
2k views

Splitwise clone done right

I have started this project basically for learning perspective and wanted to learn good object oriented design. What I am trying to do is making clone of something like this but this is a command line ...
CodeYogi's user avatar
  • 5,177
2 votes
1 answer
151 views

Modelling an account manager in OOP

I have this task of modelling a system where given a group of users each can keep track of their expenses. The basic requirements are as followed: To be able to give credit to an user. Find all the ...
CodeYogi's user avatar
  • 5,177
1 vote
1 answer
614 views

Using decorator pattern to validate an entity

I am following this article. ...
CodeYogi's user avatar
  • 5,177
1 vote
1 answer
78 views

JavaScript class for a GameRoom

I am new to object oriented design with JavaScript and am trying to make a PublicGame class with some methods that puts itself in a map of games. It calls ...
Daniel Jacobson's user avatar
1 vote
2 answers
168 views

From scratch pub sub definition and implementation

I am finished with my implementation of PUB/SUB or Observer pattern, however I just want to see any ways that I may be able to improve this pattern. I wanted to be able to use the typical ...
NicholasAbrams's user avatar
1 vote
2 answers
232 views

Separate Ajax code in separate modules

This is the first time I am working on OOJS code and I am a beginner in JS. I think I have pretty much messed it up. I am planning to modularize my code, but with the inclusion of ...
Thomas Sebastian's user avatar
1 vote
1 answer
2k views

MVC + Events in JavaScript

I'm a bit lost with implementing MCV pattern on javascript. Where should events (such as 'click','change') come in on MVC in javascript? I have this event function, ...
Run's user avatar
  • 183
2 votes
1 answer
942 views

Markov text generator

This is a Markov text generator I've created in JavaScript. I'm pretty sure the term "Markov" applies, anyway. The way the generator works is like this: it first divides the source text into unique "...
vvye's user avatar
  • 699
3 votes
1 answer
129 views

Functional organisation of JavaScript functions

In one of the web apps I contribute to, the main.js file has multiple interacting "objects". Unfortunately, I'm so bad at OOP in JavaScript, despite studying other ...
Seanny123's user avatar
  • 1,599

15 30 50 per page