Skip to main content

All Questions

1 vote
0 answers
67 views

Calculate total running time for movie series

Which of these 2 functions is better and more readable and why? (Both functions do the same thing). My goal is to get the total time of a series, using the TMDB API (which has a limit of 20 different ...
jofyavoydo's user avatar
4 votes
1 answer
163 views

Array Implementation In JavaScript

Review I have written my own implementation of Array in JavaScript with the basic functionalities. Can anyone please review this code and point out the mistakes/how to make the implementation better? ...
enigma6174's user avatar
0 votes
1 answer
129 views

Find longest "binary gap" [closed]

I'm doing a few challenges and I found this one on Codility: A binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the ...
GB5's user avatar
  • 101
0 votes
1 answer
237 views

Show numbers per step count

I have a problem where I need to display the below output 1 23 456 78910 My first solution is ...
teebo's user avatar
  • 103
1 vote
1 answer
125 views

Categorise amount into "small", "medium" and "large"

I have a super simple function that returns a text label for a range of the input ...
Joji's user avatar
  • 325
1 vote
1 answer
479 views

Constructing routes from imported URL constants

There is a file created with the project paths in a dictionary. Example: ...
Javier's user avatar
  • 113
1 vote
1 answer
131 views

Show progress bar for different states

I have this working code which shows the progress bar based on different states ("not-started", "progressing" and "done"). Each state will have its own class. I notice it ...
Steve Ngai's user avatar
4 votes
3 answers
134 views

Destructuring with map and assigning to a constant

I don't know exactly what to name this, but I was refactoring a code snippet and looking at this constant users I thought I'd do this destructuring: Before: ...
ARNON's user avatar
  • 401
1 vote
0 answers
57 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 ...
xkeshav's user avatar
  • 131
0 votes
3 answers
408 views

C# 'out' keyword in JavaScript [closed]

Since I met the out keyword in C#, I'm trying to find an equivalent in JS. So, please take a look at the code and leave your opinions or suggestions about this. C# ...
user avatar
1 vote
1 answer
821 views

Which of these two Vuetify Navigation Drawer prevent prop mutation workarounds seem better?

I am very new to Vue.js, I just stumbled on a very hard thing to do (at least for me) where Vue was complaining about mutating a prop (children shouldn't change parent props apparently). I was about ...
ajax333221's user avatar
0 votes
3 answers
1k views

Get the Most frequent element in an array

I have been trying to optimize this: ...
Eliaz Bobadilla's user avatar
2 votes
3 answers
223 views

Sort an array of integers with a hashset

I was trying to make a sorting algorithm for an array of integers. Here's are the steps/theory: It turns an array into a HashSet, iterates over every integer value ...
Kudos B's user avatar
  • 21
3 votes
2 answers
365 views

Debounce function that limits the rate a callback is triggered. Which implementation is better, and why?

The Debounce technique allow us to “group” multiple sequential calls in a single one - The debounce() function forces a function to wait a certain amount of time before running again. I wrote both <...
Vektor's user avatar
  • 140
12 votes
1 answer
468 views

Resizable containers with VueJS

A month ago I reviewed the code in Resizable split DIVs Vue.js, suggesting that the OP use computed properties and bound styles to simplify the code (at least reducing the need to use ...
Sᴀᴍ Onᴇᴌᴀ's user avatar

15 30 50 per page
1
2 3 4 5
8