Questions tagged [javascript]

JavaScript is primarily a language focused on web development. Being a monopoly on the front end and having Node on the back end. Use this tag for questions regarding vanilla JavaScript; optionally tagged with an ECMAScript version. If you are using a preprocessor such as TypeScript please tag with that too.

Filter by
Sorted by
Tagged with
-1
votes
0answers
18 views

How to combine two entry points?

There is a two ways to activate editing mode: add, edit. I made two separated functions. ...
0
votes
1answer
35 views

Bin-packing-problem - is there a way to do it better?

I have finished our first version of bin-packing-problem script, but would like to ask you, if there's a better way to organize boxes? Boxes should be organized to save as much space as possible, to ...
2
votes
0answers
30 views

Right structure, three-layered architecture webdevelopment

My question is have i gotten the three-layered architecture right with error handling etc. I have a webpage containing different resources. The code works but I am not sure if have structured it ...
1
vote
1answer
53 views

Generating a performance report for clans in Clash Royale

The following code generates a report showing performance of clan members in a game called Clash Royale. Everything is pretty self-explanatory, we are working with a lot of https requests, arrays and ...
1
vote
1answer
57 views

Dijkstra's algorithm is slow. (For loops)

I tried to add Dijkstra's algorithm to a js game. First when I got it working it was very very Laggy (5-10 fps) and the browser would crash.. After adding a lot more improvements I got it to like 50-...
2
votes
1answer
37 views

File uploads with image previews and remove link using Array and readAsDataURL

I got my code working with vanilla JavaScript, however I'm new to JS, so I don't know if the code is robust or not. Any advice to improve the code is welcome. Note: I just noticed a bug. The code ...
0
votes
0answers
53 views

Build a NPC Character with random values for name, money, and a Shopping List

This class creator for a simple text game is used to create a Random Name, and Random amount of money, and a random list of items used for shopping. In the console it would result as ...
-1
votes
0answers
23 views

Need input on naming convention for variables, function and components for a mini React/Typescript App [closed]

I always got this feedback to improve upon the naming convention for variables and functions/components. A few days back I have submitted the coding challenge for an interview and I didn't make it to ...
2
votes
1answer
60 views

Javascript speed of an animated object (planet orbiting sun)

So I am pretty new to JavaScript and I thought I might make an animation demonstrating a planet orbiting a sun in an elliptical orbit using Kepler's laws. I am struggling to get the speed right. So I ...
0
votes
0answers
20 views

Mapping values. Should a single use variable be declared as a variable at all?

Where I have, let us say an object, that I will only use once, what is considered general best practice in terms of declaring it as var vs. simply putting the object directly into the method it will ...
1
vote
1answer
56 views

Group by lastName and variable firstName

I'm trying to solve a problem of how to group name objects. A name has firstName and lastName properties. Need to group the name objects that have identical lastnames and a similar firstName(aka Tom ...
1
vote
1answer
28 views

Query messages and 'bold' part of a message. Show one query at a time but get the next query in advance for better user experience

In this react component I'm trying to display one message on the screen at a time. This message has a 'bold' substring in it which should be accounted for. There's 2 endpoints here, ...
0
votes
1answer
16 views

Check Three Dom Elements to See if they are empty or not and return detailed result

I am checking three elements on the DOM to see if they are empty or not so that I can run only the Ajax calls that I should run and save on overall bandwidth. The code works but it "smells bad&...
-1
votes
1answer
68 views

Recursive Palindrome in JavaScript

Would someone review this code, and confirm that it is indeed recursive? I'm learning computer science and going through different types of algorithms. Right now, I'm focusing on recursion want to ...
0
votes
0answers
23 views

Rock Paper Scissors Game in JavaScript

My latest project is a Rock Paper Scissors Game that I made in The Odin Project course. It's a web version, made with HTML, CSS and JS. I would appreciate to read your opninions, especially with ...

15 30 50 per page
1
2 3 4 5
613