While reading Oliver Steele’s article on JavaScript Memoization this bit jumped out at me. function Angle(radians) {this.setRadians(radians)} Angle.prototype.setRadians = function(radians) { this.radians = radians; this.getDegrees.reset(); }; Angle.prototype.getDegrees = function() { return this.radians * 180 / Math.PI; } memoizeConstantMethod(Angle.prototype, ‘getDegrees’); The reason that jumped out is that getDegrees is a function that returns a number, but in the above code you see [...]
About
My name is Peter Williams. I am a father and software developer. (I do a few other things, of course, but family and software are what I am most passionate about.) This blog is primarily a place where I can rant without scaring too many people, but occasionally I record things of interest to my family here.
more about ยปProjects
-
Recent Comments
- Blaine LaFreniere on Ruby Backtraces
I would love to see this. …
- Jeremy Brooks on Java Daemon
Sorry, forgot to include my solution for capturing stderr/stdo …
- Jeremy Brooks on Java Daemon
Good post. The only downside I can see here is that you might …
- Simon on PHP Markdown with Footnotes
Is there a complete multimarkdown plugin for WordPress? I woul …
- Sachin Jain on Java Daemon
Hi I am using a client server program for my project. …
- Blaine LaFreniere on Ruby Backtraces
People I know
