ECMAScript (commonly referred to as JavaScript) is primarily used for scripting web-pages but also has several embedded forms and stand-alone interpreters / JIT engines. Use this tag for questions regarding ECMAScript 5 or 6 and its dialects / implementations: JavaScript, JScript, etc., excluding ...

learn more… | top users | synonyms

8
votes
2answers
82 views

Stack Exchange Chat Caret Pathfinder

In The Nineteenth Byte, we have an excessive amount of carets (carrots, if you will) that direct one's attention to another message. For example: Amidst the confusion, I made a userscript that ...
3
votes
1answer
20 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: ...
0
votes
0answers
12 views

jQuery to JavaScript [on hold]

Firstly I would like to apologise if this is off topic. I am unsure if it is, as the code written works fine. Just wondering how I might convert this to JavaScript from JQuery? The code below expands ...
2
votes
1answer
10 views

Webpack loader for Phaser.io asset files

The following is a webpack loader for Phaser asset files. The way this is supposed to work is that it looks at the json string, and finds all of values with "url" keys in the json object, and ...
1
vote
0answers
10 views

Displaying a list of attributes and differentiate them from attributes already selected

attributes is an array with all attributes selected by the user. attributeList is a Mongo collection declared in [root]/lib and ...
1
vote
0answers
12 views

CasperJS continue equivalent inside for loop with casper.then

CasperJS doesn't allow continue statement inside a casper.then functions. This was my solution but I'm not happy about it. Is ...
2
votes
0answers
23 views

Brainf*** Interpreter in JavaScript 3

I have this Brainf*** interpreter (this is the JavaScript part): ...
2
votes
1answer
31 views

Improving performance for Depth-first search algorithm

I am using the following Depth-first search algorithm to compute value of a property called rotation_absolute based on previous values of ...
-1
votes
1answer
21 views

Calling the backend REST interfaces to get a timetable of the train

I'm very new to AngularJS and just started in a new project which uses AngularJS for Web UI. I was looking into our code and found out that we have huge functions in controllers. Like, one 100-LOC ...
-1
votes
1answer
26 views

Creating a calculator to multiply area of a rectangle/triangle using four functions [on hold]

I'm taking a JavaScript class and am having a hard time understanding why my functions aren't working (or, well, how to make functions work in general honestly). I need to make a calculator that takes ...
1
vote
1answer
22 views

Preforming some async operations with Rx.js

I tried to come up with a good challenge to learn some Rx.js programming and I came up with this chain of operations below. As well as a bit of code that works and does these things. Take github ...
2
votes
1answer
50 views

Simple JavaScript quiz application with radio buttons

I've created a simple JavaScript application, which also happens to be my first-ever piece of code in any programming language.It took me two days to get the core correct and another two days for ...
-2
votes
1answer
40 views

Creating forms using angular

I am a newly developer in angular. I want to do some homework to create forms with Angular. I spent nearly a week to do it, but my teacher was not really satisfied about it. I tried to follow some web ...
-3
votes
0answers
19 views

How can I convert my react-native code to use a listview? [on hold]

So a lot of people online and offline tell me that using a Listview is the most performant and I've never really understood how it works. I have instead used a ...
-2
votes
0answers
11 views

Trouble using image Array for src [on hold]

Trying to shuffle an array of images, then display them one at a time by clicking the canvas. The full code is below: ...
1
vote
0answers
32 views

XML parser for multiple browsers

