JSON Filter return null

El *_*bre -1 javascript arrays array-filter typescript

I´m trying to filter JSON array in Angular like this

JSON

1 46 3 2 48 4
Run Code Online (Sandbox Code Playgroud)

FILTER

   var test = this.users.filter(element => {
            element.id === 1;
          });
Run Code Online (Sandbox Code Playgroud)

The problem is 'test' variable return null in every cases. As we can see the 'id' 1 exist, so theoretically should return data. ¿Anybody know what is wrong in this code?

UPDATE

Full JSON response

  {id: 1, usuario: "alara", nombre: "alara", password: null, apellidos: "alara", …}
  {id: 46, usuario: "ale", nombre: "ale", password: null, apellidos: "ale", …}
  {id: 3, usuario: "jorge", nombre: "jorge", password: null, apellidos: null, …}
  {id: 2, usuario: "apple", nombre: "apple", password: null, apellidos: null, …}
  {id: 48, usuario: "arsontech", nombre: "arsontech", password: null, apellidos: null, …}
  {id: 47, usuario: "Pedro", nombre: "pedro", password: null, apellidos: "Bilbao", …}
Run Code Online (Sandbox Code Playgroud)

小智 6

var test = this.users.filter(element => {
        element.id === 1;
      });
Run Code Online (Sandbox Code Playgroud)

You don't return anything.

var test = this.users.filter(element => element.id === 1);
Run Code Online (Sandbox Code Playgroud)

Should work better. Or you can also use this :

var test = this.users.filter(element => {
  return element.id === 1;
});
Run Code Online (Sandbox Code Playgroud)