Skip to content

Instantly share code, notes, and snippets.

View BilalAlGhazi's full-sized avatar

Bilal AlGhazi BilalAlGhazi

View GitHub Profile
/**
* Function to flatten an array of arbitrarily nested arrays of integers into a flat array of integers
*
* @param {Array} inputArray The array to be flattenned.
* @param {Array} resultArray The result array.
*/
flattenArray = (inputArray, resultArray) => {
inputArray.forEach(function(entry) {
if(entry.constructor === Array){
flattenArray(entry, resultArray);
@BilalAlGhazi
BilalAlGhazi / en-product.json
Created July 17, 2022 17:19
Product data in spearate collection per language
{
"id": "1",
"sku": "1234567",
"price": "9.99",
"name": "Product name in English",
"description": "Product description in English"
}