Questions tagged [ecmascript-6]

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.

Filter by
Sorted by
Tagged with
4
votes
4answers
98 views

Filtering a name Array in JavaScript

I was wondering if there is a better, more elegant way to write the following JavaScript code block: ...
2
votes
0answers
58 views

JavaScript attempt at an aspect oriented logger using proxies and reflect

I've been playing around with AOP in JavaScript to create a Logger that I can attach to classes and output what is going on (mainly instantiation, calling of functions and the results from functions). ...
1
vote
1answer
415 views

JavaScript Determine if Array has Almost Increasing Sequence

A coding challenge on a website says to determine if an array would have an increasing sequence if one element were removed from that array. Here is the function: ...
3
votes
0answers
48 views

Replicating Chrome console's JavaScript object explorer

This is a follow-up post of my previous question: Displaying JavaScript object's structure on page with HTML which looked at how to display all properties of a JavaScript object on a page similar to ...
3
votes
1answer
71 views

Produces a string based on rules

I was recently playing around with some code, and someone mentioned that my code uses too many classes. I didn't realize I've been doing ES6 incorrectly for so long. I'm having a hard time finding a ...
2
votes
0answers
11 views

Combining immutable lists of strings with each other

The Problem Create a javascript method which combines each string of two immutable lists with each other: ...
6
votes
1answer
77 views

map of SF transit cars

Please provide general and any specific criticism of the following which is intended to provide a map of SF transit cars. The code can be viewed in the working version and also in a group of gists. ...
5
votes
1answer
236 views

Displaying JavaScript object's structure on page with HTML

I wanted to reproduce the type of navigation system found in the console of Firefox and Chrome: you can explore an object's properties by unfolding boxes: So I'm searching to: display all of the ...
3
votes
0answers
183 views

Scraping StackOverflow's questions with Node.js

I'm new to node and web scraping in general but with some research I've written this working code. My goal is to get all questions from X Stack Overflow's pages sorted by most rated and save that ...
6
votes
3answers
565 views

My re-written snake game in Javascript

This a snake game I wrote about 1 month ago. It's working well. Looking for any suggestions for my code, I want my coding improved. jsfiddle link http://jsfiddle.net/geswhvdc/ ...
8
votes
1answer
126 views

Chart of Percentage questions Answered

