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

4
votes
0answers
22 views

Reading and updating an XML address file

I have some code that reads from an XML file and updates if needed. I want to move some of the stuff around. Here is the code overall: ...
0
votes
0answers
44 views

Register a node-client code through an API call efficiently?

I've got a node_module that reads ArcValues for a user and updates the config of the node client at user's local (root). Like so: ...
0
votes
0answers
33 views

JS timer plugin

This code operates as intended, but with only with two operational timers running. I need the resize event in the match section as I need to retrieve the window ...
2
votes
0answers
44 views

Data model for complex tree (multiple children and multiple parents)

I'd like to have a discussion on the data model (mostly) for a tree with nodes having multiple children and multiple parents. I already have a working algorithm, but I'm looking for improvements. The ...
0
votes
0answers
21 views

Currency Converter as first React.js

After reading a few React.js beginner-tutorials I decided to make this web app. Just for to get some practical experience ... Moreover I used Twitter Boostrap for the layout. The app works as ...
3
votes
0answers
50 views

Simple color flooding game in Javascript/HTML5 canvas area

I'm learining JS. I have prepared a simple color flooding game, like Pixelated. The engine below works, though scoring is not implemented. Please help me find out how this code could be made better, ...
3
votes
0answers
57 views

Quickly applying gravity force between bodies

I have a function for applying gravity forces between every possible pair of bodies on my game. It is the most used function, and can run more than 100k times per frame so every minor improvement on ...
-3
votes
0answers
20 views

Html Canvas + JavaScript code feedback

I would like some feedback on how to optimize and improve my code: HTML: ...
3
votes
3answers
58 views

Wikipedia Viewer

This is one of the projects on freecodecamp. I would like a review on my code. Thanks in advance. Javascript: ...
0
votes
0answers
6 views

Binary Tree Paths - what is wrong with my code [migrated]

Here is the binary tree paths problem: Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: ...
5
votes
3answers
142 views

Parse a CSV file and return an object or array

I recently published a JavaScript module for NPM which is also available on Github by the name of rawiki-parse-csv. The code takes raw CSV data and returns an array. The method has one option to ...
6
votes
1answer
62 views

Counting newlines in a file

I've started to go through Node tutorials on nodeschool.io, and the second assignment was to write a program that will count the number of newlines in a file and print it out. My solution looks like ...
5
votes
0answers
57 views

“Stardust” 2D Gravity Simulator - Follow Up 1: The Planets

This is a follow up for the 2D Gravity Simulator-like Game question. Since then I have developed my javascript skills further, and now I'm using ES6 mainly. Note that even through this code uses ...
3
votes
1answer
40 views

Add functionality to object then remove those functions on export

Outline I have a form that needs validation. The problem is that the software requires custom validation that depends on multiple parameters. I decided to pass the object into a function which will ...
4
votes
1answer
54 views

A Game Of Simon

This is one of the projects from freeCodeCamp. It's a game of Simon (a memory game). I would like a review on my code. ...
2
votes
0answers
18 views

Stranded messaging Angular web app - main template for all views to live within

I'm making an Angular web app to solve a pain with traditional messaging my friend and I had, of sending batches of messages (on multiple different topics) to each other every few hours and not having ...
3
votes
0answers
32 views

Simple gallery with scroll

I just created a simple gallery with scroll. Everything works fine but I'm not sure how should I optimize this code: ...
3
votes
2answers
61 views

Validating multiple parameters by regex and length

I have a set of validation functions which return a response code along with an error message if the validation fails. Requests can be of three types, and each of them contains a different type of ...
2
votes
0answers
85 views

Setting up require.js for a static website and loading custom code

I am a new SO/SE user and I initially asked this question on SO, but i was 'sent' here -for some reason i don't clearly understand but anyway- so here I am..! I was actually curious about my ...
2
votes
1answer
30 views

Shortening Divs

I have a project here that looks pretty good and does exactly what I want it to do. The codepen is here. What I need to find out is if these divs that flip can be shortened in any way: ...
1
vote
0answers
14 views

Retrieving the Currently Logged in User's Department

I hope this is the right place for this. I basically wrote the below script for a SharePoint 2013 where I needed to get the department of the currently logged in user. I was finally able to get it ...
3
votes
4answers
44 views

Verifying that all form fields are filled in

I grabbed the form from some random site because I'm only interested writing the javascript at the moment. I am trying to check that a user has selected or entered text for all fields. I've made it a ...
2
votes
3answers
301 views

Getting the index of a character within the alphabet

I've made this function to map alphabetic coordinates to their corresponding ordinal number. ...
2
votes
0answers
18 views

A simple list of objects to display and edit with Angular

I want to create a simple CRUD app using angular on the frontend. I'm not really happy with the logic here, it seems a bit convoluted for fairly simple functionality. ...
3
votes
1answer
41 views
1
vote
1answer
50 views

Javascript Parallax Scrolling Text

I built a 404 page which involves parallax scrolling text. The program updates the position of 100-200 text nodes at each animation frame called with ...
2
votes
0answers
37 views

