You need to pass the list of promise objects as as argument list like $.when(p1, p2, p3).then(function())
since in this case you have an dynamic list, you can use .apply() function invoke the $.when() which the dynamic list of parameters
var array = [];
for(var i = 0; i < scripts.length; i++) {
array.push($.getScript(scripts[i]));
}
$.when.apply($, array).done(function(){
//place your code here, the scripts are all loaded.
alert('script loaded');
});