Skip to main content
added 238 characters in body
Source Link
Nina Scholz
  • 387.9k
  • 26
  • 367
  • 417

Please change it to: Array.prototype.some()

The some() method tests whether some element in the array passes the test implemented by the provided function.

function isInSupplier(idsupplier) { return suppliers.some(function(object) { if (object._id == idsupplier) { console.log("TRUE"); return true; }; }); } 

or without console output

function isInSupplier(idsupplier) { return suppliers.some(function(object) { return object._id == idsupplier; }); } 

Please change it to:

function isInSupplier(idsupplier) { return suppliers.some(function(object) { if (object._id == idsupplier) { console.log("TRUE"); return true; }; }); } 

or without console output

function isInSupplier(idsupplier) { return suppliers.some(function(object) { return object._id == idsupplier; }); } 

Please change it to Array.prototype.some()

The some() method tests whether some element in the array passes the test implemented by the provided function.

function isInSupplier(idsupplier) { return suppliers.some(function(object) { if (object._id == idsupplier) { console.log("TRUE"); return true; }; }); } 

or without console output

function isInSupplier(idsupplier) { return suppliers.some(function(object) { return object._id == idsupplier; }); } 
Source Link
Nina Scholz
  • 387.9k
  • 26
  • 367
  • 417

Please change it to:

function isInSupplier(idsupplier) { return suppliers.some(function(object) { if (object._id == idsupplier) { console.log("TRUE"); return true; }; }); } 

or without console output

function isInSupplier(idsupplier) { return suppliers.some(function(object) { return object._id == idsupplier; }); }