Skip to content

Array Operations

List manipulation — chunk, flatten, group, map, reduce, zip, and more.

12 modules

ModuleDescription
सरणी खंडसरणी को निर्दिष्ट आकार के खंडों में विभाजित करें
संक्षिप्त करेंऐरे से null/खाली मान हटाएं
सरणी अंतरपहली सरणी में ऐसे तत्व खोजें जो अन्य में नहीं हैं
हटाएंऐरे से पहले N तत्व हटाएं
सरणी समतलनेस्टेड सरणियों को एकल सरणी में समतल करें
समूहित करेंऐरे तत्वों को एक कुंजी द्वारा समूहित करें
सरणी प्रतिच्छेदनसरणियों के बीच समान तत्व खोजें
सरणी जोड़ेंसरणी तत्वों को स्ट्रिंग में जोड़ें
सरणी मैपसरणी में प्रत्येक तत्व को रूपांतरित करें
सरणी रिड्यूससरणी को एकल मान में घटाएं
लेंऐरे से पहले N तत्व लें
ऐरे संयोजित करेंकई ऐरे को तत्व-वार संयोजित करें

Modules

सरणी खंड

array.chunk

सरणी को निर्दिष्ट आकार के खंडों में विभाजित करें

Parameters:

NameTypeRequiredDefaultDescription
arrayarrayYes-Array of items to process. Can be numbers, strings, or objects.
sizenumberYes10Number of items per chunk

Output:

FieldTypeDescription
resultarrayखंडों की सरणी
chunksnumberखंडों की सरणी

Example: Chunk into groups of 3

yaml
array: [1, 2, 3, 4, 5, 6, 7, 8, 9]
size: 3

Example: Batch process items

yaml
array: ["a", "b", "c", "d", "e"]
size: 2

संक्षिप्त करें

array.compact

ऐरे से null/खाली मान हटाएं

Parameters:

NameTypeRequiredDefaultDescription
arrayarrayYes-संक्षिप्त करने के लिए ऐरे
remove_empty_stringsbooleanNoTrueखाली स्ट्रिंग्स हटाएं
remove_zerobooleanNoFalseखाली स्ट्रिंग्स हटाएं
remove_falsebooleanNoFalseशून्य मान हटाएं

Output:

FieldTypeDescription
resultarrayगलत मान हटाएं
removednumberसंक्षिप्त किया गया ऐरे

सरणी अंतर

array.difference

पहली सरणी में ऐसे तत्व खोजें जो अन्य में नहीं हैं

Parameters:

NameTypeRequiredDefaultDescription
arrayarrayYes-Array of items to process. Can be numbers, strings, or objects.
subtractarrayYes-Arrays containing items to remove from the base array

Output:

FieldTypeDescription
resultarrayपहली सरणी के अद्वितीय तत्व
lengthnumberपहली सरणी के अद्वितीय तत्व

Example: Find unique elements

yaml
array: [1, 2, 3, 4, 5]
subtract: [[2, 4], [5]]

हटाएं

array.drop

ऐरे से पहले N तत्व हटाएं

Parameters:

NameTypeRequiredDefaultDescription
arrayarrayYes-स्रोत ऐरे
countnumberYes1स्रोत ऐरे

Output:

FieldTypeDescription
resultarrayहटाने के लिए तत्वों की संख्या
droppednumberशेष तत्व

सरणी समतल

array.flatten

नेस्टेड सरणियों को एकल सरणी में समतल करें

Parameters:

NameTypeRequiredDefaultDescription
arrayarrayYes-Array of items to process. Can be numbers, strings, or objects.
depthnumberNo1How many levels of nesting to flatten (-1 for infinite)

Output:

FieldTypeDescription
resultarrayसमतल सरणी
lengthnumberसमतल सरणी

Example: Flatten one level

yaml
array: [[1, 2], [3, 4], [5, 6]]
depth: 1

Example: Flatten all levels

yaml
array: [[1, [2, [3, [4]]]]]
depth: -1

