JSFiddle - React, Tailwind, and code Playground

HTML

<div id="results"></div>

JavaScript

// Method 1: Create an object with the first array entry as the key
var objLookup = function(arr, search) {
    var o = {}, i, l, first, second;
    
    for (i=0, l=arr.length; i<l; i++) {
        first = arr[i][0];
        second = arr[i][1];
        
        o[first] = second;
    }
    
    return o[search];
}


// Method 2: Loop through array to get index
var indexLookup = function(arr, search){
   var index = -1, i, l;
    
    for (i = 0, l = arr.length; i<l; i++) {
        if (arr[i][0] === search) return arr[i][1];
    }

    return undefined;
}

// Test    
var log = [
    ["comp","Please add company name!"],
    ["zip","Please add zip code!"]
];

$("#results").append(objLookup(log, "zip") + "<br/>");
$("#results").append(indexLookup(log, "comp"));

alert(log.name[0]);