Jump to content

sixwi

Members
  • Content Count

    2
  • Joined

  • Last visited

Community Reputation

0 Neutral

About sixwi

  • Rank
    Newbie
  1. NEVERMIND - I figured it out.... but I can't figure out how to delete this topic! I'll go ahead and explain the function anyway. <script> var fruits = ["Banana", "Orange", "Apple", "Mango"]; document.getElementById("demo").innerHTML = isArray(fruits); function isArray(myArray) { return myArray.constructor.toString().indexOf("Array") > -1; } </script> Breakdown: The parameter (myArray) will be the "fruits" array. myArray.constructor would return "function Array() { [native code] }". Which gets converted to a string with the toStri
  2. Hello - first time posting. I've searched the forums to see if anyone else had the same question, with no luck. I'm going through the lessons in the tutorial but I can't figure out what's going on in part of the JS Type Conversion lesson. I'll link to the full lesson here, but below is the part I'm having trouble with: (mainly the function) I have no idea what's happening in the function... could someone be kind enough to break it down in detail for me? I understand how arrays work. But the function here has me stumped. Thanks so much
×
×
  • Create New...