I made a basic XML parser that is supposed to be working in many browsers by using most older functions. What it must do is return an AST (Abstract Syntax Tree) of a XML text in a string. (it's not ...
-2
votes
0answers
23 views

Function takes a list and returns true if any item in the list passes predicate test

The function: I have completed a function that takes a list and returns true if any item in the list passes the predicate test. If a predicate test is not given, the function will return true if any ...
0
votes
0answers
20 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
7 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 ...
2
votes
2answers
57 views

Input/character validation on an input-element

I took some time to create a function, which can validate which keys you input on an element. So far it has two uses: You call .validate() on the object, but make ...
3
votes
1answer
37 views

Non-coder options in Javascript

I have a page with a few options that the owner of a site needs to be able to set. He's not a coder and I'm trying to make it as user-friendly as possible. It works, but my implementation feels ...
0
votes
0answers
23 views

Convert JSON into Avro acceptable format

I've written a node.js command line script that takes a multi-line file of JSON and a schema template of what the object should look like, and converts it to a format that Apache Avro accepts. ...
-9
votes
0answers
32 views
8
votes
1answer
85 views

Chrome extension that marks Reddit entries with clickbait sources

So, I've created my first Chrome extension! What this does is it highlights every post on Reddit that comes from a source of dubious quality. It provides a few sources by default and allows the user ...
0
votes
2answers
54 views
+50

Module pattern JavaScript to initialize page, add event listeners, load map

I've written a script that I would love to get feedback evaluating the following: Module Pattern implementation, robustness, conciseness, cross-browser compatibility. My goal is to eventually use this ...
-2
votes
0answers
17 views

How could I reorganize my require.js project with webpack or browserify [closed]

I'm new to JS builder tool, I spent 2 days on organizing my js scripts via require.js However, my friends told me that ...
0
votes
1answer
28 views

Spawning child processes and event-listening

This function scrapes data from a webpage by spawning a process that executes a CasperJS web scraping script. The spawned process outputs data to stdout. This ...
0
votes
2answers
40 views

Partitioning an array of objects into four arrays by one attribute

I have an array of API objects, below is an example of one object: ...
-6
votes
0answers
19 views

Fnd the difference between arrays by keyword in javascript code? [closed]

How i can improve this javascript code? https://jsfiddle.net/dmitriykupriynov/1pfzmkr9/1/ I want to find the difference between arrays by keyword but seems my solution not optimal. ...
0
votes
1answer
20 views

callback of setTimeout function when performing synchronous actions

Inside a function I'm calling playgame service, once I've obtained the needed data (gameBeingPlayed) I need to show a 3..2..1 counter and then start a game ...
-1
votes
0answers
18 views

Simplify table highlighting [closed]

Looking for feedback on how to better improve or simplify the code below. ...
3
votes
2answers
86 views

Decimal number to binary number conversion in JavaScript

I made this decimal to binary conversion as an exercise for myself and because it is obviously often asked during job interviews / tests. Any hints concerning possible improvements welcomed. ...
-2
votes
0answers
25 views

Assigning distinct random numbers to variables [on hold]

I'm attempting to generate non repeating random numbers between 1-5, 1-10, 1-20, etc. I'm on to the Fisher-Yates Shuffle but I'm not sure I've implemented it in the best way. My plan is to associate ...
1
vote
1answer
34 views

Iterations with asynchronous functions

I haven't really worked much with asynchronous code so I'm wondering if I am doing something wrong/something could go wrong. Right now of all the test cases that I have done, my code has worked but ...
0
votes
2answers
36 views

Keyboard handler for moving in four directions

I'm having trouble deciding if I should leave the default: break; in the switch statement or not. It does kinda show intent, i.e. that most keys are not handled, ...
-2
votes
0answers
10 views
1
vote
0answers
23 views

Producer/Consumer write to file

I'm concerned with the memory usage of this application. When I start it and look at it's memory usage while it's waiting for input, it's memory usage is around 13,212 K. When the application runs ...
0
votes
0answers
14 views

How to load this javascript without interval [closed]

I have create a round clock but its load more how to solve this? my code: ...
3
votes
2answers
115 views
+50

Driving equation output from select input boxes via JavaScript and HTML

I would like to create a simple interface to allow a user to make a few choices via select boxes and drive a resulting equation. Here's a screenshot: This is a gross simplification and I am ...
-2
votes
0answers
48 views

Beta login api without passwords

In present day, people are asked more & more for new and more difficult passwords all over the web. To be honest, in my case, it is becoming a real struggle to remember all those passwords and I ...
2
votes
3answers
205 views

JavaScript Iteration

In my current project I have objects of the following structure: CanvasBundle - Object Some elements... gridCanvas axesCanvas ...
4
votes
0answers
88 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 ...
2
votes
0answers
19 views

Guidance on grouping equal sets of numbers, so each group has a similar average

Goal: I am trying to build teams of 5 people. Each person has an integer elo (rank). My goal is to make all the teams as equal/fair as possible, by having the average elo of each team be as close as ...
1
vote
1answer
90 views

Characters set permutations with repetitions

The code bellow generates all the permutation(with repetitions) for given character set. Is there any better(simpler, more performant) way to do that? ...
3
votes
0answers
33 views

Implementation of Dijkstra's Algorithm in JavaScript that returns both shortestDist/shortestPaths

I decided to try to understand the basic idea behind Dijkstra's algorithm better so I implemented it in JavaScript (the only language I am proficient in as of now) so I could really see what was ...
1
vote
0answers
24 views

One class unit-tests

Its my first attempt to unit-test in Js. Not yet TDD. What I can change? EventsPersistancyService.js: ...
2
votes
2answers
79 views

Typing game in JavaScript

I recently made a typing game in JavaScript and I would like it to be reviewed so I can become better knowing where I made mistakes and what I should improve on. CodePen ...
2
votes
1answer
21 views

Parallel computation to be merged, depending on single call

Steps: Get AMOUNT from a call to API endpoint /a, e.g. AMOUNT == 5 (in the code it is set ...
2
votes
2answers
93 views

Calling multiple plugins inside script tags

I'm not that comfortable with properly writing jQuery. On my website I've used a lot of jQuery plugins and basically just dumped all the different initiating scripts between two ...