I am looking at jquery.ui-1.8.11.js:
$.extend(Datepicker.prototype, {
/* Class name added to elements to indicate already configured with a date picker. */
markerClassName: 'hasDatepicker',
/* Debug logging (if enabled). */
log: function () {
if (this.debug)
console.log.apply('', arguments);
},
What is that log: function() syntax? What’s it called? How can it be used?
The second argument to an
$.extendcall is an Object. They’re defined using curly braces{}and takekey: valuepairs. The value can be a function, which is what is happening for thelog.This is analogous to the following:
You can later call
myObject.method1()to perform whatever the code inside the function is.