All Questions
Tagged with functional-programming javascript
278
questions
0
votes
1
answer
51
views
Sprinkler effect
Developed around visibility CSS property and HTMLElement#offsetHeight and ...
4
votes
3
answers
149
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
99
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
132
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
54
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.
...
2
votes
1
answer
124
views
4
votes
2
answers
183
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
113
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
199
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 ...
1
vote
0
answers
53
views
Reusable and testable JavaScript code for URL fragment-based tab navigation logic
Foreword
As a personal project, I've been creating a SPA blog (available here), which features 4 tabs (Thoughts, Projects, Readings, and CV), each accessible via one of four radio buttons, and several ...
4
votes
0
answers
212
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
80
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 ...
1
vote
0
answers
56
views
Higher-order function to do throttling, written two ways
I have used below method for throttling which is a Higher Order Function (HOF), but find some difficulties to choose which one is better way to write it. Below are both methods.
return of the ...
-2
votes
2
answers
106
views