javascript how to raise the error

JavaScript
  if (..condition..) {
    throw 'Error message';
  }
Source

Also in JavaScript: