I need to set an array of data after initializing select2. So I want to make something like this:
var select = $(\'#select\').select2({}); select.data([ {id: 1
For v4 you'll have to destroy and reconstruct select2 with updated data. Check https://github.com/select2/select2/issues/2830