Javascript Array Method Stack and Queue Tutorial
โœ‚๐Ÿƒ๐Ÿพโ€โ™€๏ธ๐Ÿƒ๐Ÿผโ€โ™‚๏ธ
๐Ÿ“–

Javascript Array Method Stack and Queue Tutorial

Javascript Array Method Stack and Queue Tutorial

The arrays involved in yesterdayโ€™s Javascript Array Method Solar System Planets Game Tutorial can represent โ€œorderโ€ where once there was none. And in inventory control, how you organize inventory pricing can use arrays in a โ€ฆ

  • FIFO way โ€ฆ like a queue โ€ฆ First In, First Out
  • LIFO way โ€ฆ like a stack โ€ฆ Last In, First Out

โ€ฆ and we demonstrate some such scenarios with ourchanged inhouse HTML/CSS/Javascipt client side array_workโšซhtml liveโœ‚run link you can try, also, below, as โ€ฆ

Number Queue scenario (where Ticket Number creation uses push and Ticket Service uses shift) โ€ฆ
Card Stack scenario (where Card shuffling uses unshift and Card dealing uses shift) โ€ฆ

โ€ฆ hopefully to get your โ€œimagination juicesโ€ flowing!



Previous relevant Javascript Array Method Solar System Planets Game Tutorial is shown below.

Javascript Array Method Solar System Planets Game Tutorial

Javascript Array Method Solar System Planets Game Tutorial

You learn something, then you apply it in a game. Sounds good, huh?

There is nothing like applying your knowledge close to when you learn it, for that information to take hold. And for it to be instinctual, perhaps a game where โ€ฆ

  • Number of goes โ€ฆ and โ€ฆ
  • Number of seconds elapsed

โ€ฆ can help cement that knowledge in your brain. We think so. And so we have a โ€œSolar System Planets Gameโ€ part to our web application of yesterdayโ€™s Javascript Array Method Primer Tutorial for you to try, optionally that is.

The game goes โ€ฆ

  • you are presented with an initial โ€œWork onโ€ names array such as โ€ฆ


    var names = ["Neptune", "Venus", "Uranus"];

    โ€ฆ
  • and you use your skills with โ€ฆ

    โ€ฆ

  • to turn that into a sowโ€™s earnames array that look like โ€ฆ


    names = ["Mercury", "Venus", "Earth","Mars", "Jupiter", "Saturn", "Uranus", "Neptune", "Pluto"];

    โ€ฆ
  • to assess your โ€œGoes / Timeโ€ score against previous attempts if that is how you roll?!

Ourchanged inhouse HTML/CSS/Javascipt client side array_workโšซhtml Solar Systems Planet Game link you can try, also, below โ€ฆ


Previous relevant Javascript Array Method Primer Tutorial is shown below.

Javascript Array Method Primer Tutorial

Javascript Array Method Primer Tutorial

If you are interested in writing your own web applications, on the โ€œclientโ€ side of the work, there are three major categories of skills, those being โ€ฆ

  • HTML (design)
  • CSS (style)
  • Javascript (workings)

โ€ฆ and a subcategory of โ€œJavascript (workings)โ€ skills would definitely be โ€ฆ

  • the use of arrays โ€ฆ and โ€ฆ
  • array โ€œmethodsโ€

โ€ฆ โ€œmethodsโ€ being an object oriented idea of โ€œactions applied to objectsโ€ (that is that slightly bit of a different result to โ€œfunctionsโ€ overseeing and changing web application โ€œworkingsโ€ ignoring โ€œobjectsโ€ as such). Maybe think of โ€œmethodsโ€ as an โ€œadjectival wayโ€ to change a โ€œnounโ€ whereas โ€œfunctionsโ€ are like โ€œverbsโ€ acting on the โ€œwebpage contentโ€.

In this context, we stumbled upon a great link called JavaScript Array Push, Pop, Shift and Unshift Methods with Examples that inspired me to construct a proof of concept web application to help a user who likes โ€œhands onโ€ approaches to learning, learn about array (object) โ€œmethodsโ€ โ€ฆ

โ€ฆ in our inhouse HTML/CSS/Javascipt client side array_workโšซhtml liveโœ‚run link you can try, also, below โ€ฆ

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

This entry was posted in eLearning, Event-Driven Programming, Tutorials and tagged , , , , , , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *