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.
6
votes
1answer
91 views
Self-playing Baseball game — An es6 update
A long long time ago I asked this question which has since garnered about one thousand views. Now for something new.
The demo for what I have is located here. I am generally happy with what I have ...
1
vote
0answers
98 views
1
vote
0answers
17 views
Is this a correct way of structuring an ES6 class in angular
There's no problems getting it to run, I'm just wondering if it's the best way. I'm also unsure about binding so many things to the 'this' scope as it makes them available in the view.
...
0
votes
0answers
29 views
Display customer list in ReactJs using es2015 class syntax (v 2.0)
Following on from my question here, i have made the following changes as recommended by SirPython:
1. getInitialState
I couldn't make this change as it didn't work when utilising es6 classes, As ...
2
votes
1answer
47 views
Custom each method
I have developed the following method for each as a replacement for $.each, and I am considering using it in my personal lightweight js library called LIBJS.
The final version will be part of a ...
2
votes
0answers
25 views
Simple native JS Calc
I've never been into web a lot, but I really want to.
I started from simple things. I have some experience in .NET and c#.
But the world of javascript is completely new for me.
I wrote simple ...
0
votes
1answer
31 views
3
votes
0answers
26 views
Count groups of open cells around a cell on a grid
Consider a 3x3 square surrounding a cell (marked @) on a grid:
0 1 1
1 @ 0
1 1 1
I need to find the number of groups of open cells (ones) surrounding the center ...
2
votes
1answer
34 views
jQuery templating with ES6/ES2015 template strings
I have been using a particular pattern over and over again when I want to keep my jQuery apps more safe from XSS. I do something like this. (It uses ES6 template strings)
...
2
votes
1answer
32 views
Using fetch() and a new Promise object to get API results
I've written an ES6 function using the new fetch() API and returning a new resolved promise with a data object or a rejected promise with an error subclass.
I'm pretty new to both ES6 and Promises, ...
3
votes
2answers
53 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
50 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
32 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
13 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
35 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
97 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 ...
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
53 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 ...
49
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
50 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
54 views
5
votes
1answer
53 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
24 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
98 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
50 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
27 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
50 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
24 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
87 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
36 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
59 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
26 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
95 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
172 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
40 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
62 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
37 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
124 views
Finding the max sequence finder
Problem Statement
Find the max sequence finder.
findMaxSequence([3, 2, 3, 4, 2, 2, 4]);
...
2
votes
0answers
19 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
79 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
38 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
128 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
115 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
47 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
55 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
61 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
41 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
35 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
101 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 ...