voxel / voxel-plugins

an API for loading and enabling plugins in voxel.js with soft dependencies
https://github.com/deathcap/voxel-plugins/wiki
9 stars 2 forks source link

Explain please #6

Closed z3t0 closed 8 years ago

z3t0 commented 9 years ago

Hi could you please explain how this line works, I am still quite new to some things in javascript.

https://github.com/deathcap/voxel-plugins/blob/master/plugins.js#L196

deathcap commented 9 years ago
  return !!(plugin && plugin.pluginEnabled);

!! coerces to boolean, so this returns true if the plugin exists (not a "falsey" value) and is enabled, otherwise false

z3t0 commented 8 years ago

thanks!