Just so you know series talks about things that some of you might know or not. I will introduce to you some of the rarely used Array Methods in Javascript
seen from China
seen from Türkiye
seen from Hong Kong SAR China
seen from Indonesia
seen from China
seen from United States
seen from United States
seen from South Korea
seen from United States
seen from China
seen from United States

seen from Malaysia

seen from United States
seen from United States

seen from Germany
seen from China

seen from United States

seen from China
seen from France
seen from United States
Just so you know series talks about things that some of you might know or not. I will introduce to you some of the rarely used Array Methods in Javascript

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
配列の末尾・先頭に要素を追加
末尾に追加
arrayB.push({ value: 'all' });
先頭についか
arrayB.unshift({ value: 'all' });
clase 2/5/2023
El dia de hoy vimos arreglos como .join, .shift, .unshift, .pop, .push, . splice
JavaScript array push method is used to push one or more values into an array. Customize JavaScript array using push(), pop(), shift() & unshift() methods.
im ready to start up the unSHIFT fancub let's do it yep fanclub

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Stacks and Queues, Part 2 : Simple Ruby Class Implementation
A Queue on Mt. Fuji
In the first part of this post, I spoke about the definition of stacks and queues.
As a quick recap, a stack is a data structure that is organized according to LIFO: Last-In, First Out.
Stack has two basic methods:
Push, which pushes an object onto the top of the stack, and
Pop, which removes and returns the item at the top of the stack.
Since all operations on a stack happen at the top, the last item added is always the first thing removed. As a consequence, items in the back of the stack could potentially stay there for a long time.
To visualize a stack, think of clown car with only one door.
The last clown to get into the car is at the top of the stack. He is the first one to get out since he is closest to the door!
By contrast, the first clown to go into the car is stuck at the bottom of the stack. He has a long wait, and can't get out of the car until all of the other clowns on top of him exit first.
Ruby Implementation of a Stack class
Ruby thoughtfully implements both of the push and pop methods on the Array class!
So, you can easily define a simple Stack class as follows:
In terms of the array-based implementation of the SimpleStack class,
for a stack containing n items,
stack[n-1] is the top of the stack, and
stack[0] is the bottom of the stack.
Queues
Now, also recall that queue is a data structure that is organized according to FIFO: First-In, First Out.
Queue has two basic methods:
Enqueue, which adds an item onto the end of the queue, and
Dequeue, which removes and returns the item at the front of the queue.
Queues are much more familiar data structures than stacks. New people joining the queue go to the end of the line (just like at a deli counter or an amusement park ride) and the person at the front of the line is the next to be served.
The implementation of a simple queue class in Ruby will also use the Array class. But we'd like to also use the Array#pop method if we can, as it is much more efficient than anything we could write ourselves.
Therefore, we make the choice that we will set up the array for our queue implementation exactly the same way as Ruby does for a stack, i.e.
for a queue containing n items,
queue[n-1] is the front of the queue, and
queue[0] is the back of the queue.
This is not an obvious choice (at least it wasn't to me!) But it makes writing a robust and useful Queue class in Ruby as simple as can be.
I will start using this in my further work in Ruby. Hopefully this is helpful to others as well!
Array#unshift
unshift(obj, ...)
Prepends objects to the front of self, moving other elements upwards.
I mostly see unshift paired with shift, but I am going to run some samples of it by itself so I can become comfortable with using it solo.
This is used to add elements to the front of the array. It does not create a new array, but it does modify the existing array.
things = %w{ kittens boxes bows hills } things.unshift("music")
Our array has been modified permanently:
puts things.inspect ["music", "kittens", "boxes", "bows", "hills"]