Question: So, to make a div (navbar) stay on top of the page I need to have a fixed position. This I know and works fine. But on the current web design I am working on this navbar ends up behind all of the other elements. The difference between now and the previous times is that I am using javascript to modify the placement of the content depending on how the user scrolls. This also works fine but the navbar ends up behind all of these elements. After googling I found that I could use z-index and an absolute or relative position. But I need a fixed one to have it on top..

What is a good way to do this? 
What do I need to have in mind?

I am not sure what is actually relevant here but..

```
#nav {
  position:fixed;
  top:0;
  width:100%;
  height:50px;
  z-index:999;
}

#header {
  position:absolute;
  top:0;
  left:0;
  transition: 0.6s;
}

#wrapper {
  width:100%;
  position:absolute;
  top:45%;
  left:-10px;
  transition: 0.6s;
}

```

Answer: 
You are missing a semicolon after `let mns = 45` to conclude the statement. Without the semicolon to conclude the statement, it would be like trying to pass `(mns === 1)` as an argument to the `let` statement. It would be like the two lines were combined into one: `let mns = 45(mns === 1) ? (output = "true") : (output = "false");`

The second function works because there is no bracket around `msn === 1`, so it won't try to pass it as an argument to the `let` statement.

As a general rule, always remember to add a semicolon after **each** JavaScript statement.

```js
function fd(t) {
  let output = '';
  if (t >= 41) {
    let mns = 45;
    (mns === 1) ? (output = "true") : (output = "false");
  }
  return output;
}

console.log(fd(65));
```

As Xufox suggested in the comments, you could just move the ternary operator to the return statement to avoid ambiguity.

```js
function fd(t) {
     let mns;
      if (t >= 41) {
        mns = 45;
      }
      return (mns === 1) ? ("true") : ("false");
}

console.log(fd(65));
```
That happens because `let` declaration is not concluded yet. To end the declaration use `;` or declare as `var` instead of let. 

```js
function fd(t) {
  let output = '';
  if (t >= 41) {
    let mns = 45;  // note the semicolan or declare it as var
    (mns === 1) ? (output = "true") : (output = "false");
  }
  return output;
}

console.log(fd(65));
```