All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.javascript.rules.javascript.S1530.html Maven / Gradle / Ivy

There is a newer version: 10.17.0.28100
Show newest version

Why is this an issue?

While most script engines support function declarations within blocks, from browser to browser, the implementations are inconsistent with each other.

Noncompliant code example

if (x) {
  function foo() {} //foo is hoisted in Chrome, Firefox and Safari, but not in Edge.
}

Compliant solution

if (x) {
  const foo = function() {}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy