3876 ? window.innerHeight
3877 : this._scrollElement.getBoundingClientRect().height;
3878 }),
3879 (e._process = function () {3880 var t = this._getScrollTop() + this._config.offset,
3881 e = this._getScrollHeight(),
3882 n = this._config.offset + e - this._getOffsetHeight();
3193 (e.toggleEnabled = function () {
3194 this._isEnabled = !this._isEnabled;
3195 }),
3196 (e.toggle = function (t) {3197 if (this._isEnabled)
3198 if (t) {
3199 var e = this.constructor.DATA_KEY,
3067 var i = new window.DOMParser().parseFromString(t, "text/html"),
3068 o = Object.keys(e),
3069 r = [].slice.call(i.body.querySelectorAll("*")),
3070 a = function (t, n) {3071 var i = r[t],
3072 a = i.nodeName.toLowerCase();
3073 if (o.indexOf(i.nodeName.toLowerCase()) === -1)
2852 !t)
2853 )
2854 return;
2855 if (!n) return void t();2856 var o = l.getTransitionDurationFromElement(this._backdrop);
2857 i.default(this._backdrop)
2858 .one(l.TRANSITION_END, t)
2506 n = l.getSelectorFromElement(t);
2507 return n && (e = document.querySelector(n)), e || t.parentNode;
2508 }),
2509 (t._dataApiKeydownHandler = function (e) {2510 if (
2511 !(/input|textarea/i.test(e.target.tagName)
2512 ? e.which === 32 ||
Any code paths that do not have explicit returns will return undefined
.
It is recommended to replace any implicit dead-ends that return undefined
with a return null
statement.
As a convention, undefined
signals that an unexpected value has been produced as the
result of a logical error in the program.
A null
return, on the other hand, signals that the input to a function was incorrect,
or a value was 'not found'.
Having this distinction in code helps you figure out if something was caused because of a logical error, or malformed input to a function call.
function getUser(name) {
if (userExists(name)) {
return userDb.get(name);
}
// whoops! Implicit undefined return
}
function readFile(fileName) {
if (fs.existsSync(fileName)) {
return fs.readFileSync(fileName, 'utf-8');
}
return; // Implicit undefined return.
}
function getUser(name) {
if (userExists(name)) {
return userDb.get(name);
}
// `null` indicates there is no such user.
return null;
}
function readFile(fileName) {
if (fs.existsSync(fileName)) {
return fs.readFileSync(fileName, 'utf-8');
}
// `null` indicates there is no such file.
return null;
}