Every day, Duga reports the number of unanswered questions and percentage of answered questions (after she calls the API endpoint /info) in The 2nd Monitor (so we ...
10
votes
1answer
370 views

Card based computer game

This is a 2 player (Will soon have AI in it - I am not asking for help with AI) game with mechanics similar to the card game named Magic the Gathering. Bear with me, this is a lot of code. If you ...
3
votes
2answers
140 views

Creating and updating link to instagram image or video

I've been using the InstagramPhotoLink extension for Opera for some time but instagram broke it recently. I thought I could try to fix it... and I did. The original extension is rather limited and ...
6
votes
1answer
626 views

JavaScript telegram bot that sends images based on user search

In my freetime, I did this little Telegram bot in Node.js that provides some basic text-based commands and one command where a user can search for an image in order for the bot to send back an image ...
3
votes
2answers
528 views

Creating nested objects from string

I implemented a method, to create an object based on a series of strings that are passed to it, of any depth or length. The way I implemented the solution was to map over the arguments. Assuming that ...
2
votes
0answers
41 views

Simple npm module allowing users to create Sets of objects

I'm a junior developer and I've recently created a simple npm module that was designed to allow users to create Sets of objects in JavaScript. This was done by implementing a single class ...
1
vote
1answer
34 views

Node router for marketplace routes

After cleaning up & some refactoring, one module of my code became like below. However, I'm feeling like there's still some unnecessary redundancy, and it can be improved further and look neater. ...
7
votes
1answer
271 views

Code Challenge: Catching Car Mileage Numbers - 4 kyu Kata from CodeWars

Challenge Story: "7777...8?!??!", exclaimed Bob, "I missed it again! Argh!" Every time there's an interesting number coming up, he notices and then promptly forgets. Who doesn't like catching ...
3
votes
1answer
69 views

Validity checks for a user signup process

Background: I have been working on a service which allows users to signup on different apps and on each login checks if the request is valid or not based on a series of checks. The below snippet is ...
5
votes
2answers
622 views

Simple math game in JavaScript

Created a simple math (addition/subtraction) game to practice my JavaScript. Any feedback on the JavaScript appreciated. Can play in: CodePen Instructions: A math equation will show up and simply ...
5
votes
1answer
58 views

Utilities for Various Builtins #2

This is the final iteration of an iterative review. The previous iteration can be found here: Utilities for various builtins #1 This code solves the following issue: ...
3
votes
4answers
144 views

Find the longest length of sequence of 1-bits achievable by flipping a single bit from 0 to 1 in a number

Problem Statement The problem is defined in the book as following: 5.3 You have an integer and you can flip exactly one bit from 0 to ...
1
vote
1answer
39 views

Utilities for various builtins #1

This is an iterative review. The next iteration is located here: Utilities for Various Builtins #2 This code puts several builtins (And a few non-builtins) into the base classes. ...
6
votes
1answer
128 views

3D 1st Person Snake Game #3

Final iteration of an iterative review. The previous iteration is here: 3D 1st Person Snake Game #2 Note: For the snippet, click run, "Full page", purposely lose, and then type r. Here is the ...
5
votes
1answer
131 views

3D 1st Person Snake Game #2

This is an iterative review of this question: 3D 1st Person Snake Game #1 The next iteration can be found here: 3D 1st Person Snake Game #3 Here is a snippet of the code: ...
6
votes
1answer
147 views

Multiple stacks implemented via a linked lists on top of single fixed-size array

Problem Statement Originally, the problem is defined in the book as following: Describe how you could use a single array to implement three stacks. — Cracking the Coding Interview (6th edition) ...
-3
votes
1answer
42 views

Applying Function To Each Member Of A Destructing Assignment [closed]

I am looking for a way to reduce the minified (by the Closure Compiler with ADVANCED_OPTIMIZATIONS) size of my code. To do this, I am looking for a way to apply a function to each member of a ...
3
votes
1answer
76 views

Express.js routes management for large web application

I'm currently working on a large web application with numerous routes. Currently, our routes are in one large list in a single JSON file. We recently ran into a problem due to the precedence of ...
3
votes
0answers
65 views

Simon game made with ECMAScript HTML and CSS

How does my HTML and CSS look? I'm a beginner so I have no idea if this is good design or not. Is there an easier way to copy and paste code here? Everytime I paste my code in here and use CTRL+K, ...
5
votes
1answer
105 views

Convert numbers from base X to base Y

I recently wrote a piece of code to convert between two bases of X, (Where 26 > X > 0). I was mighty proud that I did this. And then I started wondering, am I using modern coding conventions/practices?...
4
votes
1answer
58 views

Code improvements for React App

This was my code challenge for a Junior JavaScript Developer position. The app is mostly running error-free, but I was rejected for the role, so I assume there were major issues with my code and have ...
1
vote
0answers
86 views

Creating a menu for a quiz

I've built a menu for a quiz, where everything is hard-coded apart from the categories, which I'm pulling from an API using Axios. Api.js ...
4
votes
1answer
69 views

OOP air conditioner model

I had a phone interview and we shared a screen to do a simple challenge. Instructions were ambiguous but I basically had to implement how an air conditioner would work in general. I wrote the ...
3
votes
1answer
91 views

Throttle/debounce implementation performance

I'm trying to create a good way to manage throttling and debouncing a lot of functions. What I have allows you to group, add and remove functions to instances of ...
12
votes
2answers
271 views

Vue - It's the Royal Game of Ur

Background After learning Kotlin for Advent of Code in December, I started looking into cross-compiling Kotlin for both the JVM and to JavaScript. Then I wrote a game server in Kotlin and also a ...
1
vote
1answer
79 views

UserScript to Highlight tab for queue item

It may seem a bit obsessive and/or pedantic, but the following script allows me to see when posts are ready for reviewing. I developed this UserScript for use with TamperMonkey to allow me to have a ...
4
votes
1answer
113 views

Lazy lists with transformations, using generators & iterators

I built this very-basic lazy list (I'll add more methods as I need them). You provide it an array, a generator or any iterator. It creates a lazy list, which lets you run a pipeline of transformations ...
2
votes
2answers
103 views

Display the time left of a given time

Context This software is a countdown/visual timer. It was initially developed to display the time left before the end of an exam. Question My JavaScript is working but when I want to validate it by ...
3
votes
1answer
201 views

Code to call Space X API and display results

This is a technical test from a job interview. The feedback was that although it does as asked, the application structure wasn't great. As a beginner I'm not entirely sure what's wrong with it and ...
5
votes
1answer
343 views

JavaScript module to render and handle a form to add users

I recently switched to modular JavaScript and really like the idea of having the state of your application in JavaScript and not in the DOM. I want to know if what I am doing is considered best ...
3
votes
4answers
2k views

JavaScript Random Color Generator

I made a page to generate a random color with JavaScript and set that color to the background of the page. ...
3
votes
0answers
58 views

Javascript clock/time increment improvement

I've create a time picker component and it works as it should. I've written it in vanilla js. I have learned js purely through writing jQuery and wanted to see if anyone would let me know how they ...
6
votes
1answer
187 views

Simple color clicker game

My friend recently made a color clicker game, and I tried cleaning up the code a bit. I want to know how I can improve the functions and passing/editing of global variables. There are a lot of ...
3
votes
2answers
1k views

Quiz app from a JSON file

My code fetches quiz data from a JSON file, displays the questions sequentially and records the user's answers. It keeps track of the user's score and at the end display the user's result based on a ...
0
votes
0answers
56 views

Looking for react API call and es6 map() evaluation

The react application is showing API fetch result in the page based on query string tag selected. There are few question in ...
8
votes
2answers
825 views

HTML/Javascript Hex to RGB and RGB to Hex Color Converter

I have recently started learning JavaScript (A great language) and decided to start a small project which consists of a website with two inputs, one for hexadecimal input, and one for RGB input. When ...
1
vote
1answer
322 views

Implement a Finite State Machine in ES6 [closed]

I have built a simple finite state machine that models an even simpler fictitious bank account system. Any given account can be in one of three states at any time: Open, Closed, or Held. I have a ...
4
votes
1answer
42 views

Scoring a Behavioral Survey

I've written a script to calculate the user's scores as a part of a larger survey application written in React/Redux. The questions are all based on the Likert Scale, i.e. "How much do you agree with ...
3
votes
1answer
63 views

Altering SE sites to imitate SO's appearance

Some time ago someone complained that sites that were not stackoverflow were hard to read at work since people might be screen watching. So I bashed some code and created SO-ify. Some time and several ...
1
vote
1answer
63 views

React container component

This is my first reactJS project and I am trying to build a page out of my components. I thought it would be best to create a section component and then put appropriate components inside of it. I'm ...