Implementation of the Minimum Stop Algorithm in Javascript

I started taking the Algorithm design class from Coursera. So into the third week they talk about Greedy algorithms and walks through a sample problem. This is the Problem Statement that I could find ...
1
vote
0answers
15 views

JavaScript-function for to attach CSS-animations

The purpose of the function is to attach CSS-animations to HTML-elements with a text-content property. Like for example h1, div, p etc. It's not fully elaborated. Nevertheless have I decided to put ...
-4
votes
0answers
32 views

Get blob URL to download as File [closed]

I am trying to get the file stored on the browser to download. Files have URL like this, blob:http%3A//sitename/46a1f2cf-002c-408d-a545-55f55200696f These files ...
5
votes
2answers
171 views
+50

Express middleware to validate URL and tags

I am building an API where the client can send a url and some comma-delimited tags: ...
4
votes
1answer
42 views

Userscript to tighten security in Mozilla Firefox

I have recently started writing a userscript for Mozilla Firefox to tighten security and make it more private, but before I want to start publishing it, I would like to have some experts take a look ...
2
votes
2answers
41 views

Async Implementation

I'm seeking code review comments for the following implementation. jsFiddle ...
3
votes
2answers
62 views

Javascript bar graph representation using CSS

This js was written strictly for a visualization of a graph redesign included in a stats report within our game systems. It all works properly, but I know there has to be a much neater way to organize ...
1
vote
0answers
45 views

JavaScript Image-Slider

An implementation of an image-slider I figured out. Could it be further improved? Or should I do it in a completely different way? Not sure if the technique of assigning a function to ...
4
votes
1answer
105 views

A very basic JavaScript calculator

I'm just starting out with code. I created a very basic JavaScript calculator. While writing, I couldn't help but think that there must be easier, faster and less redundant ways to write this. For ...
5
votes
2answers
145 views

My online hangman solver

I've created a simple hangman solver at solver.lukesalamone.com, and although I'd consider myself proficient in webdev I am by no means an expert. The trick with this is that since HTTP is stateless, ...
1
vote
1answer
51 views

Create new array by filter origin array

I'm getting an array and I needed to find a duplicate ID inside: ...
1
vote
1answer
53 views

Tic Tac Toe Algorithm revisited

I had previously submitted a tic tac toe code. I followed some of the changes suggested. This is my new code. ...
2
votes
1answer
34 views

jQuery menu state is-active

I have this menu in jQuery that works perfectly, but I think it would be better if, instead of using class="btn-accordion" for each ...
1
vote
0answers
22 views

Selecting up to three thumbnail images using jQuery

I have written something in jQuery but I'm not sure whether it is an elegant solution. Every click needs to check the DOM for classes/and add and remove classes. Any feedback or suggestions would be ...
6
votes
3answers
312 views

Take from top, evaluate, put on bottom

In this example, I am only looking for the first duplicate - curious if this logic in for loop (take from the top, evaluate, put on the bottom) pattern has a standard form ...
4
votes
0answers
43 views

Electron Application with JavaScript Backdoor and Ruby Command-Line Listener

I have created an Electron Application with a JavaScript/NodeJS Backdoor and a Ruby command-line listener. I created this program for remote administration of my home computer securely using a new ...
0
votes
0answers
16 views

Infrequently updated object caching [migrated]

Based on the comments received I have moved this question to stackoverflow. I'm working on a project where I need to cache objects from the database that are infrequently updated. How is this as ...
1
vote
0answers
24 views

Directory listing in Node.JS

This solution works, and I like having all the logic after the return. The main purpose of this function was for use with other functions to return a file list: ...
2
votes
1answer
20 views

Random walker using Processing.JS on Khan Academy, with new walkers generated on mouse click

I've created a project on Khan Academy as part of the Natural Simulations course on random walks. This project is in JavaScript, using the Processing.JS library, slightly modified by Khan Academy. ...
0
votes
0answers
22 views

JavaScript News Ticker in Retro Style

I have chosen to do it in a some "Retro-Style". So that it shall remind one of old green-screen monitors. Version with working Ajax-Request and Sass-Code on Codepen : ...
4
votes
1answer
49 views

Javascript promises, multiple api calls in then()

This is the first time I'm trying to use promises in JavaScript so I'm not sure if I have done it correctly but it seems to work. The problem is that I have ended up with a "nested when" and it ...
2
votes
1answer
16 views

Simple JavaScript Module “Loader”

I have written a simple JS module "loader" (loader is in quotes because it doesn't actually load the files) that is designed to resolve simple dependencies between modules. It is heavily inspired by ...
1
vote
0answers
9 views

FlowRouter auto-redirect on login page

The site should be accessible only to signed-in users. I'm making sure I publish and enable data manipulation to only those, but I wanna make sure even the app structure won't be visible. What I did ...
1
vote
1answer
31 views

Object key diff

I've been tasked with finding property differences in massive JSON structures and return them in a particular fashion ([key_1.key_2, key_1, etc]). Here's my code, which is focused on readability so ...