Skip to main content

All Questions

3 votes
1 answer
91 views

Merge discrete integer intervals

What it does The code starts with a set of integer intervals, and can add new intervals (possibly by updating existing intervals). Essentially, it is a bit array whose index starts at ...
FromTheStackAndBack's user avatar
1 vote
3 answers
2k views

Math calculation JavaScript. Am I using Objects correctly? Can I use methods / functions to shorten my code further? Also error logging?

Context- CRM system, front-end form. Requirement- Within a form users have to give a rating to a section based on user inputs, each rating has different weighting. The rating is stored in an option ...
BenDev21's user avatar
2 votes
2 answers
198 views

First app with JS in OOP

I've already started to creating apps in JS with OOP. I made simple TicTacToe Game in OOP and I want to ask you to review my code and point out everything that I can change about OOP. What is bad ...
Szymon Mińko's user avatar
1 vote
1 answer
143 views

Rock, paper, scissors game in expressjs typescript

This is a simple 2 player game made in NodeJS and the ExpressJS framework with typescript. I've built using OOP approach to as far of an extent as I know of it. I'm really curious as to how further ...
Exodus Reed's user avatar
1 vote
1 answer
140 views

Transform an array into object and set index for an unique key in javascript

I have a method that merges keys and indexes from an array into an object. I'm stuck with ways to compress this method, and I don't know what I can do to make it simpler. Goal get an array of objects ...
wittgenstein's user avatar
1 vote
1 answer
201 views

Terminal War Game

First I would like to thank everyone for whatever help you may offer me. In full disclosure this is a project for a bootcamp class I have. My problem is, and I've asked them about this, that they aren'...
Infinite Grasp's user avatar
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
4 votes
1 answer
187 views

GUI tower defense: path and enemies

Working on creating new tower defense in JS. May be port to React. How to improve? Only made enemies and path so far. In below demo, path is white background and enemy is red circles and green squares....
lizduadac's user avatar
  • 111
2 votes
1 answer
173 views

Creating object in JS that is passed into IHttpHandler

I am working on a web page where I am creating a JS object using {} and []. This object is passed into a handler I wanted to ...
Jefferson's user avatar
  • 403
2 votes
2 answers
319 views

Tic-Tac-Toe vanilla JS Pseudo OOP

I'm working on building a simple game in vanilla JS (tic-tac-toe). Some weeks ago I created a functional MVP and asked some questions about it (Vanilla JS Tic-Tac-Toe). The code worked, but it was a ...
nabla-f's user avatar
  • 173
0 votes
1 answer
43 views

Is there any way to make my JavaScript code more logical and efficient? How to convert functional to OOP in JS? [closed]

I created some tooltips using javascript but after writing the code I found it a lot more complicated and hard to read/understand is there any way to shortened my ...
Kunal Tanwar's user avatar
1 vote
1 answer
418 views

Best way to cherry pick objects from array of objects

With this data I am returning one object per keyword prioritising preferedDomain string on domain and then its higher ...
Álvaro's user avatar
  • 177
2 votes
2 answers
125 views

Complex Filter in one Opration

I am working on a Data-based application. I wrote a code to filter the table. The table has String and Numbers. I some filter ...
Rohit Nishad's user avatar
1 vote
1 answer
287 views

Managing duplicate class instances in a javascript Set

I have a class called Thing. For simplicity, let's say it initializes with a unique id, and that's all that's unique about it: ...
Seth Lutske's user avatar
2 votes
1 answer
341 views

JavaScript copy-to-clipboard class

I am have made a small copy-to-clipboard script. I have made a method called copyToClipboard that does the following: create an input box; read the content of an ...
Razvan Zamfir's user avatar

15 30 50 per page
1
2 3 4 5
27