Inline Functions Flashcards
(24 cards)
{{get}}
extracts things out of an array or collection
{{split}}
splits names and arrays
[] Sqaure Brackets
Indicates an object
{{join}}
It’s going to join the array in a text string with a seperator
{{length}}
It will output how many items are in the array
{{keys}}
it’s gonna tell us what the individual keys are from the collection (it will output the raw names).. not useful for arrays because it will count from 0 instead of 1
{{slice}}
selects parts of an array
{{merge}}
Opposite of slice, it adds an array
{{contain}}
it’s going to check if an array contains something and will output true or false
{{remove}} works with simpler array
removes something from the array
{{add}}
adds something to the array
{{map}} most useful
looks through a complex array and pulls out certain keys
13.2 Array Video … 5:13 seconds use case and explanations
{{shuffle}}
rearrange the order randomly on all the items within an array
{{sort}}
Opposite of shuffle - take information and put it back in order
asc = Ascending order
We can sort by the deepest point in the array
{{reverse}}
reverse order of items
{{first}}
extract the first item from an array
{{last}}
extract the last item from the array
{{flatten}}
From complex arrays, it will move the deep arrays to the same level
{{distinct}}
removes duplicates if we want… we can deep level into the arrays.
{{deduplicate}}
it will remove the duplicates, but simpler instead (can’t go deep)
{{toCollection}}
Convert an array to a collection
I want the keys to come from item 1, and the values from item 2
(Key-Value Pair)
{{toArray}}
Convert from Array to collection
Opposite of {{toCollection}}
{{omit}}
gives us a collection except one thing, so give us this data, but without XYZ
{{pick}}
Pick certain items within a collection