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

2
votes
0answers
8 views

Meet Results Displayer

I decided to dive into the world of of JS/JQuery by trying to build a simple web app to display all of my various meet results in an easy-to-view manner. For this stage of the review, all it does is ...
0
votes
0answers
8 views

Custom expression that filters elements based on jQuery internal data

With jQuery, I'd like to be able to easily select the following types of elements: Elements that have a specific value set for a specific data attribute in the raw HTML Elements that have had a ...
3
votes
1answer
19 views

Magic square creator

I'm a newbie in javascript. Could you please say what is wrong in my code? How can i improve it? Maybe something is wrong with variables or methods naming. Maybe something is wrong with common ...
1
vote
1answer
14 views

Handling success and failure when retrieving product information

I've got an Angular controller where I have two functions that are repeated inside two functions: ...
0
votes
1answer
12 views

Controller scope inside Directive with Angular

I decided to write a simple runnable example to try and express my concern: index.html ...
2
votes
0answers
12 views

jQuery Toolbar Module

I'm fairly new to JavaScript, and wanted some critique on some code I've written based upon what I've learned recently. I have a strong background in OO programming (C/C++, C#, Java), but recently ...
0
votes
0answers
14 views

Horizontal page-loading accordion widget

Inspired by this website, I wrote the following function to automatically generate a div and load a page for each page listed in an array of page names. The idea is that if I want to conveniently ...
4
votes
0answers
28 views

Absolve me of my guilt: Dynamically creating spans that highlight on click

I'm working on a page that shows groups of users. The following JavaScript function is used to show more details about a user (such as email and login) when you click on their name. But there's a ...
1
vote
0answers
19 views

Movie torrent-site web scraper with IMDb info and streaming

I'm completely new to Javascript and NodeJs and functional programming in general. The code below scrapes a torrent-website containing movies, gets info about the movie from the OMDb API and lets a ...
1
vote
0answers
6 views

How to organize my CoffeeScript in classes

I am working on a simple Rails app. For the Expense resource I use a DataTable. So, in my CoffeeScript for this resource I basically do several things: initialize ...
0
votes
0answers
5 views

Upload multiple files in multiple sections while allowing removal of a single file, before upload

My requirements: Have 3 (or more) "sections" on a page where users could upload files. They are sectioned only from a UI perspective, to make it obvious what the user needs to upload where - ...
0
votes
1answer
31 views

Calling jQuery plugin methods

I have two code snippets and the following questions: Which uses the best practice and why? Which one is good for performance? Code 1 ...
-2
votes
1answer
22 views

Dependency injection with glob

I have a folder called core with two files inside: index.js and module.js. I'm kidding a little with dependency injection and ES6, and I would like to receive feedback with improvements for my code. ...
1
vote
0answers
23 views

Looping through JSON object with nested for loops

I've written a function that loops though all of the accounts, properties, views, and filters - each 'level' requires another for loop. I'm working with the Google ...
0
votes
0answers
9 views

Javascript: parameter set to null even though value is given [on hold]

I have a problem regarding my smooth scroll function, when I try to call it in my HTML with a parameter, the parameter "doesn't register" and my parameter variable gets null. ...
2
votes
2answers
84 views

Convert string to spinal case

Due to an excercise, I've made a function that converts given string to spinal case just-like-this-one (all lower case). I did it with two regular expressions. Can ...
1
vote
2answers
30 views

jQuery dropdown menu

I wrote this jQuery code as I could for a dropdown menu. But I'm sure there is a way to make this code shorter. ...
4
votes
1answer
54 views

Get all remaining days of the week

What this function does it's to return an array of remaining dates that are e.g. Mondays. Is this really the best way to do that? ...
-3
votes
0answers
14 views

A complete registration process in Javascript [on hold]

I am looking to do a login for this code but I do not know how I could do this. ...
-5
votes
0answers
12 views

Consistency in code [on hold]

I have this program, which will manipulate files, and he have 3 phases: phase01, phase02, phase03, phase04. Which one is a function: ...
3
votes
0answers
26 views

JavaScript Memory Game with Pictures

