define([], function() {
return {
play : play,
stop : stop,
pause : pause,
rewind : rewind,
fastForward : fastForward
};
function play() {
///
}
function stop() {
///
}
function pause() {
///
}
function rewind() {
///
}
function fastForward() {
///
}
});
as opposed to:
define([], function() {
return {
play : function() {
///
},
stop : function() {
///
},
pause : function() {
///
},
rewind : function() {
///
},
fastForward : function() {
///
}
};
});
If those methods grow, then you would have to scroll all the way to the bottom of the file to even know that the file had a fastForward
method.
With the revealing module, the definition of fastForward
,and the implementation are at seperate parts in the file.