Checking local position of an entity

I would like to check whether an entity is in a certain local position, and display and alert if it is. This is my code -

alert(this.entity.getLocalPosition()); // in first script to check the entity's local position

if (this.entity.getLocalPosition() === [3.4754323959350586, 1.8331623077392578, 0.6039273738861084]){
        alert("Success");
} // in the second script to check whether the entity is in that particular position.

I really don’t understand why this simple piece of coding is not working. Help would be much appreciated.