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
1
vote
1answer
86 views

list of games to open radar match in iframe on for drop-down controls

In general my page is slow and has several points in the code that I believe can be improved, even in relation to the structure used. Anyway, the biggest problem is: The page I'm creating is very ...
2
votes
2answers
18 views

group computed properties in vue component

I have the following vue component which all works fine ...
1
vote
0answers
27 views
2
votes
1answer
40 views

Filter Options in React

I have several products. A product can have 1 or more images. In each image, we have content slot. I don't want duplication per content slot in a product. My code works fine. I'm just wondering what ...
6
votes
5answers
237 views

Extracting a part of a URL path

I have a string like the one below from which I am extracting the tariff name. ...
3
votes
2answers
86 views

Tic Tac Toe in object oriented JavaScript

I've been working on a course assignment for 'The Odin Project' and was hoping to get a review of my code. As per the help guide, the code is fully functional. The criteria for this was pretty ...
0
votes
2answers
67 views

Processing list of users- filtering out from refused list

The code below takes a list of users and displays two lists Refused users Admitted users Sample output: Refuse: Phil, Lola. Admit: Chris, Anne, Colin, Terri, Sam, Kay, Bruce. Any feedback is ...
11
votes
3answers
1k views

Draw sine wave going around a circle

I have used d3 to draw a sine wave going around a circle. This is the very first time I've used d3 or drawn a SVG and I'm fairly new to JS as well, so I don't know if I've overcomplicated it/if there ...
3
votes
4answers
14k views

Getting the index of a character within the alphabet

I've made this function to map alphabetic coordinates to their corresponding ordinal number. ...
14
votes
6answers
1k views

Creating cards for a game of SET

I'm creating cards for a game of SET. Can the following be rewritten in a more programmatic way, possibly getting rid of the embedded for loops? ...
5
votes
1answer
3k views

Merge Two Sorted Lists in JavaScript

The task is taken from LeetCode Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Example 1: ...
3
votes
0answers
42 views

Progressive bar service in Vue

I am learning Vue after working for some time with Angular and I'd like to hear experienced programmers concerning the implementation of my Progressive Bar service (in Vue it's called Plugin). The ...
5
votes
1answer
109 views

Generate all partitions of a set of items

Here are the items: var item = ['a', 'b', 'c', 'd']; Desired output: ...
3
votes
2answers
268 views

PHP blogging application with AJAX loading

