throw example in javascript Example: javascript how to raise the error if (..condition..) { throw 'Error message'; }