Skip to content

Detect unreachable code #4

@juanjoDiaz

Description

@juanjoDiaz
const myFunction = (x) => {
  if(x>0){
    return "ok"
  } else {
    throw "not ok"
  }

  if(x>0){
    return "ok"
  } else {
    throw "not ok"
  }
}

The second if is unreachable so it will never be executed and it shouldn't be printed or be printed highlighting that it's unreachable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions