openexchangerates / money.js

money.js is a tiny (1kb) javascript currency conversion library, for web & nodeJS
http://openexchangerates.github.io/money.js
MIT License
1.46k stars 127 forks source link

Clarification on JS coding style #12

Open shashankmehta opened 10 years ago

shashankmehta commented 10 years ago

Line no 49 var convert = fx.convert = function(val, opts) {

I'm trying to understand JS coding styles and I found this in money.js as well as underscore.js (you have mentioned it as inspiration the source code).

What's the reason to have a local variable convert when you could have just used fx.convert in it's place?