Prefix in array

by David Santiago

JavaScript

const region = [
  "10",
  "21", 
  "08", 
  "18", 
  "12",
  "17",
  "24", 
];

const code = "00"

const notSupportedRegionIndex = region.some(
    (regionPrefix) => code.startsWith(regionPrefix)
  );
  
  console.log(notSupportedRegionIndex);