Question: I don't understand why my second `else if` statement never runs. Can someone explain it to me?

```js
Name = window.prompt("Tell your First Name");

if (Name.endsWith('X') == true || Name.endsWith('x') == true) {
  meh = Name.slice(0, -1)
  console.log(meh)
} else if (Name.startsWith('X') == true || Name.startsWith('x') == true) {
  hello = Name.slice(1)
  console.log(hello)
} else if (Name.startsWith('X') == true || Name.startsWith('x') == true && Name.endsWith('X') == true || Name.endsWith('x') == true) {
  var result = Name.slice(1) && Name.slice(0, -1);
  console.log(result)
} else {
  console.log(Name)
}
```

Answer: 
Your code needs to start with most specific and go to the least. The code will not check all cases and figures out what is the best match, it starts from the top and first thing it matches it exits.

```js
const firstName = window.prompt("Tell your First Name");

const endsWith = firstName.toUpperCase().endsWith('X');
const startsWith = firstName.toUpperCase().startsWith('X');

if (startsWith && endsWith) { console.log('starts and ends'); }
else if (startsWith) {console.log('starts'); }
else if (endsWith) {console.log('ends'); }
else {console.log('nope'); }
```
1. You should move `startsWithX && endsWithX` to be first condition, otherwise one of above will take it's place
2. Convert your string to lowercase (or uppercase) and remove need for double check of `X` and `x`

```js
Name = window.prompt("Tell your First Name").toLowerCase();

console.log('Answer: ', Name);

if (Name.startsWith('x') == true && Name.endsWith('x') == true) {
  var result = Name.slice(1) && Name.slice(0, -1);
  console.log('Starts and ends with X', result)
} else if (Name.endsWith('x') == true) {
  meh = Name.slice(0, -1)
  console.log('Ends with X', meh)
} else if (Name.startsWith('x') == true) {
  hello = Name.slice(1)
  console.log('Starts with X', hello)
} else {
  console.log('Default', Name)
}
```