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