Explain jQuery's .promise() method and its practical applications.
Instruction: Provide an overview of the .promise() method, including its syntax and a practical example of its use.
Context: This question tests the candidate's understanding of advanced jQuery features related to asynchronous operations and their ability to apply them in real-world scenarios.
Updated
Official answer available
Read the opening below, then unlock the full answer and practical guidance.
On a jQuery collection, .promise(type, target) observes completion of that collection's work for the specified queue type. The default type is fx. It returns a jQuery promise interface, not a native Promise constructor instance.
Use the full build for this effects example. The page should have two visible elements with class tile and a paragraph with id animation-status...