Question: I am trying to make a program that organizes punch-ins from an RFID scanner in google sheets...

When I go to match scan [i] with employee name [j] it never succeeds.

I have a simple if statement:

```
//names[i] is the name of the card for the scan event (card names = employee full name)
var name = names[i];

//the j for loop will check all employee names in the list for a match
var employee = employees[j];
if (name==employee) {
  var ifsuccess = true;
}

```

But I never get ifsuccess to = true... it may be obvious but I have never done programming in google script before (or javascript :P) does anyone know what I've done wrong?

![screenshot](https://i.stack.imgur.com/ytCxG.png)

Answer: 
It looks like you're comparing two Array objects rather than two strings. The screenshot claims that name and employee are indexed arrays with a single element.

To compare the string data inside each Array object:

```
name[0] == employee[0]     // equal value

```

Or the slightly safer:

```
name[0] === employee[0]    // equal value and of the same type

```
Using toString method might help as well:

```
name.toString()==employee.toString()

```

But the other suggestions look cleaner.