rspec/rules/S1520/rule.adoc

22 lines
402 B
Plaintext
Raw Normal View History

Giving both a variable and a function with the same name in a single scope should be avoided. This usage is confusing and should be avoided because it will be unclear whether the named variable refers to the function or to something else.
== Noncompliant Code Example
2022-02-04 17:28:24 +01:00
[source,text]
----
var fun;
function fun() {
}
----
== Compliant Solution
2022-02-04 17:28:24 +01:00
[source,text]
----
var fun = function fun() {
}
----