All Questions
Tagged with object-oriented javascript
35 questions
24
votes
3
answers
3k
views
Simple object-oriented calculator
After studying several ways of doing OOP in JavaScript I think I finally came up with one that seems OK to me. Is it okay? Do you see some problems I can face by using OOP in JavaScript like this?
...
6
votes
2
answers
432
views
Simple object-oriented calculator - follow-up
This question is an improvement I did based on recommendations from this other question: Simple object-oriented calculator
JSFiddle
...
3
votes
2
answers
4k
views
Javascript based War card game
I'm working on a game of War for a potential employer and I was hoping someone could review my code and provide feedback on my code.
HTML/CSS
...
3
votes
1
answer
303
views
Simple object-oriented calculator - part 3
This question is an improvement I did based on recommendations from these other questions:
Simple object-oriented calculator
Simple object-oriented calculator - follow-up
To those looking this ...
2
votes
1
answer
3k
views
Javascript based War card game - final
This will be my last submission of this project for review as it's being submitted this evening. I have updated my code based on feedback from other users. I would appreciate any and all feedback ...
1
vote
1
answer
388
views
JavaScript-based War card game - follow-up
Original Question
I have updated my code based on feedback from other users and am submitting this question for re-evaluation.
HTML
...
16
votes
1
answer
4k
views
Should I put default values of attributes on the prototype to save space?
Suppose I've got a JavaScript function that I'm treating like a class - that is, I want to make many instances of it:
...
10
votes
2
answers
478
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 the ...
10
votes
3
answers
764
views
JavaScript OOD: 2048
I wrote a 2048 game in JavaScript with an object-oriented paradigm. The game board is presented with a two-dimensional array and each tile holds an integer.
Here is the implementation:
...
8
votes
1
answer
797
views
Creating Inheritance hierarchy using function constructor
Problem statement
You need to create the Animal base class having four fields:
a. name
b. ...
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 ...
8
votes
1
answer
603
views
SVG mosaic creator
Although my code works as expected, there are a few gotchas.
A single row is not filled at once; instead, I can see partially filled rows during the rendering process(Fixed in the updated code below.)....
7
votes
5
answers
4k
views
Find number repeated odd times in array
I completed the following exercise:
You are given an array of repeating numbers. All numbers repeat in an even way, except for one. Find that odd occurring number.
...
7
votes
1
answer
215
views
Multiple inheritance pattern for vehicle information
I wanted an easy way to augment objects, by adding functionality from any other object(s). More importantly, I needed a way to augment the object from multiple sources in a clean one-line solution.
...
7
votes
1
answer
223
views
JS stopwatch using the observer pattern
I'm learning OOP and also trying to learn and implement some design patterns.
This question is a follow-up of Stopwatch interface OOP (Vanilla JS)
The app is available in https://nacho-p5.github.io/
...