Deprecated: Function create_function() is deprecated in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/plugins/wp-automatic/wp-automatic.php on line 70
Beginner JavaScript Tutorial – 32 – reverse, push, sort | D4mations.com
  • Monday , 26 October 2020

Beginner JavaScript Tutorial – 32 – reverse, push, sort

Code Canyon



Facebook – https://www.facebook.com/TheNewBoston-464114846956315/
GitHub – https://github.com/buckyroberts
Google+ – https://plus.google.com/+BuckyRoberts
LinkedIn – https://www.linkedin.com/in/buckyroberts
reddit – https://www.reddit.com/r/thenewboston/
Support – https://www.patreon.com/thenewboston
thenewboston – https://thenewboston.com/
Twitter – https://twitter.com/bucky_roberts

Original source

3d Ocean

Related Posts

22 Comments

  1. Richard B
    November 17, 2017 at 12:21

    If you want to list your array elements as you sort, reverse, push the elements see below. Thanks Bucky for the lessons! Doh, you just covered this in lesson 34.

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8" />
    <title>JS Lesson 32</title>
    <script type="text/javascript">
    function listArray(myArray, header) {
    // list elements in array
    document.write(header + " list:<br />");
    for (x = 0; x < myArray.length; x++) {
    document.write("myArray[" + x + "]: " + myArray[x] + "<br />");
    }
    document.write("<hr /><br />");
    }
    </script>
    </head>
    <body>
    <h2>Lesson 32 – reverese, push, sort</h2>
    <hr />
    <script type="text/javascript">
    var pets = new Array("Daisy", "Moe", "Fluffy", "Truman");
    listArray(pets, "Pet");
    pets.sort();
    listArray(pets, "Pet (sorted)");
    pets.reverse();
    listArray(pets, "Pet (reversed)");
    pets.push("Abbey");
    listArray(pets, "Pet (push Abby)");
    </script>
    </body>
    </html>

  2. sunil Bhatraju
    November 17, 2017 at 12:21

    why doesn't this one work "string1.reverse();" ?

  3. sunil Bhatraju
    November 17, 2017 at 12:21

    why doesn't this one work "string1.reverse();" ?

  4. sunil Bhatraju
    November 17, 2017 at 12:21

    why doesn't this one work "string1.reverse();" ?

  5. Jahan Guerra
    November 17, 2017 at 12:21

    i am embarrasing because i am slow 10 yaer old typer

  6. TheDude
    November 17, 2017 at 12:21

    120 yeA

  7. TheDude
    November 17, 2017 at 12:21

    119

  8. Lablnet
    November 17, 2017 at 12:21

    Thanks

  9. Nayan Tiwari
    November 17, 2017 at 12:21

    The string is separated even without using "join()" function. Wassup with this? o.o

  10. Grox's Channel
    November 17, 2017 at 12:21

    Why didn't you mention splice? It seems to be very important (through push and pop cover the abilities of splice).

  11. Grox's Channel
    November 17, 2017 at 12:21

    I WON! YAY!

  12. Ansin HarSin
    November 17, 2017 at 12:21

    Hi, Bucky, I;m from Israel, thank you for your learn us, about lesson Tutorial No' 32, i have problem ' i could not printing it, something going wrong, even i cheeked it many time, and every thing type right without any mistake,… What could be a problem, and how can i solve it,,. Thank in advance,.

  13. pavew ew
    November 17, 2017 at 12:21

    If you wanted to write it faster you could have just written document.write(bp)

  14. ganraj kelkar
    November 17, 2017 at 12:21

    so array is a stack in javascript :/

  15. Kakistocrator
    November 17, 2017 at 12:21

    he said titi 😛

  16. Yashi Malik
    November 17, 2017 at 12:21

    Hey Mr bucky!!!
    I am a great fan of ur videos these r the best material for any beginner.
    thanku so much for ur work,but i have a question
    q)- Why do you print the array by using the join command instead we can just write
    document.write(array_name);
    and this will print the array as a string separated by commas;)
    sorry if u consider it as an offense doesnt mean it that way
    btw Thanku Soo much.

  17. Nangsey Wangdi
    November 17, 2017 at 12:21

    thank you so much for the tutorial Mr. Bucky.

  18. Dan Varlan
    November 17, 2017 at 12:21

    Great tutorial as always 😀

  19. sean123654
    November 17, 2017 at 12:21

    Head,Shoulders,Tongue,Zoo,apple?,apracotes,hotdog,knees,liver punch

    Careful the sort method will put CAPITAL letters first #liverpunch! lol

  20. Super Horizont
    November 17, 2017 at 12:21

    koji kralj

  21. Emad El Sammad
    November 17, 2017 at 12:21

    Why in earth would we use Bp.Push Array when we can just add whatever elements we need in the original array??

  22. HackExcel Tutorials
    November 17, 2017 at 12:21

    32nd haha for a second sound like he said 30 second.

Leave A Comment

You must be logged in to post a comment.