nl_tokens: * @method sortBy ( <map > [ desc ] = false ) @returns Array @short Sorts the array by <map > . @extra <map > may be a function a string acting as a shortcut or blank ( direct comparison of array values ) . [ desc ] will sort the array in descending order . When the field being sorted on is a string the resulting order will be determined by an internal collation algorithm that is optimized for major Western languages but can be customized . For more information see @array_sorting . @example
pl_tokens: function ( map , desc ) { var arr = this . clone ( ) ; arr . sort ( function ( a , b ) { var aProperty , bProperty , comp ; aProperty = transformArgument ( a , map , arr , [ a ] ) ; bProperty = transformArgument ( b , <mask> , arr , [ b ] ) ; if ( isString ( aProperty ) && isString ( bProperty ) ) { comp = collateStrings ( aProperty , bProperty ) ; } else if ( aProperty < bProperty ) { comp = - 1 ; } else if ( aProperty > bProperty ) { comp = 1 ; } else { comp = 0 ; } return comp * ( desc ? - 1 : 1 ) ; } ) ; return arr ; }