ondras / rot.js

ROguelike Toolkit in JavaScript. Cool dungeon-related stuff, interactive manual, documentation, tests!
https://ondras.github.io/rot.js/hp/
BSD 3-Clause "New" or "Revised" License
2.33k stars 254 forks source link

Extend javascript object and classes safely (don't reinvent the wheel) #72

Closed Zorgatone closed 9 years ago

Zorgatone commented 9 years ago

Checks if the class to extend already implements the new features.

Example:

Array.prototype.random = Array.prototype.random || function() {}; // [...]
ondras commented 9 years ago

Makes sense, thanks!

Zorgatone commented 9 years ago

You're welcome. Nice work, I like this library