code: function lookup(tag, range) {
    var pos
  
    tag = lower(tag)
    range = lower(range)
  
    while (true) {
      if (range === asterisk || tag === range) {
        return true
      }
  
      pos = range.lastIndexOf(dash)
  
      if (pos === -1) {
        return false
      }
  
      if (pos > 3 && range.charAt(pos - 2) === dash) {
        pos -= 2
      }
  
      range = range.substring(0, pos)
    }
  }
docs: Lookup (Section 3.4) matches a language priority list consisting of basic language ranges to sets of language tags to find the one exact language tag that best matches the range.