All Questions
Tagged with object-oriented ecmascript-6
58 questions
1
vote
1
answer
140
views
Transform an array into object and set index for an unique key in javascript
I have a method that merges keys and indexes from an array into an object.
I'm stuck with ways to compress this method, and I don't know what I can do to make it simpler.
Goal
get an array of objects ...
2
votes
1
answer
341
views
JavaScript copy-to-clipboard class
I am have made a small copy-to-clipboard script.
I have made a method called copyToClipboard that does the following:
create an input box;
read the content of an ...
2
votes
2
answers
47
views
Combine data from array of objects
I got this data structure and I am checking to see which properties are true, then I am adding the key for all the properties that are true to that object on a new ...
1
vote
2
answers
767
views
Recursively find data in array of objects
On this script I look up properties in an array of objects. There is an original array of strings list to get the objects that match the ...
2
votes
1
answer
134
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 ...
1
vote
1
answer
4k
views
Add / Overwrite an object in an array
I am trying to overwrite an object in an array if the title property exists, otherwise just push it to the array. I found two approaches and I wonder which one is ...
6
votes
1
answer
357
views
JavaScript: A drawing program in OOP
I made a little drawing program in OOP.
The game consists of a canvas which is basically a 2d array where the user can draw various shapes on it. There can be multiple shapes overlapped on top of each ...
1
vote
2
answers
922
views
Create a simple hangman game using OOP and Javascript
I had a task to create a simple hangman game using O.O.P. with Javascript. It had to render the puzzle and remaining guesses to the DOM but didn't require any C.S.S.
This is what I created.
This is my ...
8
votes
3
answers
402
views
Stopwatch interface OOP (Vanilla JS)
I'm learning OOP and the first exercise of the course was to made a Stopwatch class. I did it really fast and decided to make an interface for this little app.
I created the interface. Basically I ...
3
votes
1
answer
55
views
Iterating an Array Object & Assigning the Attributes Values to those that Match the Condition
Is there any approaches to reduce the below coding snippet in Angular 2+ with few lines of code by making use of ECMA Script or by some other ways
...
2
votes
2
answers
79
views
How can I simplify this JQuery validation process?
How can I simplify this functioning JQuery validation process:
...
5
votes
1
answer
192
views
OOP pure JS two Roint Range Slider
I'm currently trying to learn how to OOP in JavaScript by making use of ES6 classes. As an example I created this Slider using classes. I didn't find any class example where the DOM is highly involved
...
4
votes
2
answers
2k
views
Alternative code to classes in Javascript?
I'm new to JavaScript and came across classes in ES6. Though they are great, I don't want to learn something that can be done in other ways. So, I created this code that does somehow similar job to ...
2
votes
1
answer
124
views
Modern HTTP-Requests for login/register system
I am working on a login/register system and want the register and log in process as smooth as possible. One way of making it smoother is in my opinion to make a multi-step login/register.
What I ...
8
votes
3
answers
835
views
Weapon class firing logic in JavaScript
I'm making a program to compare Borderlands 3 weapon damage over time in a graphic. There's still some work to be done, like implementing elemental damage, but I'd like to know if I'm doing a good job ...