ECMAScript 6 reached feature complete status in 2014. The features vary widely from completely new objects and patterns to syntax changes to new methods on existing objects.
0
votes
0answers
35 views
App for adopting pets
I am building a small app for adopting different types of pets.
My API looks like this:
...
1
vote
1answer
37 views
Create an array which contains specific values of a specific nested object inside an array
So I have this array of objects, which respectively contain other objects:
...
2
votes
1answer
227 views
Present table of data, acquired from an endpoint, with option to sort by different values
I have built a Vue app which fetches data from an endpoint and presents that data in a table with sortable columns.
The app is based on this React challenge which is to create a table of users and ...
0
votes
0answers
72 views
Using polymorphic objects to represent parts of a deconstructed sentence
I am trying to make a chatbot using javascript by deconstructing a sentence into its intent by separating the Noun's Verb's, Adjectives, Durations's, Numbers etc... to construct a data query to try to ...
2
votes
1answer
42 views
Immutable ES7 global state store
I am quite an experienced developer but I am quite new to JS/frontend/functional programming and I am working with react-native in my day-job now.
I'm trying to do my own flux implementation to ...
1
vote
1answer
24 views
Using Bluebird with fs to read a file within each of an (variable length) array of directories
I'm reading an array (of unknown length) of modules package.json files in order to extract the "style" property and store it in an array of its own:
...
1
vote
0answers
28 views
TypingTest Autotyper Userscript
For fun, I decided to inspect the obfuscated source code on TypingTest and figure out how to write an auto typer for it. I came up with the following UserScript.
A couple of notes:
The site's code ...
4
votes
1answer
71 views
Summarizing and crawling the content of a URL
Lately I've been working on a practice project using JS ES6 to understand it better, therefore I've read a lot about JS design patterns and JS coding strategy. My question is about splitting the ...
2
votes
2answers
33 views
SQL LIKE search in Angular filter objects
I made this AngularJS 1.x filter, to search using a the same SQL LIKE syntax. Right now only the percentage symbol (%) is ...
3
votes
2answers
46 views
Locale language reducer
I am learning redux by doing a small project. Everything is working fine, but I need to know how I can refactor such code. For this situation, it might be good to use ...
0
votes
1answer
27 views
4
votes
1answer
44 views
Getting the three next days
I'm simply getting the 3 future days from an array of objects based on the current day to display for a weather component.
This is the first time I've attempted using ES6 and it's features so please ...
1
vote
1answer
77 views
3
votes
0answers
40 views
Retrieve index of HTML element within parent
I have a function I've been using for years that retrieves the index of an HTML element within its parent element, or, if a second argument is passed to it, the index of an HTML element within the ...
1
vote
0answers
22 views
Line Graph animation with SVG and ES6 template strings
I've made this animation which shall be incorporated in the header of a webpage.
Demo with compiled Sass and uncompiled ES6 code:
...
3
votes
0answers
21 views
Tracking stopped players and connecting them so they can interact
This file handles the player "stopping" in space, trying to find whoever is ahead or behind (also stopped) and joining everyone into each others stopping -rooms. I'm not too sure about the whole "each ...
1
vote
1answer
33 views
ES6 class that generates an area where you can draw on a page
I have the following javascript es6 class (along with some functions) that generates an area where you can draw in a page.
...
3
votes
1answer
64 views
JavaScript Functional Programming Bank Account, Shop and Customer
Motivation
I have worked extensively with JavaScript and have grown fond of some of its functional aspects. This got me wondering how one could implement the canonical example of a bank account - and ...
0
votes
1answer
51 views
4
votes
2answers
102 views
Plotting JSON locations using Google Road API with Javascript Promise chaining
I wrote this code for an personal application, just to help me visualize some data related to driving. I have one JSON on my machine, this JSON contains a set of locations (lat, lngs) and every ...
2
votes
1answer
42 views
Handling arguments in a Python-like range() function in JavaScript
I'm making a Python-like range() function (see Python docs) using JavaScript. This function can take from 1 to 3 arguments. There are 3 variables (...
0
votes
0answers
32 views
Using the fetch to return and transform data
I am trying to get data of all users firstnames from an API using fetch. What are the limitations of doing it this way and how can I improve this? (The solution works and the ...
3
votes
0answers
35 views
Uploading series of large files to API via Node
I wrote a node script to traverse a folder of hour-long mp3s and upload them to Mixcloud via their API. It works, but I suspect it's fairly inefficient - the computer it's going to run on at our radio ...
8
votes
1answer
109 views
A box for comments
I made this as a practice application to learn React. It is simply a box where someone can enter their name and a comment and submit it, and display other comments. This animated GIF illustrates what ...
3
votes
0answers
42 views
ECMAScript 6 amazon lambda image processing
I use this script in amazon lambda for image processing. Script should do:
download image and watermark from amazon S3
resize image to two sizes
put watermark on it and annotate with text
put resized ...
3
votes
2answers
56 views
Calculate amount of elements in collection by property
I was given this task: Calculate amount of elements in collection by property: "name"
...
1
vote
1answer
40 views
Singly linked list implementation in JavaScript
I'm looking for feedback on my singly linked list implementation in JavaScript. Please let me know if you have any suggestions on coding style, documentation, bug fixes, etc.
UML / code overview
<...
3
votes
3answers
89 views
Checking if parentheses are balanced
This script checks if parentheses are balanced. I wonder if there is something that can be improved here including ES6 features.
...
2
votes
1answer
41 views
Stateless Maximum Beauty of String implementation
Inspired by The Beauty and the Strings question, I tried to implement the "Maximum Beauty of String" in a stateless fashion using ES6. Unfortunately, I ran into two places where I had to assign ...
2
votes
0answers
58 views
Tic Tac Toe AI - library based on Minimax algorithm
I recently struggled with implementing AI in Tic Tac Toe game. For better understanding of minimax algorithm I've decided to separate AI's logic. When I finished I thought that some may find it useful,...
4
votes
1answer
59 views
Generating sinusoidal music as WAV output in JavaScript ES6
This is a single isomorphic class in ES6, written with the intention of generating a full WAV file given note names and durations in seconds. In JavaScript it can ...
7
votes
1answer
98 views
Wheel of Fortune — The ES6 Version
I have taken my original code from here and turned it into an es6 version of the same game.
Any code review and critiques are useful.
Side note: "Bankrupt" and "Lose a Turn" do not do anything right ...
1
vote
1answer
47 views
0
votes
0answers
35 views
JavaScript making http(s) request: requiring modules within a function
This JavaScript code is being used as part of a reporting tool that makes http(s) GET requests to an API, bundles responses and uploads them as files to an AWS S3 bucket. It's a script that runs ...
2
votes
3answers
110 views
Calculate average of array of objects per key value using reduce
I want to find average of an array of objects based on their key values using the new functional programming style. I found my way around array reduce and solved my ...
1
vote
0answers
38 views
Monty Hall Problem in Javascript ES6 and React
Any suggestions for optimization are appreciated!
...
3
votes
1answer
89 views
A Sudoku solver in NodeJS using ES6 classes
As part of a challenge with one of my colleagues, I developed a NodeJS Sudoku solver. It takes an array of all the values of the grid as input (with zeros for absent values), and outputs the same ...
0
votes
4answers
99 views
Move array element to the first position
I wrote an update() function to make an entry the first element in an array.
...
2
votes
1answer
74 views
JavaScript breadth-first search algorithm
I have implemented a breadth-first search and I'm more or less looking for suggestions on how I can improve on what I've done here.
How to use:
...
5
votes
1answer
60 views
String checking functions in functional JavaScript
Please review these string checking functions. This is the whole module
which is actually written here. It supports buffer, array...
3
votes
1answer
44 views
Filling Array with Alphanumeric values
I've done a function that does the following :
It takes an argument length that it will be the length of the result array.
The Array should start with alphabet ...
3
votes
1answer
68 views
Dispatch events in JavaScript
I needed a simple and efficient way to use events in my JavaScript code, so I came up with a small event library.
Currently, I'm doing it like this:
...
2
votes
1answer
762 views
Implementing redirect in Redux middleware
Let's say I have following action:
export function signIn(data) {
return {
type: USER_SIGN_IN,
promise: api.post('/sign_in', data)
}
}
and the ...
11
votes
1answer
124 views
Wandering water ways
An entry for the August 2016 Community Challenge
I slightly modified the input and output to suit the snippet tool, and also because I really like the mapped output with the basins.
I have been ...
3
votes
3answers
70 views
Binary search that gets ALL matching results
I am implementing a binary search to retrieve all matches of a specified value. Instead of a regular binary search that would just return the first match, I want to get that first match AND all ...
6
votes
1answer
113 views
My Tetris implementation
I just wrote a Tetris game and I'd like to humbly request for code review especially in terms of code transparency, code efficiency (whether something can be coded in faster way using less resources) ...
4
votes
2answers
68 views
Library system manager
I'm new to JavaScript OOP and still playing around with it. I have put together a few specific questions over specific details throughout the code that are bothering me.
I wanted my ...
0
votes
0answers
117 views
A very basic inventory app with search in Angular2
So, I have been learning TypeScript and Angular2 and I came up with this:
...
4
votes
1answer
56 views
DRYing a stateless functional builder
This was just an experiment to see if it was possible to build a stateless builder in ES6. I was able to do it, but when I took it a step further I got stuck trying to DRY it out.
In this case, we ...
1
vote
0answers
34 views
Emulating the React.js createElement function
I am trying to create a helper function for myself, and this helper should do the following:
Create an element
Add properties to the element
Set values to the element (this is the concern of my ...