Community
    • Login

    HOw to add count function to keep the amount of objects in my array while also using the alphabeticall function

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 1.4k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Matthew PELLINGM
      Matthew PELLING
      last edited by

      <html>
      <body>

      <p>The sort() method sorts an array alphabetically.</p>

      <button onclick=“myFunction()”>Try it</button>

      <p id=“demo”></p>

      <script>
      var fruits = [“Banana”, “Orange”, “Apple”, “Mango”];
      document.getElementById(“demo”).innerHTML = fruits;

      function myFunction() {
      fruits.sort();
      document.getElementById(“demo”).innerHTML = fruits;
      }
      </script>

      </body>
      </html>

      1 Reply Last reply Reply Quote 0
      • MAPJe71M
        MAPJe71
        last edited by

        This is not a Notepad++ related question. Try a community or a message board related to JavaScript or simply Google for it, there’s tons of information out there.

        1 Reply Last reply Reply Quote 2
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors