我有这个代码块,我发现它特别长且难以理解:调用堆栈中充满了隐式函数和隐式添加的参数。换句话说,我想通过将 each 中调用的函数与 each 本身分开来澄清我的代码。
看那个例子:
$(xml).find('group').each(function () {
var groupName = $(this).attr('name');
// There is here around 100 lines of codes I would like to split in
// at least five functions, And I'm sure it is possible to use named functions
// instead of implicit ones, no ?