title: How to validate a EAN / GTIN barcode in JavaScript
body: <p>How can I check if a string is a valid EAN / GTIN barcode in JavaScript?</p>
  
  <p>I need checks for EAN8, EAN12, EAN13, EAN14, EAN18 and also GTIN12, GTIN13, GTIN14.</p>