Skip to main content

All Questions

Filter by
Sorted by
Tagged with
2 votes
0 answers
95 views

what should be the best approach to follow DRY principle here

My first component ...
Dewanshu's user avatar
  • 129
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 ...
ReeseyCup's user avatar
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: ...
Gabriel's user avatar
  • 121
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 ...
OracleOfNJ's user avatar
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 <...
overexchange's user avatar
  • 3,401
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. ...
overexchange's user avatar
  • 3,401
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: ...
Viacheslav Kondratiuk's user avatar
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 ...
minisaurus's user avatar
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. ...
Data's user avatar
  • 206
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 ...
Merc's user avatar
  • 531
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 ...
Eric Uldall's user avatar
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 ...
Matthew.Lothian's user avatar
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 ...
user3546614's user avatar
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, ...
cwohlman's user avatar
  • 151
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 ...
Jack Wilsdon's user avatar
  • 1,661

15 30 50 per page