i am new in javascript and i have to understand an appcelerator project. in appcelerator we need to code in java script.
var winForm = (function() {
var API = {};
API.list = [
{
title:'title1', hasChild:true, color:'#9B0B0B',font:'font'
},
{
title:'title2', hasChild:true, color:'#9B0B0B',font:'font'
},
{
title:'title3', hasChild:true, color:'#9B0B0B',font:'font'
}
];//end winList
return API;
})(); //end
module.exports = winForm;
- what type of function is this?
- what is this ‘{}’ initialization?
- what we are doing in API.list?
- how to call this function and list.
- what is this exports?
Sorry for asking so much questions in one post.
listis being set to an array (that’s the[ ... ]notation) consisting of 3 objects. Each object has 4 properties,title,hasChild,color, andfont, with the respective values.winForm(which is then stored inmodule.exports).moduleobject, whatever that is.You should take the time to learn more about how javascript works. I recommend http://javascript.info/ as a great ramp up.