title: How to console log elements with upper case in an array
body: <p>I am trying to log to the console the upper case element however, the console throws this error each time: TypeError: arrayNames[i].toUpperCase is not a function</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var hello = "Hello, ";
  var arrayNames = [];
  
  function greet(name) {
  
    if (name == null) {
  console.log(hello + "my friend");
    }
  
    //Requirement UpperCase
    arrayNames.push(name);
    for (var i = 0; i &lt; arrayNames.length; i++) {
  if (arrayNames[i] === arrayNames[i].toUpperCase()) {
    console.log(hello.toUpperCase() + arrayNames[i].toUpperCase());
  }
    }
    //Requirement last element
  
    if (arrayNames.length &gt; 1) {
  var lastElement = arrayNames.pop();
  console.log(hello + arrayNames + " and " + lastElement);
    }
    else {
  console.log(hello + arrayNames);
    }
  
  }
  
  greet(["James", "Julie", "BEN"]);</code></pre>
  </div>
  </div>
  </p>