To turn a normal Html select into a select2 the documentation says to simply call select2() on the normal Html select like this
$(document).ready(function() {
$('.js-example-basic-single').select2();
});
When I tried this out, I also imported the select2 module that I installed via npm.
import select2 from 'select2';
What is name of the Javascript feature / concept / technology that allows one to add a new function (in this case .select2()) to an existing object?
Update I forgot to mention that I'm using jquery which is what BJRINT picked up. So it seems this is a jquery + select2 thing.