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.
3
votes
2answers
47 views
ECMAScript 6 budget calculator
I never get to use ECMA6 in production/work, so I am hoping you all can help me write better code by reviewing my finished sample:
...
5
votes
0answers
26 views
Node.js parallel file download, the ES6 way
I wrote a script that downloads all PDFs found on the web page of a particular government agency. I would have chosen bash for such a task, but I want the script to ...
0
votes
0answers
26 views
Web-scraping library
Here are two functions that make a request for a given URL and then takes the response body (HTML) and loads it into the cheerio library:
scrapeListing.js
...
0
votes
0answers
8 views
Code kata featuring: fetch, promises, Array.sort, Array.reduce, Array.map, String.localeCompare
I just finished a kata and would love to get some constructive feedback regarding code quality, readability, organization.
Objectives
fetch members of polish parliament (poslowie)
group them by ...
0
votes
0answers
28 views
Webpack code splitting with emphasis on small size
I am using Webpack to create sort of loading sequence of the application. This is approach I came up with. I can simply call prepareInfosite().render() and I don't ...
4
votes
0answers
89 views
Simple wrapper for the GitHub API with Promises
I'm only just starting to delve into the wondrous world of functional programming and Promises; to start with I've converted a bunch of procedural code in (what I believe to be) is a more readable ...
0
votes
0answers
25 views
Draggable and resizable buttons
I made draggable and resizable buttons using Vue.js (a simplified version of Angular.js) and Interact.js (a library like d3 but focused on DOM interaction).
This is the HTML. The grid and plane div ...
1
vote
1answer
37 views
Creating exportable JavaScript module [closed]
I am trying to create a JavaScript module that would animate typed text in a similar fashion like the Slack homepage. My CodePen can be found here.
My goal is to create a library that would be easy ...
3
votes
1answer
47 views
Simplified Caesars Cipher
I'm studying functional programming, and I have the following problem to solve. It's an simplified version of Caesars Cipher:
You need to write a function, which will take string encoded with Caesar ...
48
votes
6answers
5k views
You hate h̶a̶t̶s̶ reputation? Click here to get rid of it
Soo... I recently read a meta-post about the inherent problems of reputation. It listed some things like:
Confirmation bias.
Demotivating for low-rep users.
Hubris and elitism of high-rep users over ...
0
votes
0answers
39 views
NodeJS link shortener
I made an app in NodeJS, with Express and Mongoose, that takes a URL as input into the address bar, and returns an alias to that URL. It can be used as a link shortener.
The app is intended to ...
-1
votes
1answer
52 views
5
votes
1answer
49 views
Animation Template Method for Snake Game
I have recently finished my first iteration of a template method implementation for a JavaScript canvas animation of the snake game. However, I would love for the community to critique this code and ...
1
vote
1answer
23 views
Extracting values from refs pointing to form inputs
I have a form component with multiple refs pointing to form inputs. On submit, those inputs' values need to be passed the into form callback, structured as an object.
Currently, it's achieved like ...
2
votes
0answers
94 views
Bill has a hard time keeping all his promises
Description
A couple days ago I created this Angular 1.x provider for my Ionic/Cordova app. I'm using webpack and babel-loader for ES6/ES2015 syntax and modules.
All my provider does is "provide" an ...
4
votes
1answer
43 views
JavaScript (ES7) LOC counter
I've been writing JavaScript for a couple years but nobody's ever really looked at my code.
This is a small library I wrote to check code modularity, w/ input like ...
0
votes
0answers
23 views
Async boolean expression evaluator in ES6
This is a pretty simple Node package designed to accept a "boolean expression" and evaluate it asynchronously. The full project is on GitHub.
Essentially, an expression like ...
0
votes
1answer
30 views
ES6 block-scope variable usage
I am experimenting with ES6 using BabelJS in a codepen project you can find here. I am confused as to why my code breaks when I decide to use let instead of ...
0
votes
1answer
47 views
Reusing a Class
I made a UI picker tool, like a "rolling select" to pick vales (demo here).
I made first a independent module with a ES6 Class, basically:
...
1
vote
2answers
21 views
Finding the positive numbers count in an ECMAScipt array
All I am trying to achieve is better use of built-in ES functions.
...
1
vote
1answer
64 views
Simple recipes web app with Redux
I have completed a coding challenge from Free Code Camp. The challenge's user stories are as follows:
I can create recipes that have names and ingredients.
I can see an index view where the ...
0
votes
1answer
34 views
Creating and finding posts using Parse.com
The following code calls Parse. And uses its API to create two functions: post.create and post.find. As the names imply, one is ...
5
votes
1answer
57 views
VCF parser for eventual genomic data visualization
I've just started out writing an app that will visualize genomic data for anybody to understand.
When you get your genome sequenced the raw data usually comes in the form of a VCF file. I started out ...
2
votes
0answers
25 views
A 'top 100' app that displays list of users ordered in two different ways
I built a small app that gets data from a remote json file and displays it in a list of users. In each list item, an image of the user, their name, and their points tallies are shown.
The list is ...
3
votes
1answer
61 views
Range iterator in ES6 similar to Python and Ruby for
Background and Purpose
For those unaccustomed to Ruby, Ruby supports range literals i.e. 1..4 meaning 1, 2, 3, 4 and ...
1
vote
1answer
138 views
Pagination logic created from scratch
I created this JavaScript class using ES6-ES7 syntax to return an array of page numbers and ellipsis points (null) to be consumed by a function which will create a styled paginator.
What I am looking ...
1
vote
0answers
37 views
Async process to send a contact email and confirmation message
Using nodemailer and node-email-templates to send a contact email and confirmation message. As is, I can catch any errors, but (if a file attachment is included), this process can take up to 30 secs ...
7
votes
1answer
55 views
React & ES6 news app
I have written a small app that fetches news items from an endpoint and displays them in a grid.
I used React to create components and use them throughout the app. This is the first thing I have ...
3
votes
0answers
28 views
Min-Heap based priority queue class written in ES6
I would appreciate any feedback on syntax, naming convention, possible shortcuts, clarity of code and any other constructive feedback. This code was based off of the Priority Queue chapter in The ...
4
votes
4answers
94 views
Finding the max sequence finder
Problem Statement
Find the max sequence finder.
findMaxSequence([3, 2, 3, 4, 2, 2, 4]);
...
2
votes
0answers
17 views
Return the Euler Cycle for a graph with es6
My algorithm for finding an Euler tour of a digraph, G⃗, if such a tour exists, starting from some vertex, v.
...
2
votes
2answers
71 views
Reduce array of objects into object of arrays
I have an array of objects where each object has two keys: key (k) and value (v). I need to make an object that would take ...
5
votes
1answer
33 views
Node bot to send out reminder-emails if a team member doesn't submit their weekly schedule
This CalendarService is part of a little node-bot I wrote today which sends out reminder-emails if a team member forgets to submit his weekly schedule in time. Calendar backend is using Google ...
4
votes
1answer
116 views
Recursive, depth first search
I wanted to write a function findDeep that would perform a recursive, depth-first search on plain objects and arrays.
Comments and criticism welcome.
...
1
vote
0answers
88 views
ReactJs Tabbed component
I've written a simple tabbed component in ReactJS, whose purpose was to make defining different tabs very simple. My implementation does this very well in my opinion, since defining tabs becomes very ...
1
vote
0answers
45 views
JavaScript plugin architecture for multiple methods with the same parameters
I am writing a JavaScript plugin for fun. The plugin allows the user to pass options to initialize the plugin and perform actions. It is a simple alert/confirm plugin just for fun.
I am hoping to ...
5
votes
1answer
53 views
Using generators to build up a maze
In prepping to teach a workshop on recursion I wrote this code that uses a maze-building algorithm. In doing so I found it really natural to use generators a lot. I feel pretty happy with how the code ...
1
vote
1answer
59 views
Currying addition function in ECMAScript 6
I wanted to write an add function that implemented currying in JavaScript. I welcome criticism and suggestions for improvement.
...
0
votes
1answer
39 views
ES6 call `this` in Array.filter
Does exist a cleaner way to call a static method inside ES6 Array.filter function ?
...
0
votes
0answers
34 views
Long arithmetic addition implemented functional style
This implementation uses ECMA6 syntax and babel as transpiler. You can use this code to add integers which is bigger then Number.MAX_SAFE_INTEGER
...
3
votes
0answers
83 views
HashMap and HashSet classes for ES6
The new EcmaScript standard, ES6, contains specifications for Map and Set built-in classes. Each of these collections treats an ...
2
votes
1answer
53 views
Sum an array of video lengths in JavaScript into HH:MM:SS
I am trying to learn functional programming in JavaScript, and saw a little task on Twitter that I wanted to have a go at:
...
1
vote
1answer
137 views
Knockout computed observables in ES6
I am trying out for the first time knockoutjs and babeljs and have a question on how to do computed observables properly. Both fullName and ...
2
votes
1answer
71 views
Return React child component based on current state
I am trying to build a multi page form widget with React for a website inspired by this. Since quite some time has passed since I last touched JavaScript, I'm directly adapting to ES6/7 and tried to ...
1
vote
1answer
65 views
Node.js drawing game based off of my state diagram
I really want to have a nice design pattern for my Node.js project. This is my state diagram. As I'm coding this, I'm wondering if it's better to separate state logic from the class? So instead I ...
2
votes
0answers
245 views
Flux & async communication with websockets
I want to arrange async server-client communication with websockets and vanilla flux architecture. There is an excellent article about "Async Server-Side Communication with the Flux Architecture". I ...
0
votes
1answer
57 views
Flux: async communication with websockets
I want to arrange async server-client communication with websockets and vanilla flux architecture. There is an excellent article about "Async Server-Side Communication with the Flux Architecture". I ...
3
votes
0answers
29 views
3
votes
0answers
56 views
String sequence in ES6
Given an unique string that represents a sequence of characters, the class should implement three methods (getNextChar, getNextString and the genSequence generator).
How it works
We give a sequence ...
1
vote
2answers
58 views