I have the following function:
function(){
add: function(x, y){
return console.log(x + y);
}
}
How do I define()
this as an AMD (Asynchronous Module Definition) compatible module using require.js
and then use it in the browser?
I'm looking specially for an example using jsfiddle
to show it works in the browser directly.