[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Errors/Stmt_after_return [Back]  [Original]

Warning: unreachable code after return statement - JavaScript | MDN

MDN Web Docs

View in English Always switch to English

Warning: unreachable code after return statement

return JavaScript unreachable code after return statement

Warning: unreachable code after return statement (Firefox)

return

return return

return return return return

return

js
function f() {
  let x = 3;
  x += 4;
  return x;   // return 
  x -= 3;     // 
}

function g() {
  return     //  `return;`
    3 + 4;   // 
}

js
function f() {
  let x = 3;
  x += 4;
  x -= 3;
  return x; // OK
}

function g() {
  return 3 + 4 // OK
}


Web Proxy Viewer  |  New URL  |  Original Page