What are AngularJS promises, and how are they used with $q?

AngularJS promises with $q are used for asynchronous operations. $q allows the creation, resolution, and chaining of promises in Angular applications.

const deferred = $q.defer();