समूहित करें

array.group_by

ऐरे तत्वों को एक कुंजी द्वारा समूहित करें

Parameters:

NameTypeRequiredDefaultDescription
arrayarrayYes-समूहित करने के लिए वस्तुओं का ऐरे
keystringYes-समूहित करने के लिए वस्तुओं का ऐरे

Output:

FieldTypeDescription
groupsobjectसमूहित करने के लिए गुण का नाम
keysarrayसमूहित परिणाम
countnumberसमूहित परिणाम

सरणी प्रतिच्छेदन

array.intersection

सरणियों के बीच समान तत्व खोजें

Parameters:

NameTypeRequiredDefaultDescription
arraysarrayYes-Array of arrays to process (for intersection, union)

Output:

FieldTypeDescription
resultarrayसमान तत्व
lengthnumberसमान तत्व

Example: Find common elements

yaml
arrays: [[1, 2, 3, 4], [2, 3, 5], [2, 3, 6]]

सरणी जोड़ें

array.join

सरणी तत्वों को स्ट्रिंग में जोड़ें

Parameters:

NameTypeRequiredDefaultDescription
arrayarrayYes-Array of items to process. Can be numbers, strings, or objects.
separatorselect (, , ,, , `
, , - `, ``)No,String to insert between items when joining

Output:

FieldTypeDescription
resultstringजोड़ी गई स्ट्रिंग

Example: Join with comma

yaml
array: ["apple", "banana", "cherry"]
separator: ,

Example: Join with newline

yaml
array: ["Line 1", "Line 2", "Line 3"]
separator:

सरणी मैप

array.map

सरणी में प्रत्येक तत्व को रूपांतरित करें

Parameters:

NameTypeRequiredDefaultDescription
arrayarrayYes-Array of items to process. Can be numbers, strings, or objects.
operationselect (multiply, add, subtract, divide, extract, uppercase, lowercase, trim, tostring, tonumber)Yes-Transformation to apply to each item
valueanyNo-Value for the operation: number for math operations, field name for extract

Output:

FieldTypeDescription
resultarrayरूपांतरित सरणी
lengthnumberरूपांतरित सरणी

Example: Multiply numbers

yaml
array: [1, 2, 3, 4, 5]
operation: multiply
value: 2

Example: Extract field from objects

yaml
array: [{"name": "Alice", "age": 30}, {"name": "Bob", "age": 25}]
operation: extract
value: name

सरणी रिड्यूस

array.reduce

सरणी को एकल मान में घटाएं

Parameters:

NameTypeRequiredDefaultDescription
arrayarrayYes-Array of items to process. Can be numbers, strings, or objects.
operationselect (sum, product, average, min, max, count, join, first, last)Yes-How to combine all items into a single value
separatorselect (, , ,, , `
, , - `, ``)No,String to insert between items when joining

Output:

FieldTypeDescription
resultanyघटाया गया मान
operationstringघटाया गया मान

Example: Sum numbers

yaml
array: [1, 2, 3, 4, 5]
operation: sum

Example: Join strings

yaml
array: ["Hello", "World", "from", "Flyto"]
operation: join
separator:

लें

array.take

ऐरे से पहले N तत्व लें

Parameters:

NameTypeRequiredDefaultDescription
arrayarrayYes-स्रोत ऐरे
countnumberYes1स्रोत ऐरे

Output:

FieldTypeDescription
resultarrayलेने के लिए तत्वों की संख्या
lengthnumberलिये गए तत्व

ऐरे संयोजित करें

array.zip

कई ऐरे को तत्व-वार संयोजित करें

Parameters:

NameTypeRequiredDefaultDescription
arraysarrayYes-संयोजित करने के लिए ऐरे का ऐरे
fill_valueanyNo-संयोजित करने के लिए ऐरे का ऐरे

Output:

FieldTypeDescription
resultarrayलापता तत्वों के लिए मान
lengthnumberसंयोजित ऐरे

Released under the Apache 2.0 License.