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.
8,686
questions
1
vote
0answers
13 views
What's the proper way to do MongoDB aggregation query with optional parameters?
I have this api endpoint where i want to lookup a user or multiple users schedule and also specify the month or/and the day when doing the query. My code works, but i feel like there is a better, ...
1
vote
0answers
11 views
Cross domain fetch switching in prod vs dev
I'm beginning a redesign of the front end of my Flask app which currently generates Jinja2 template-based html pages. I am trying to develop a new front end in React, but I want the current front end ...
4
votes
1answer
93 views
Sorting an object by value w/ `sort` and `reduce`
Given an object with unsorted numeric values, such as:
const unsorted = {
green: 80,
blue: 90,
red: 30,
yellow: 100,
}
We want a data structure with the ...
2
votes
1answer
26 views
Using setInterval() to make data reactive
I have a video component passing data from an async GET request to a child component:
...
3
votes
1answer
40 views
In-memory database class
I built this basic in-memory database that can support some basic operations, like SET, GET, DELETE, COUNT, etc. As well as support transactions. Some of the constraints are as follows: GET, SET, ...
4
votes
1answer
37 views
A simple reactjs form to calculate the liquidity ratio, daily cost of running, and days cash on hand
This is just a very simple form that tells you the liquidity ratio, daily cost of running, and days cash on hand of a company, given their current assets, current liabilities, and total expense of the ...
0
votes
0answers
22 views
How to simplify code for custom CssSelectorBuilder object in js
I've developed task solution following learning program:
...
2
votes
3answers
112 views
Finding the sum of all numeric palindromes that are less than N
I wrote a function that finds the sum of all numeric palindromes lesser than N.
...
2
votes
0answers
21 views
Simple Pretty-Bytes Size (SI System)
This is a simple and short "Pretty Bytes" javascript function using the SI Decimal System for quantifying bytes.
The code does not use complex maths such as ...
3
votes
2answers
50 views
Replace nested property for an interview
During an interview I was given this interesting JavaScript task:
Given the code:
...
1
vote
2answers
52 views
JSX render method in react
Following is the piece of code which is working fine, but somehow it looks bit odd to me to have a function inside a render method and using it in both conditions. Let me know how can I improve this ...
1
vote
0answers
28 views
events countdown OOP app
I wrote a JavaScript app with allows the user to add events and get countdown for every event. Also the events and their dates are stored in localStorage.
I want a general review and I think that ...
-1
votes
0answers
41 views
Using Object.keys() in 'or' statement to determine key/value pair index
I need to check if the key of a key/value pair exists in the excel to json data I am reading. I will be reading multiple file and there is not an ability to have the data columns all renamed to match ...
-3
votes
1answer
64 views
Is there a means to combine the similar chunks of Vuejs code shown below? [closed]
I am currently working on a project and very recently came across Vuejs. I used it to create a dynamic form on my frontend, however, the approach I took does not seem right to me. Could someone take a ...
0
votes
1answer
31 views
TypeScript fetch wrapper class with localStorage cache
I'm learning TypeScript while doing my portfolio, and I wrote a class to make a fetch request to the API that holds my data.
It is working fine. I use localStorage to set a cache to avoid calling the ...