Calling `select2('data')` will return a JavaScript array of objects representing the current selection. Each object will contain all of the properties/values that were in the source data objects passed through `processResults` and `templateResult` callbacks.
It is possible to extend the `<option>` elements representing the current selection(s) with HTML `data-*` attributes to contain arbitrary data from the source data objects:
>>>> Do not rely on the `selected` attribute of `<option>` elements to determine the currently selected item(s). Select2 does not add the `selected` attribute when an element is created from a remotely-sourced option. See [this issue](https://github.com/select2/select2/issues/3366#issuecomment-102566500) for more information.