var items = ["Item 1", "Item 2", "Item 3"]; var firstItem = typeof items[0] !== "undefined" ? items[0] : null; console.log(firstItem);