To accomplish that, the best way is to use a constant that have the URL of your plugin
if ( !defined( 'XXXXXX_PLUGIN_URL' ) )
define( 'XXXXXX_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
and then use it to tell the url like this.
XXXXXX_PLUGIN_URL.'js/something.js'
For e.g:
wp_enqueue_script( 'some_script', # ID the the script to enqueue
XXXXXX_PLUGIN_URL.'js/something.js', # Url
array( 'jquery' ), # Dependencies
'12345', # version
true ); # I load on footer
Written with StackEdit.