All Questions
18 questions
2
votes
0
answers
95
views
what should be the best approach to follow DRY principle here
My first component
...
0
votes
1
answer
432
views
Revealing module pattern modified for more class-like behavior
I've recently been learning about the revealing module pattern, and it seems like a really good way to structure code in many cases. However, I find myself wanting to use it like a class, so I'm ...
2
votes
1
answer
41
views
Draggable toolbar header class, inheriting from a draggable parent class
I have written a draggable parent class using a module pattern:
...
2
votes
0
answers
350
views
Mortgage calculator in JavaScript
I'm learning JavaScript and decided to build this mortgage calculator as a starting point. For the most part it was reasonably straightforward, but when I implemented the graphs using D3 I found ...
4
votes
2
answers
253
views
Follow up - Creating Inheritance hierarchy using function constructor
In continuation with this question,
Animal class has four fields:
name
sound
<...
8
votes
1
answer
801
views
Creating Inheritance hierarchy using function constructor
Problem statement
You need to create the Animal base class having four fields:
a. name
b. ...
4
votes
1
answer
86
views
Grids, Cells, and Inheritance
I want to build a grid and I have 2 concepts: Grid which is consist of Cell.
Grid class is:
...
6
votes
1
answer
645
views
Creature generator
Originally posted this here, and it was helpfully suggested to post in this forum.
In the past couple of years I've returned part time to programming after a 15 year gap. I was C/UNIX. So, I've ...
7
votes
1
answer
218
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.
...
9
votes
1
answer
1k
views
Multiple inheritance with JavaScript with support of calling of super() methods
I have just finished working on a Node.JS module that provides "multiple inheritance that works". I had some really specific requirements:
Works in safe mode
Auto-calling of parent constructors
Makes ...
5
votes
1
answer
125
views
Object.extends in JS
I built an easy inheritance implementation for JavScript that works similar to other OO languages and wanted some feedback on it. This works perfectly how I'd like it to, but I've read a lot of ...
3
votes
0
answers
171
views
Implement.js JavaScript module pattern
I have been playing with a new JavaScript module pattern to see what I can come up with. I think it's quite powerful and wanted to know if it is something people would find useful?
I'm looking for ...
1
vote
1
answer
54
views
Simple inheritance with functions in subclasses [closed]
It seems like there are many ways implementing inheritance in JavaScript. Which version do you prefer or would you suggest another solution?
The code should run in IE8+ so my first version would not ...
5
votes
1
answer
2k
views
Prototype inheritance with Knockout observables
I'm trying to write a JavaScript library to allow inheritance with knockout.
The fundamental problem when implementing inheritance in Knockout is that each Knockout observable is its own instance, ...
6
votes
3
answers
237
views
Object inheritance
I have written some example code to test object inheritance, but I'm not sure if it's really the best way for an object to inherit another's functions (like Java's ...