I'm doing a tuts tutorial on intel xdk and parse and one of the source files has this syntax I've never seen anywhere. The file itself opens with a function that not only has no name, but is declared inside regular parentheses. Can someone explain and/or link to some online resource that explains this?
(function (credentials) {
var exports = {};
var baseUrl = 'https://api.parse.com/1/classes/article/';
exports.articles = function (params) {
params = params || {};
var artID = '';
if (params.ID) {
artID = params.ID;
}
var url = baseUrl + artID;
return $.ajax({
url: url,
headers: {
'X-Parse-Application-Id' : credentials.apiKey,
'X-Parse-REST-API-Key' : credentials.apiSecret
}
});
};
return exports;
})