All Questions
Tagged with javascript functional-programming
278 questions
2
votes
2
answers
97
views
State management patterns in vanilla JavaScript
I am trying to manage state in vanilla JavaScript—without using frameworks like React or Vue. I am also not using state management libraries.
My requirements are:
Reactivity
Time Travel (Undo/Redo)
...
3
votes
1
answer
414
views
Event sourcing javascript implementation
An event source built around an observer design pattern implementation…
...
1
vote
1
answer
72
views
Buffered source of HTMLElement(s)
Temporary storing the element(s) returned by document.querySelector and document.querySelectorAll methods could improve ...
1
vote
1
answer
87
views
Sprinkler effect
Developed around visibility CSS property and HTMLElement#offsetHeight and ...
4
votes
3
answers
242
views
Get the contents of a table cell for all selected rows
I have a table of user info. When you click the button, I want to get the email address from each selected row, output into a comma-separated string.
I got it to work with the following code, but I'm ...
2
votes
1
answer
110
views
Move timestamp to the next Monday 10:01 AM [closed]
I've been battling ChatGPT for hours now and can't get satisfied with this simple algorithm in TypeScript. These two (hopefully correct) TypeScript+ReactNative solutions should move the timestamp ...
5
votes
1
answer
141
views
Partial Function Application in JavaScript
I'm trying to make a partial function from any function.
Here is a working example:
...
1
vote
1
answer
61
views
Click temporization on user interface elements
Implementation to accommodate different behaviours based on the frequency a user interface element is clicked. It supports number of clicks and number of clicks in a time frame.
...
3
votes
1
answer
135
views
4
votes
2
answers
200
views
Abundant number implementation
I have implementted a simple JavaScript function to find the list of abundant numbers and print them on the screen.
an abundant number is a number for which the sum of its proper divisors is greater ...
1
vote
1
answer
147
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 ...
1
vote
2
answers
214
views
Simplify a function which performs manipulation of data in Javascript
Upon suggestion in the original question within Stack Overflow, I'm bringing my question here.
We have created a function that will convert the data into the desired format, but it has a lot of code ...
4
votes
0
answers
216
views
GeekTrust: Traffic problem - functional programming
First attempt to write functional programming, been following OO paradigm all through my programming journey
Please review the code and let me know if any comments and violations of functional ...
4
votes
2
answers
3k
views
Download entire localStorage as file
I would like to download the entire contents from localStorage to a json file (in a "clear" formatting).
I've tried this and it works perfectly. However, ...
0
votes
2
answers
89
views
Processing list of users- filtering out from refused list
The code below takes a list of users and displays two lists
Refused users
Admitted users
Sample output:
Refuse: Phil, Lola.
Admit: Chris, Anne, Colin, Terri, Sam, Kay, Bruce.
Any feedback is ...