In this video, we go over functions provided by ruby for performing operations on arrays. This will be very important when you're scripting in ruby as arrays for one of the most common data structures used to hold data for manipulation.
Ruby 101 - Array Creation - • Ruby 101 : Arrays : Creating An Array - N...
Let's keep the momentum going to becoming ruby experts in a single day!
** QUIZ FOR THIS SESSION ** - https://goo.gl/forms/4CnMai23hn45wVhu1
The functions we cover include
Size
length - check the size of the array
size - check the size of the array (synonymous with length)
count - check the size of array (synonymous with size)
Contents
empty? - check if array is empty
include? - check if an element is present inside an array
Addition Operations
Append Operator- Append element to an array
insert - Synonymous with append operator. Adds to an array, but can be used to insert at a particular position
push - pushes element to end of array
unshift - adds element to the beginning of the array
Deletion Operations
pop - removes element from end of array
shift - removes element from end of array
delete - removes specified element from an array
delete_at - removes element from a particular position inside the array
Comment below for any questions you want answered.
If you found this video useful, like and subscribe.
If you want to make my day, please follow me on social media
Twitter : / progbypractise
Facebook : / programming-by-practising-1713777571991152 Website : http://programmingbypractising.wordpr...