I have been working on an online newspaper/blogging application with CodeIgniter 3.1.8 and Twitter Bootstrap 4. The latest feature added is lazy loading of posts. From the Static_model (...
7
votes
1answer
2k views

Given a string containing just parentheses, determine if the input string is valid

The task is taken from leetcode Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: ...
3
votes
2answers
156 views

Check for max value in stack

Got this problem in a coding interview - Get the max value of a stack in O(1). The stack contains numbers only. Please review my solution. ...
6
votes
2answers
138 views

Starship Comparison App with ES6 Generators and the Star Wars API

Assignment Description: Make a web application that compares starships based upon the Star Wars API. There shall be: A label "Select two Starships from the dropdown lists to compare". Two dropdown-...
0
votes
1answer
47 views

custom array sorting algorithm

So I came up with a "new" sorting algorithm: ...
3
votes
1answer
1k views

Shortest way to form a string out of a subsequence of a string

The task is taken from LeetCode (subscription required) - From any string, we can form a subsequence of that string by deleting some number of characters (possibly no deletions). Given two strings ...
2
votes
1answer
82 views

Learning asynchronous caching by implementing one

After implementing a serial CLOCK second-chance cache in C++ without having enough rope to shoot myself in the foot, decided to dive into Javascript through NodeJs and write an asynchronous one. I ...
2
votes
1answer
54 views

Client side authorization when retrieving from server

I have an endpoint to retrieve the user's authorization based on Joseph Silber's Bouncer. I have a global can() function. It creates a unique key based on the ...
1
vote
2answers
51 views

Javascript - On mouseup check if any of the parents has/includes specific id

On my page I have a mouseup eventlistener on document. I want to be able catch if the clicked elements has a specific ...
5
votes
1answer
272 views

JavaScript discrete slider web component

The standard HTML range input element suffers from a number of limitations that caused me to implement the web component presented here. First, it is unnecessarily complicated to style the standard ...
3
votes
3answers
1k views

Simple javascript code to create an image caption

I'm trying to become better at javascript and have written a simple script that just creates some html from getting some details from some elements (e.g. the image alt text) and inserts it onto the ...
4
votes
3answers
2k views

Reverse Integer

The task is taken from leetcode Given a 32-bit signed integer, reverse digits of an integer. Example 1: Input: 123 Output: 321 Example 2: ...
12
votes
3answers
367 views

MMMRjs a product of BYTES Genesis

We have published a product today called MMMR.js this product is licensed under the MIT license and is built by Syed Mohammad Sannan. The uniqueness of this product is that it is built with and for ...
3
votes
1answer
428 views

JS + CANVAS Projectile Motion

Basically you've got a canvas, and you can click it to launch a ball in a certain angle and speed, everything is working fine, except for the arrow tip of the vector thing. I can't get it to draw ...
1
vote
1answer
48 views

Learning Javascript OOP with a Collapsing Item Class

I'm trying to get into object oriented javascript programming. I have written a class for collapsible elements as a test. These elements all have a certain class and no matter how many elements there ...
3
votes
2answers
61 views

Limit second <select> options based on the first <select>

I want to see if there's a better way to write this code, solely in Javascript. There are two kinds of sets, the first set (C7, T7, C11, T11) have four options in the first select, and then up to two ...
1
vote
1answer
749 views

Find busiest period in building

The task You are given a list of data entries that represent entries and exits of groups of people into a building. An entry looks like this: {"timestamp": 1526579928, count: 3, "type": "...
3
votes
2answers
128 views

Single user Electron application allowing basic CRUD operation on a table (stored in JSON)

I am completely new to JavaScript and I will be grateful for your comments on my Electron app (electron is a JS framework allowing to create of desktop apps). I needed to create an application that ...
2
votes
2answers
71 views

JS script fetching GitHub API for personal website

I've built a very simple personal website, everything is in a single file because it is very straightforward, but I think the JS script could be better structured. All it does is fetch some repos from ...
1
vote
3answers
117 views

Run-length coder

I have this code, which counts only adjacent letters in a string and returns the count of each letter. ...
1
vote
1answer
57 views

Recursively access deeply nested object

Problem Statement I need to access a deeply nested object. I could've used a 3rd party util such as Lodash but insisted myself on writing a Vanilla JS solution with a recursive strategy. Code Can this ...
2
votes
1answer
270 views

To-do app front-end in Vue 3

I have put together a To-do Application with the Slim framework on the back-end (API) and a Vue 3 front-end. I added a demo on my YouTube channel. In the main App.vue file I have: ...
3
votes
2answers
151 views
4
votes
2answers
140 views

File naming (two files cannot have equal names)

This is a challenge I completed at CodeSignal. You are given an array of desired filenames in the order of their creation. Since two files cannot have equal names, the one which comes later will have ...
12
votes
5answers
2k views

Vue.js search functionality

In my BlogList.vue component I made a search input field: ...
4
votes
3answers
403 views

N-Repeated Element in Size 2N Array

The task is taken from leetcode In a array A of size 2N, there are N+1 unique elements, and exactly one of these elements is repeated N times. Return the element repeated N times. ...
10
votes
4answers
1k views

Restructuring JSON to create a new JSON where properties are grouped according to similar values

I have a JSON structure in the following example format: ...
2
votes
0answers
44 views

Custom HTML Element with scrolling text

A junior developer here. I wrote a simple javascript custom element code here: https://codepen.io/rndbox/pen/mdWxryw as clean as I could with some advice from Junior Vs Senior Code - How To Write ...
3
votes
2answers
59 views

concise way to build an object from an array of objects

The following code is working as expected but I'm wondering if there's a way to use Object.assign, or some other approach, to build the ...
4
votes
2answers
562 views

Vue.js checkout stepper

I have made this small checkout stepper with Vue (v 2.x.x): ...
1
vote
1answer
60 views

A (deep) cloning method for ES-Objects

I have written a (recursive) deep clone method for ES/JS-objects. It seems to work fine, but maybe I'm missing things. Please, feel free to comment! Note: the method will not clone cyclic structures. ...
4
votes
0answers
171 views

Find the starting indices of all occurrences of the pattern in the string - KMP algorithm follow-up

The task was initially solved here, but was too buggy: Given a string and a pattern, find the starting indices of all occurrences of the pattern in the string. For example, given the string "...
2
votes
2answers
64 views

How can I simplify this JQuery validation process?

How can I simplify this functioning JQuery validation process: ...
3
votes
1answer
143 views

Node backend to run user-submitted code in a virtual machine

As per the title, I'm making a webapp that is intended to use as a JS exercise platform. Problems are shown to users, they submit code, that code is run against a few test cases, and a report of the ...
4
votes
1answer
150 views

Randomly rearrange table rows without unnecessary reflows

I recently completed a coding challenge for a company that did not get me to the next stage. They were kind enough to provide the following feedback: The coding assignment does not match what we are ...
7
votes
1answer
2k 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 ...

1
2 3 4 5
14