So, I have a memory game written, but was wondering how I could turn these letters in the cardSet into images (I have a set of images in an images folder within the folder containing this code, called ...
7
votes
1answer
70 views

Breakout game in JavaScript

I decided to make a Breakout game in JavaScript. Is there a way of making it cleaner? For instance, creating objects for the ball and the paddle. ...
7
votes
1answer
56 views

JavaScript date validation

I have a date control which has a dropdown for each date, month and year. The issue is, I can select 31st Nov. 2015 as well, and when I create date object, I get 1st Dec. 2015. Example ...
0
votes
1answer
38 views

Yes/no confirmation buttons on a slide-out panel

I have the following js code and am wondering how I can make it clean. It works fine but there are few repetitions. Is there a way to make it more clean? ...
4
votes
5answers
121 views

Calculating Fibonacci numbers

The following problem is currently taking more than 8 seconds to execute. Please help me to modify the program, so that execution time will be reduced. ...
3
votes
1answer
45 views

Find largest connected cells of value 1 or greater

My goal is to find the largest connected "cell" of 1's in a matrix. My approach has been to search the surrounding area of a cell that is not on a border and then if it hasn't been visited, and has a ...
0
votes
0answers
32 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
17 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
3answers
120 views

Long arithmetic addition in JS

The implementation of the algorithm which adds two number in string form with arithmetic rules. ...
0
votes
1answer
17 views

Simple jQuery tooltip

My tooltip works fine, but I need to simplify this code. ...
1
vote
2answers
34 views

Return array of objects with matching keys

For an exercise, I've written a function that, given an array of objects and a key (2nd argument), returns a new array of objects that contain all properties from a key. How'd I do? ...
0
votes
1answer
11 views

JW Player + Brightcove Integration

The following code gets video renditions from Brightcove using the media API. It then generates an ordered source list for the JW Player and selects the default rendition based on a pre-set bitrate. ...
-2
votes
0answers
25 views

Asynchronous JavaScript code [closed]

good morning, I have the following code: for (var i = 0; i < 8; i++) { async.each([5,6,7,8,9,19,11,12],main, function(err){ console.log("end"); }); }; ...
7
votes
4answers
108 views

Balanced braces

I wanted to write a JavaScript function that checked for balanced braces. I'd be grateful for any feedback on correctness and style. ...
2
votes
1answer
31 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: ...
2
votes
0answers
24 views

Trade off in database efficiency versus a nested for loop on client

I built an app where a user has a recipe box with recipes in it - for the db, there is a user and recipe model, user has "recipeBox" property. The recipebox is an array of objects like so: User ...
2
votes
1answer
41 views

AngularJS code to query DB and update $scope

I have an AngularJS function that is used to determine which $scope associative array variable is to have data pushed into it. I would love to be able to remove the ...
0
votes
0answers
230 views

A plugin that integrates Angular Smart Tables with Mongoose DB for server side pagination

I'm using Angular Smart Tables with data that might become a huge set of documents and rows. So rather than client side processing of the data for pagination, I borrowing code from two Mongoose.js ...
7
votes
1answer
49 views

RGB <-> HSL converter + hue shifting

My input is basically a .png image from the img/ directory (I figured out that I should parse it, because there is an exploit ...
0
votes
1answer
21 views

Backbone view for logging a user in

I'm looking for a general peer review on already working code. Just the overall structure and of course any gotchas like DRYness or logic issues. ...
1
vote
1answer
30 views

Parsing a CSV file in node.js and express.js

I want to import a CSV file and do some operation on it. The following is the code I'm using and it is working fine: ...
1
vote
0answers
48 views

Tic-Tac-Toe in HTML, CSS, JavaScript [closed]

I only started programming this year and have decided to become a web developer. Here is a 6kb HTML, CSS and JavaScript Tic-Tac-Toe game. I haven't fully succeeded in making it look clean or new, or ...
0
votes
1answer
49 views

Script to calculate width, and either resize, show, or hide HTML menu

I have created a script that handles the responsive liabilities of my HTML menu. The menu will have a variable amount of <li class="menu-item">, resulting in ...
2
votes
3answers
70 views

Simple JavaScript timer function

I've written a timer to start when the page loads, and to stop when the user clicks a "finished" button: ...
1
vote
1answer
43 views

Bowling scorecard app

This is one of my first attempts in writing a bowling scorecard app. It can have more than one player. I would like to know if anyone has suggestions to improve the code. I am trying to make it as ...
1
vote
0answers
28 views

Producing configureable web-components

I started working on a personal project to help build better JavaScript skills. This is my first large scale app and I'd like to get some constructive feedback on what I could do differently from ...
2
votes
0answers
22 views

Pomodoro Timer via setTimeout()

I've made my attempt to code timer entirely by hand using jQuery. No external libraries to manage time at all. ...
4
votes
2answers
24 views

Clean Calendar Object

I am writing a small chunk of code (a module>?) that I will use to create a view on a page using angular. The angular directive will take care of generating the html. The sole purpose of this module ...
1
vote
0answers
25 views

Simple registration form in NodeJS

I'm creating a simple registration form, but stuck somewhere. I want to use token variable in new user() scope, but if I put ...