I have an object as :
testArray = [{SId: 1, CModule: "End"},
{SId: 2, CModule: "Slice"},
{SId: 3, CModule: "Std"}]
How to return true if any of the CModule
value is 'End' or return false
I have tried as :
testArray .map(function (CModule) {
if (CModule.CModule.indexOf('End')!==1) {
return true;
}
else{ return flase } };
But this did not work when there is no value as 'End' or if it has no 'End' in its first index value
Any help is much appreciated