10106 }),
10107 (MenuHighlight.prototype.onResize = function () {
10108 for (
10109 var anchor, index = 1, count = this.anchors.length;10110 index < count;
10111 index++
10112 ) {
9735var typedoc
9736var typedoc
9737var typedoc
9738var typedoc 9739!(function (typedoc) {
9740 typedoc.$html = $('html')
9741 const services = []
9734var typedoc
9735var typedoc
9736var typedoc
9737var typedoc 9738var typedoc
9739!(function (typedoc) {
9740 typedoc.$html = $('html')
9733var typedoc
9734var typedoc
9735var typedoc
9736var typedoc 9737var typedoc
9738var typedoc
9739!(function (typedoc) {
9732var typedoc
9733var typedoc
9734var typedoc
9735var typedoc 9736var typedoc
9737var typedoc
9738var typedoc
Declare variables at the top of their scope as it improves code readability, performance and also helps in code navigation.
The vars-on-top
rule generates warnings when variable declarations are not used serially at the top of a function scope or the top of a program. By default variable declarations are always moved (“hoisted”) invisibly to the top of their containing scope by the JavaScript interpreter. This rule forces the programmer to represent that behavior by manually moving the variable declaration to the top of its containing scope.
// Variable declarations in a block:
function doSomething() {
var first;
if (true) {
first = true;
}
var second;
}
// Variable declaration in for initializer:
function doSomething() {
for (var i=0; i<10; i++) {}
}
function doSomething() {
var first;
var second; //multiple declarations are allowed at the top
if (true) {
first = true;
}
}
function doSomething() {
var i;
for (i=0; i<10; i++) {}
}