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

Warning: unreachable code after return statement - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

Warning: unreachable code after return statement

Warning: unreachable code after return statement (Firefox)
:     return (Firefox)

In this article

?

return :

return, , return , .

return? return , , , , . return.

return , :

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

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

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

function f() {
  return 3 + 4; //OK: return           
}


Web Proxy Viewer  |  New URL  |  Original Page