Skip to main content

All Questions

13votes
5answers
3kviews

Vue.js search functionality

In my BlogList.vue component I made a search input field: ...
meez's user avatar
  • 241
11votes
4answers
3kviews

Restructuring JSON to create a new JSON where properties are grouped according to similar values

I have a JSON structure in the following example format: ...
fruitlessartery's user avatar
11votes
1answer
228views

Hunt the wumpus: Functional JavaScript (Node) with Lodash

I'd like a code review of the following simple implementation of the classic game Hunt the Wumpus I'm trying to use JavaScript in the most "functional" way. To help me, I'm using lodash and ES6. <...
pistacchio's user avatar
10votes
2answers
696views

Array duplicate removal for duplicates exceeding `N`-number

I recently encountered a front-end interview coding challenge question that required one to create a function which returned an array that excluded numbers that occurred more than ...
Gavin Hughes's user avatar
8votes
2answers
188views

Functional way to have two toggles that turn each other off

I have two sets of toggles that need to "uncheck" each other. This is my current solution which is working. Can it somehow get more functional/elegant? ...
qbolt's user avatar
8votes
1answer
2kviews

Merge Intervals in JavaScript

This is a task taken from Leetcode - Given a collection of intervals, merge all overlapping intervals. Example 1: ...
thadeuszlay's user avatar
7votes
3answers
1kviews

Counting words from stored .md files

The following searches recursively for all the mark down files - i. ending with the extension .md - inside a folder. It then stores the text of the files in an ...
wyc's user avatar
  • 555
7votes
1answer
4kviews

Given a string containing just parentheses, determine if the input string is valid

The task is taken from leetcode Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: ...
thadeuszlay's user avatar
6votes
4answers
3kviews

Convert minutes portion of time to decimal

I am making an hours calculator app. It takes a start time, end time and time taken for lunch. For the start and end time it takes a four-digit hh:mm time. For example: 10:20. I have made a function ...
Ruari Douglas's user avatar
6votes
4answers
3kviews

Find all letter Combinations of a Phone Number

The task is taken from LeetCode Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. A mapping of digit to letters (just ...
thadeuszlay's user avatar
6votes
2answers
3kviews

Use functional-programming to convert a tree of parent:children objects to array

Having some trouble with a code I'm trying to refactor, where I need to go over a 'tree' of items, filter some invalid items, and create a new array of filtered items which takes properties from both ...
avivr's user avatar
6votes
2answers
136views

Reformatting a structured string like "a-b-c|A-B-C" into "a-A|b-B|c-C"

The code below was inspired by this post in Code Review. Here is how it was first intended by its author: I have the following code that converts a string that looks like : aaa-bbb|ccc-ddd|eee-fff ...
cFreed's user avatar
  • 2,821
5votes
1answer
1kviews

Program for calculating and ranking scores

I've recently completed a vanilla JS challenge . It is a method for calculating and ranking scores. If possible, I would love to make it better. Any suggestions are welcome. Challenge Directions: The ...
gracie catherine's user avatar
5votes
1answer
119views

Advent Of Code 2017 Day 4 (part 2) in Functional Programming (FP)

I wanted to practice functional programming (FP) without using any library but using vanilla JavaScript only. So I took a problem from Advent of Code (the 2nd part of Day 4) You can only access the ...
thadeuszlay's user avatar
5votes
3answers
112views

Aggregate summary counts for an array of error objects

I'm doing some refactoring of someone else's code, and just want a second opinion, because of course I think my work makes it better, but some validation (or correction) would be helpful. Starting ...
redOctober13's user avatar

153050per page
close