Transfer to function



  • We'll have to give it to the chips and, for each mass, alert it to its meaning, for example. var someArray = newArray[12, 'str', 234, true], upon entry someArray[1] - by alert, we'll get a message of value. str
    The function always gives undefined, found the reason: it's not a function, it doesn't see it. Checked out a few ways to alert I've given meaning to every mass, but I'm facing it. undefined♪ Tell me what I'm doing wrong.



  • Is that okay?

    function alertArray(arr) {
      for (i = 0; i < arr.length; i++) {
        alert(arr[i]);
      }
    }
    

    var someArray = [12, 'str', 234, true];
    alertArray(someArray);




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2